コード例 #1
0
ファイル: test_data.py プロジェクト: Adeilsoara/LearnPython
def test_kidney_3d_multichannel():
    """Test that 3D multichannel image of kidney tissue can be loaded.

    Needs internet connection.
    """
    fetch('data/kidney.tif')
    kidney = data.kidney()
    assert kidney.shape == (16, 512, 512, 3)
コード例 #2
0
import matplotlib.pyplot as plt
import numpy as np
from scipy import ndimage as ndi

import plotly
import plotly.express as px
from skimage import data


#####################################################################
# Load image
# ==========
# This biomedical image is available through `scikit-image`'s data registry.

data = data.kidney()

#####################################################################
# The returned dataset is a 3D multichannel image:

print(f'number of dimensions: {data.ndim}')
print(f'shape: {data.shape}')
print(f'dtype: {data.dtype}')

#####################################################################
# Dimensions are provided in the following order: ``(z, y, x, c)``, i.e.,
# ``[plane, row, column, channel]``.

n_plane, n_row, n_col, n_chan = data.shape

#####################################################################