def __init__(self, module_manager): SimpleVTKClassModuleBase.__init__( self, module_manager, vtk.vtkMINCImageReader(), 'Reading vtkMINCImage.', (), ('vtkMINCImage',), replaceDoc=True, inputFunctions=None, outputFunctions=None)
def __init__(self, module_manager): SimpleVTKClassModuleBase.__init__(self, module_manager, vtk.vtkMINCImageReader(), 'Reading vtkMINCImage.', (), ('vtkMINCImage', ), replaceDoc=True, inputFunctions=None, outputFunctions=None)
if not sys.argv[1:]: print "Usage: python skullStripper.py image.mnc" sys.exit(1) else: filename = sys.argv[1] # first, load a script that sets the paths for the modules we load import paths import time import vtk import airs ext = os.path.splitext(filename)[1] if ext == '.mnc' or ext == '.MNC': reader = vtk.vtkMINCImageReader() reader.SetFileName(filename) reader.UpdateWholeExtent() imageData = reader.GetOutput() stripper = airs.vtkImageMRIBrainExtractor() stripper.SetInput( imageData ) # A kludge to handle low axial resolution images spacing = imageData.GetSpacing() zres = spacing[2] if zres > 1.5: bt = 0.50
#!/usr/bin/env python import vtk # Image pipeline reader = vtk.vtkMINCImageReader() reader.SetFileName("" + str(VTK_DATA_ROOT) + "/Data/t3_grid_0.mnc") viewer = vtk.vtkImageViewer() viewer.SetInputConnection(reader.GetOutputPort()) viewer.SetColorWindow(65535) viewer.SetColorLevel(0) #make interface viewer.Render()
def __init__(self): vtkImageReaderBase.vtkImageReaderBase.__init__(self) self.SetImageReader(vtk.vtkMINCImageReader())