# Install dependencies for this example
# Note: This does not include itkwidgets, itself
import sys
!{sys.executable} -m pip install itk-io
Requirement already satisfied: itk-io in /home/matt/bin/miniconda3/envs/itkwidgets/lib/python3.7/site-packages (5.1.0.post3)
Requirement already satisfied: itk-core==5.1.0.post3 in /home/matt/bin/miniconda3/envs/itkwidgets/lib/python3.7/site-packages (from itk-io) (5.1.0.post3)
WARNING: You are using pip version 20.1.1; however, version 20.2 is available.
You should consider upgrading via the '/home/matt/bin/miniconda3/envs/itkwidgets/bin/python -m pip install --upgrade pip' command.
from urllib.request import urlretrieve
import os
import itk
from itkwidgets import view
# Download data
file_name = '005_32months_T2_RegT1_Reg2Atlas_ManualBrainMask_Stripped.nrrd'
if not os.path.exists(file_name):
url = 'https://data.kitware.com/api/v1/file/564a5b078d777f7522dbfaa6/download'
urlretrieve(url, file_name)
image = itk.imread(file_name)
view(image, rotate=True, axes=True, vmin=4000, vmax=17000, gradient_opacity=0.9)
Viewer(axes=True, geometries=[], gradient_opacity=0.9, point_sets=[], rendered_image=<itk.itkImagePython.itkIm…