.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/data/plot_3d.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code or to run this example in your browser via Binder .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_data_plot_3d.py: ========================================== Datasets with 3 or more spatial dimensions ========================================== Most scikit-image functions are compatible with 3D datasets, i.e., images with 3 spatial dimensions (to be distinguished from 2D multichannel images, which are also arrays with three axes). :func:`skimage.data.cells3d` returns a 3D fluorescence microscopy image of cells. The returned dataset is a 3D multichannel image with dimensions provided in ``(z, c, y, x)`` order. Channel 0 contains cell membranes, while channel 1 contains nuclei. The example below shows how to explore this dataset. This 3D image can be used to test the various functions of scikit-image. .. GENERATED FROM PYTHON SOURCE LINES 17-40 .. raw:: html :file: images/sphx_glr_plot_3d_001.html .. code-block:: default from skimage import data import plotly import plotly.express as px import numpy as np img = data.cells3d()[20:] # omit some slices that are partially empty img = img[5:26] upper_limit = 1.5 * np.percentile(img, q=99) img = np.clip(img, 0, upper_limit) fig = px.imshow( img, facet_col=1, animation_frame=0, binary_string=True, binary_format="jpg", ) fig.layout.annotations[0]["text"] = "Cell membranes" fig.layout.annotations[1]["text"] = "Nuclei" plotly.io.show(fig) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 3.619 seconds) .. _sphx_glr_download_auto_examples_data_plot_3d.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/scikit-image/scikit-image/v0.22.x?filepath=notebooks/auto_examples/data/plot_3d.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_3d.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_3d.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_