Interactive Image Viewer: display()

For fast and interactive visualization of an ImageStack, IntensityTable, and BinaryMaskCollection, starfish utilizes napari. Detailed usage instructions can be found in the Visualizing Data tutorial.

from starfish import display
starfish.core._display.display(stack=None, spots=None, masks=None, viewer=None, project_axes=None, mask_intensities=0.0, radius_multiplier=1, z_multiplier=1)[source]

Display an image stack, detected spots, and masks using napari <https://github.com/napari/napari>.

Parameters
stackImageStack

ImageStack to display

spotsIntensityTable

IntensityTable containing spot information that was generated from the submitted stack.

masksBinaryMaskCollection

Segmentation instance masks used to annotate the submitted stack.

viewernapari.Viewer

Napari viewer to append the ImageStack and/or spots to. If None, creates a new viewer. Note: appending is only supported in interactive environments.

project_axesOptional[Set[Axes]]

If provided, both the ImageStack and the Spots will be maximum projected along the selected axes. Useful for displaying spots across coded assays where spots may not appear in specific rounds or channels.

mask_intensitiesFloat

hide markers that correspond to intensities below this threshold value; note that any marker that is np.nan will ALSO be masked, allowing users to pre-mask the intensity table (see documentation on IntensityTable.where() for more details) (default 0, no masking)

radius_multiplierint

Multiplies the radius of the displayed spots (default 1, no scaling)

z_multiplierint

Multiplies the radius of the spots in z, to account for anisotropy.

Notes

  • To use in ipython, use the %gui qt magic.

  • napari axes are labeled with the ImageStack axis names

  • Requires napari 0.3.4: use pip install starfish[napari] to install all necessary requirements

Examples

  1. Display a stack to evaluate a filtering result. Just pass any ImageStack!

>>> from starfish import display
>>> display(stack)

2. Display spots of a single-molecule FISH experiment: smFISH will produce IntensityTables where most values are np.NaN. These will be masked automatically, so passing an ImageStack + IntensityTable will display spots in the rounds and channels that they are detected

>>> from starfish import display
>>> display(stack, intensities)

3. Diagnose spot calls within each round and channel of a coded experiment. A user might want to evaluate if spot calling is failing for a specific round/channel pair. To accomplish this, pass the intensity threshold used by the spot called to eliminate sub-threshold spots from channels. The user can additionally filter the IntensityTable to further mask additional spots (any np.NaN value will not be displayed)

>>> from starfish import display
>>> mask_intensities = 0.3  # this was the spot calling intensity threshold
>>> display(stack, intensities, mask_intensities=mask_intensities)

4. Evaluate spot calls across rounds and channels by visualizing spots on a max projection of The rounds and channels.

>>> from starfish import display, Axes
>>> display(stack, intensities, project_axes={Axes.CH, Axes.ROUND})

5. Compare the image before (raw_stack) and after (filtered_stack) filtering by displaying two stacks in the same Viewer.

>>> from starfish import display
>>> viewer = display(raw_stack)
>>> viewer = display(stack=filtered_stack, viewer=viewer)