Example #1
0
 def _load_nifti_volume(self, fname):
     """ Return a loaded NiftiImage given the absolute path to the file
     
     Parameters
     ----------
     fname : string
         full path to a temporary nifti volume file
     
     """
     from cviewer.io.nipy.api import load_image
     return load_image(fname)
Example #2
0
                     height=250,
                     width=300),
                show_labels=False,
            ),
            Group(
                Item('scene_x',
                     editor=SceneEditor(scene_class=Scene),
                     height=250,
                     width=300),
                Item('scene3d',
                     editor=SceneEditor(scene_class=MayaviScene),
                     height=250,
                     width=300),
                show_labels=False,
            ),
        ),
        resizable=True,
        title='Volume Slicer',
    )


fname = sys.argv[1]
volume = load_image(fname)
# is it 4d?
if len(volume._data.shape) == 4:
    dat = volume._data[0, :, :, :]  # we pick the first image in a 4d array
elif len(volume._data.shape) == 3:
    dat = volume._data

m = VolumeSlicer(data=dat)
m.configure_traits()
                            editor=SceneEditor(scene_class=Scene), 
                            height=250, width=300),
                       Item('scene_z',
                            editor=SceneEditor(scene_class=Scene), 
                            height=250, width=300),
                       show_labels=False,
                  ),
                  Group(
                       Item('scene_x',
                            editor=SceneEditor(scene_class=Scene), 
                            height=250, width=300),
                       Item('scene3d',
                            editor=SceneEditor(scene_class=MayaviScene),
                            height=250, width=300),
                       show_labels=False,
                  ),
                ),
                resizable=True,
                title='Volume Slicer',
                )

fname = sys.argv[1]
volume = load_image(fname)
# is it 4d?
if len(volume._data.shape) == 4:
    dat = volume._data[0,:,:,:] # we pick the first image in a 4d array
elif len(volume._data.shape) == 3:
    dat = volume._data
    
m = VolumeSlicer(data=dat) 
m.configure_traits()