3つ以上の空間次元を持つデータセット#

ほとんどのscikit-image関数は、3Dデータセット、つまり3つの空間次元を持つ画像(3つの軸を持つ配列でもある2Dマルチチャネル画像とは区別されます)と互換性があります。skimage.data.cells3d() は、細胞の3D蛍光顕微鏡画像を返します。返されるデータセットは、(z, c, y, x) の順で次元が与えられた3Dマルチチャネル画像です。チャネル0には細胞膜が含まれ、チャネル1には核が含まれています。

次の例は、このデータセットを探索する方法を示しています。この3D画像は、scikit-imageのさまざまな機能をテストするために使用できます。

Downloading file 'data/cells3d.tif' from 'https://gitlab.com/scikit-image/data/-/raw/2cdc5ce89b334d28f06a58c9f0ca21aa6992a5ba/cells3d.tif' to '/home/runner/.cache/scikit-image/0.25.0'.

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)

スクリプトの総実行時間: (0 分 3.531 秒)

Sphinx-Galleryによって生成されたギャラリー