Simple volume slicing ===================== Here we present an example for visualizing slices from 3D images. """ import os import nibabel as nib from dipy.data import fetch_bundles_2_subjects from fury import window, actor, ui ############################################################################### # Let's download and load a T1. fetch_bundles_2_subjects() fname_t1 = os.path.join(os.path.expanduser('~'), '.dipy', 'exp_bundles_and_maps', 'bundles_2_subjects', 'subj_1', 't1_warped.nii.gz') img = nib.load(fname_t1) data = img.get_data() affine = img.affine ############################################################################### # Create a Scene object which holds all the actors which we want to visualize. scene = window.Scene() scene.background((0.5, 0.5, 0.5))
Here we present an example for visualizing slices from 3D images. """ from __future__ import division import os import nibabel as nib from dipy.data import fetch_bundles_2_subjects from dipy.viz import window, actor, ui """ Let's download and load a T1. """ fetch_bundles_2_subjects() fname_t1 = os.path.join(os.path.expanduser('~'), '.dipy', 'exp_bundles_and_maps', 'bundles_2_subjects', 'subj_1', 't1_warped.nii.gz') img = nib.load(fname_t1) data = img.get_data() affine = img.affine """ Create a Renderer object which holds all the actors which we want to visualize. """ renderer = window.Renderer()