from itkwidgets import view
import itkwidgets
import nibabel as nib
nii = nib.load('./nii/demo.nii.gz')
img = nii.get_data()
viewer = view(img,cmap=itkwidgets.cm.grayscale)
viewer
image.png
image.png
示例:
image.png
image.png
Installation
To install the widgets for the Jupyter Notebook:
$ pip install itkwidgets
For Jupyter Lab, additionally run:
$ jupyter labextension install @jupyter-widgets/jupyterlab-manager itk-jupyter-widgets
#Usage
#In Jupyter, import the view function:
from itkwidgets import view
#Then, call the view function at the end of a cell, passing in the image to examine:
view(image)
#For information on additional options, see the view function docstring:
view?
网友评论