Since version 0.10.0 stackview comes with support for viewing image data that has more than 3 dimensions.
import stackview
from skimage.io import imread
We use the mitosis example dataset from ImageJ.
image = imread("data/mitosis.tif")
image = image[...,40:120].swapaxes(-1,-2)
image.shape
(51, 5, 2, 80, 196)
This image has 5 dimensions. The meaning of these dimensions must be taken from the meta-data or guessed. In our case it is Time, Z, Channel, Y and X. Stackview will automatically add sliders for all but the last two dimensions.
stackview.slice(image)
VBox(children=(HBox(children=(VBox(children=(ImageWidget(height=80, width=196),)),)), VBox(children=(IntSlider…
In the view above, you can only inspect a single channel. In order to blend channels over each other, you need to use stackview.switch
with toggleable=True
. As the channel dimension cannot be determined automatically, you need to extract the channels yourself. It is also recommended to choose colormaps, to make the channels distinguishable.
In ImageJ-language, we call this a composite image.
stackview.switch(images=[
image[:,:,0], # channel 1
image[:,:,1] # channel 2
],
colormap=[
"pure_green",
"pure_magenta"
],
toggleable=True,
zoom_factor=2)
VBox(children=(HBox(children=(VBox(children=(ImageWidget(height=160, width=392),)),)), HBox(children=(ToggleBu…
Static viewers such as imshow
and insight
work as well, but might be less informative when used on n-dimensional data as the visualize a maximum intensity project over all dimensions but the last two.
stackview.imshow(image)
stackview.insight(image)
|
|