Beispiel #1
0
    def set_ndimage_data(self, image):
        if isinstance(image, str):
            image = load_image(image)
        if not isinstance(image, ni_api.Image):
            raise ValueError("argument provided was not a NIPY Image")
        self._ndimage = image
        
        idata = image._data
        self._min_t = float(np.ma.min(idata))
        self._max_t = float(np.ma.max(idata))
        self.norm = (self._min_t, self._max_t)

        self._new_slice_from_ndimage()
Beispiel #2
0
from xipy import TEMPLATE_MRI_PATH
from xipy.vis.three_dee_viewer import MayaviViewer
from xipy.overlay.image_overlay import ImageOverlayManager, ImageOverlayWindow
import xipy.io as xio

from PyQt4 import QtCore, QtGui
import sys, os
if QtGui.QApplication.startingUp():
    app = QtGui.QApplication(sys.argv)
else:
    app = QtGui.QApplication.instance() 

anat = xio.load_spatial_image(TEMPLATE_MRI_PATH)
func = xio.load_image(os.path.join(os.path.dirname(__file__),
                                  '../data/dtk_dti_out/dti_fa.nii'))
func_man = ImageOverlayManager(None, overlay=func)
#                              ^^^^ API will change soon 
        
win = MayaviViewer(image=anat)
win.make_tool_from_functional_manager(ImageOverlayWindow, func_man)

win.show()
app.exec_()
Beispiel #3
0
from xipy.colors import mayavi_tools
from xipy.overlay.image_overlay import ImageOverlayManager
from xipy.slicing import load_resampled_slicer
from xipy import TEMPLATE_MRI_PATH
from xipy.io import load_image

from PyQt4 import QtCore, QtGui
import sys
if QtGui.QApplication.startingUp():
    app = QtGui.QApplication(sys.argv)
else:
    app = QtGui.QApplication.instance()

mainwin = QtGui.QMainWindow()

anat = load_image(TEMPLATE_MRI_PATH)
## func = load_image('map_img.nii')

win = mayavi_widgets.MayaviWidget(parent=mainwin)
win.mr_vis.blender.main = anat

## func_man = ImageOverlayManager(win.mr_vis.blender.bbox, overlay=func)
## win.add_toolbar(func_man)

my_track_file = '/Users/mike/workywork/dipy-vis/brain1/brain1_scan1_fiber_track_mni.trk'
from mini_track_control import mini_track_feature
mf = mini_track_feature(my_track_file, win.mr_vis)


## SOME QT4 SETUP
mainwin.setCentralWidget(win)