예제 #1
0
    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)

        self._input = None
        self._writer = None
        self._writer_type = None

        wildCardString = 'Meta Image all-in-one (*.mha)|*.mha|' \
                         'Meta Image separate header/data (*.mhd)|*.mhd|' \
                         'Analyze separate header/data (*.hdr)|*.hdr|' \
                         'NIfTI (*.nii)|*.nii|' \
                         'NIfTI compressed (*.nii.gz)|*.nii.gz|' \
                         'All files (*)|*'

        # we now have a viewFrame in self._viewFrame
        FilenameViewModuleMixin.__init__(
            self,
            'Select a filename',
            wildCardString,
            {'Module (self)': self},
            fileOpen=False)

        # set up some defaults
        self._config.filename = ''

        self.sync_module_logic_with_config()
예제 #2
0
    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)
        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(self)

        # this is the output
        self._transformStack = transformStackClass(self)

        # we're going to use this to know when to actually read the data
        self._md5HexDigest = ''

        # we now have a viewFrame in self._viewFrame
        self._createViewFrame(
            'Select a filename to load',
            '2D Transform Stack file (*.2ts)|*.2ts|All files (*)|*',
            objectDict=None)

        # set up some defaults
        self._config.filename = ''
        self.config_to_logic()
        # make sure these filter through from the bottom up
        self.logic_to_config()
        self.config_to_view()
예제 #3
0
파일: objRDR.py 프로젝트: fvpolpeta/devide
    def __init__(self, module_manager):
        """Constructor (initialiser) for the PD reader.

        This is almost standard code for most of the modules making use of
        the FilenameViewModuleMixin mixin.
        """
        
        # call the constructor in the "base"
        ModuleBase.__init__(self, module_manager)

        # setup necessary VTK objects
	self._reader = vtk.vtkOBJReader()
        
        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(
            self,
            'Select a filename',
            'Wavefront OBJ data (*.obj)|*.obj|All files (*)|*',
            {'vtkOBJReader': self._reader})

        module_utils.setup_vtk_object_progress(self, self._reader,
                                           'Reading Wavefront OBJ data')

        # set up some defaults
        self._config.filename = ''

	self.sync_module_logic_with_config()
예제 #4
0
파일: vtiWRT.py 프로젝트: fvpolpeta/devide
    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)

        self._writer = vtk.vtkXMLImageDataWriter()
        
        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(
            self,
            'Select a filename',
            'VTK Image Data (*.vti)|*.vti|All files (*)|*',
            {'vtkXMLImageDataWriter': self._writer},
            fileOpen=False)



        module_utils.setup_vtk_object_progress(
            self, self._writer,
            'Writing VTK ImageData')

        self._writer.SetDataModeToBinary()

        # set up some defaults
        self._config.filename = ''
        self._module_manager.sync_module_logic_with_config(self)
예제 #5
0
    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)

        self._input = None
        self._writer = None
        self._writer_type = None

        wildCardString = 'Meta Image all-in-one (*.mha)|*.mha|' \
                         'Meta Image separate header/data (*.mhd)|*.mhd|' \
                         'Analyze separate header/data (*.hdr)|*.hdr|' \
                         'NIfTI (*.nii)|*.nii|' \
                         'NIfTI compressed (*.nii.gz)|*.nii.gz|' \
                         'All files (*)|*'

        # we now have a viewFrame in self._viewFrame
        FilenameViewModuleMixin.__init__(self,
                                         'Select a filename',
                                         wildCardString,
                                         {'Module (self)': self},
                                         fileOpen=False)

        # set up some defaults
        self._config.filename = ''

        self.sync_module_logic_with_config()
예제 #6
0
    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)
        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(self)

        # this is the output
        self._transformStack = transformStackClass(self)

        # we're going to use this to know when to actually read the data
        self._md5HexDigest = ''

        # we now have a viewFrame in self._viewFrame
        self._createViewFrame(
            'Select a filename to load',
            '2D Transform Stack file (*.2ts)|*.2ts|All files (*)|*',
            objectDict=None)

        # set up some defaults
        self._config.filename = ''
        self.config_to_logic()
        # make sure these filter through from the bottom up
        self.logic_to_config()
        self.config_to_view()
예제 #7
0
    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)

        self._writer = vtk.vtkStructuredPointsWriter()

        module_utils.setup_vtk_object_progress(
            self, self._writer, 'Writing vtk structured points data')

        # we do this to save space - if you're going to be transporting files
        # to other architectures, change this to ASCII
        # we've set this back to ASCII.  Seems the binary mode is screwed
        # for some files and manages to produce corrupt files that segfault
        # VTK on Windows.
        self._writer.SetFileTypeToASCII()

        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(
            self,
            'Select a filename',
            'VTK data (*.vtk)|*.vtk|All files (*)|*',
            {'vtkStructuredPointsWriter': self._writer},
            fileOpen=False)

        # set up some defaults
        self._config.filename = ''

        self.sync_module_logic_with_config()
예제 #8
0
파일: stlRDR.py 프로젝트: nagyistoce/devide
    def __init__(self, module_manager):
        """Constructor (initialiser) for the PD reader.

        This is almost standard code for most of the modules making use of
        the FilenameViewModuleMixin mixin.
        """

        # call the constructor in the "base"
        ModuleBase.__init__(self, module_manager)

        # setup necessary VTK objects
        self._reader = vtk.vtkSTLReader()

        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(
            self, 'Select a filename',
            'STL data (*.stl)|*.stl|All files (*)|*',
            {'vtkSTLReader': self._reader})

        module_utils.setup_vtk_object_progress(self, self._reader,
                                               'Reading STL data')

        # set up some defaults
        self._config.filename = ''
        self.sync_module_logic_with_config()
예제 #9
0
파일: ivWRT.py 프로젝트: nagyistoce/devide
    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)

        self._writer = vtk.vtkIVWriter()
        # sorry about this, but the files get REALLY big if we write them
        # in ASCII - I'll make this a gui option later.
        #self._writer.SetFileTypeToBinary()

        # following is the standard way of connecting up the devide progress
        # callback to a VTK object; you should do this for all objects in
        module_utils.setup_vtk_object_progress(
            self, self._writer, 'Writing polydata to Inventor Viewer format')

        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(
            self,
            'Select a filename',
            'InventorViewer data (*.iv)|*.iv|All files (*)|*',
            {'vtkIVWriter': self._writer},
            fileOpen=False)
        
        # set up some defaults
        self._config.filename = ''
        self.sync_module_logic_with_config()
예제 #10
0
    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)

        self._writer = vtk.vtkStructuredPointsWriter()

        module_utils.setup_vtk_object_progress(
            self, self._writer,
            'Writing vtk structured points data')

        

        # we do this to save space - if you're going to be transporting files
        # to other architectures, change this to ASCII
        # we've set this back to ASCII.  Seems the binary mode is screwed
        # for some files and manages to produce corrupt files that segfault
        # VTK on Windows.
        self._writer.SetFileTypeToASCII()
        
        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(
            self,
            'Select a filename',
            'VTK data (*.vtk)|*.vtk|All files (*)|*',
            {'vtkStructuredPointsWriter': self._writer},
            fileOpen=False)


        # set up some defaults
        self._config.filename = ''

        self.sync_module_logic_with_config()
예제 #11
0
파일: vtpWRT.py 프로젝트: nagyistoce/devide
    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)

        self._writer = vtk.vtkXMLPolyDataWriter()

        module_utils.setup_vtk_object_progress(
            self, self._writer,
            'Writing VTK PolyData')

        

        self._writer.SetDataModeToBinary()

        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(
            self,
            'Select a filename',
            'VTK PolyData (*.vtp)|*.vtp|All files (*)|*',
            {'vtkXMLPolyDataWriter': self._writer},
            fileOpen=False)
            

        # set up some defaults
        self._config.filename = ''

        self.sync_module_logic_with_config()
예제 #12
0
    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)

        self._writer = vtk.vtkPolyDataWriter()
        # sorry about this, but the files get REALLY big if we write them
        # in ASCII - I'll make this a gui option later.
        self._writer.SetFileTypeToBinary()

        module_utils.setup_vtk_object_progress(
            self, self._writer,
            'Writing VTK Polygonal data')

        
        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(
            self,
            'Select a filename',
            'VTK data (*.vtk)|*.vtk|All files (*)|*',
            {'vtkPolyDataWriter': self._writer},
            fileOpen=False)

        # set up some defaults
        self._config.filename = ''

        self.sync_module_logic_with_config()
예제 #13
0
    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)

        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(
            self, "Select a filename", "MATLAB file (*.m)|*.m|All files (*)|*", {"Module (self)": self}, fileOpen=False
        )

        # set up some defaults
        self._config.filename = ""

        self._input_points = None

        self.sync_module_logic_with_config()
예제 #14
0
    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)

        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(
            self,
            'Select a filename',
            'DeVIDE points (*.dvp)|*.dvp|All files (*)|*',
            {'Module (self)': self},
            fileOpen=False)
            
        # set up some defaults
        self._config.filename = ''

        self._input_points = None

        self.sync_module_logic_with_config()
예제 #15
0
    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)

        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(
            self,
            'Select a filename',
            'MATLAB file (*.m)|*.m|All files (*)|*',
            {'Module (self)': self},
            fileOpen=False)
            
        # set up some defaults
        self._config.filename = ''

        self._input_points = None

        self.sync_module_logic_with_config()
예제 #16
0
    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)

        self._reader = vtk.vtkStructuredPointsReader()

        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(
            self, 'Select a filename',
            'VTK data (*.vtk)|*.vtk|All files (*)|*',
            {'vtkStructuredPointsReader': self._reader})

        module_utils.setup_vtk_object_progress(
            self, self._reader, 'Reading vtk structured points data')

        # set up some defaults
        self._config.filename = ''
        self.sync_module_logic_with_config()
예제 #17
0
파일: vtpRDR.py 프로젝트: nagyistoce/devide
    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)

        self._reader = vtk.vtkXMLPolyDataReader()

        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(
            self, 'Select a filename',
            'VTK Poly Data (*.vtp)|*.vtp|All files (*)|*',
            {'vtkXMLPolyDataReader': self._reader})

        module_utils.setup_vtk_object_progress(self, self._reader,
                                               'Reading VTK PolyData')

        self._viewFrame = None

        # set up some defaults
        self._config.filename = ''
        self.sync_module_logic_with_config()
예제 #18
0
    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)
        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(self)

        # this is the input
        self._transformStack = None

        # we now have a viewFrame in self._viewFrame
        self._createViewFrame(
            'Select a filename',
            '2D Transform Stack file (*.2ts)|*.2ts|All files (*)|*',
            objectDict=None)

        # set up some defaults
        self._config.filename = ''
        self.configToLogic()
        # make sure these filter through from the bottom up
        self.logicToConfig()
        self.configToView()
예제 #19
0
    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)

        self._reader = vtk.vtkStructuredPointsReader()
        
        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(
            self,
            'Select a filename',
            'VTK data (*.vtk)|*.vtk|All files (*)|*',
            {'vtkStructuredPointsReader': self._reader})


        module_utils.setup_vtk_object_progress(
            self, self._reader,
            'Reading vtk structured points data')

        # set up some defaults
        self._config.filename = ''
        self.sync_module_logic_with_config()
예제 #20
0
    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)
        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(self)

        # this is the input
        self._transformStack = None

        # we now have a viewFrame in self._viewFrame
        self._createViewFrame(
            'Select a filename',
            '2D Transform Stack file (*.2ts)|*.2ts|All files (*)|*',
            objectDict=None)

        # set up some defaults
        self._config.filename = ''
        self.configToLogic()
        # make sure these filter through from the bottom up
        self.logicToConfig()
        self.configToView()
예제 #21
0
    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)

        self._triFilter = vtk.vtkTriangleFilter()

        module_utils.setup_vtk_object_progress(self, self._triFilter,
                                               'Converting to triangles')

        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(
            self,
            'Select a filename',
            'brep files (*.brep)|*.brep|All files (*)|*', {
                'Module (self)': self,
                'vtkTriangleFilter': self._triFilter
            },
            fileOpen=False)

        # set up some defaults
        self._config.filename = ''
        self.sync_module_logic_with_config()
예제 #22
0
파일: vtpRDR.py 프로젝트: fvpolpeta/devide
    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)

        self._reader = vtk.vtkXMLPolyDataReader()

        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(
            self,
            'Select a filename',
            'VTK Poly Data (*.vtp)|*.vtp|All files (*)|*',
            {'vtkXMLPolyDataReader': self._reader})

        module_utils.setup_vtk_object_progress(
            self, self._reader,
            'Reading VTK PolyData')

        self._viewFrame = None

        # set up some defaults
        self._config.filename = ''
        self.sync_module_logic_with_config()
예제 #23
0
    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)

        self._triFilter = vtk.vtkTriangleFilter()

        module_utils.setup_vtk_object_progress(
            self, self._triFilter,
            'Converting to triangles')

        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(
            self,
            'Select a filename',
            'brep files (*.brep)|*.brep|All files (*)|*',
            {'Module (self)' : self,
             'vtkTriangleFilter': self._triFilter},
            fileOpen=False)

        # set up some defaults
        self._config.filename = ''
        self.sync_module_logic_with_config()
예제 #24
0
파일: plyRDR.py 프로젝트: nagyistoce/devide
    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)

        self._reader = vtk.vtkPLYReader()

        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(
            self, 'Select a filename',
            '(Stanford) Polygon File Format (*.ply)|*.ply|All files (*)|*', {
                'vtkPLYReader': self._reader,
                'Module (self)': self
            })

        module_utils.setup_vtk_object_progress(self, self._reader,
                                               'Reading PLY PolyData')

        # set up some defaults
        self._config.filename = ''

        # there is no view yet...
        self._module_manager.sync_module_logic_with_config(self)
예제 #25
0
파일: stlWRT.py 프로젝트: fvpolpeta/devide
    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)

        # need to make sure that we're all happy triangles and stuff
        self._cleaner = vtk.vtkCleanPolyData()
        self._tf = vtk.vtkTriangleFilter()
        self._tf.SetInput(self._cleaner.GetOutput())
        self._writer = vtk.vtkSTLWriter()
        self._writer.SetInput(self._tf.GetOutput())
        # sorry about this, but the files get REALLY big if we write them
        # in ASCII - I'll make this a gui option later.
        #self._writer.SetFileTypeToBinary()

        # following is the standard way of connecting up the devide progress
        # callback to a VTK object; you should do this for all objects in
        mm = self._module_manager        
        for textobj in (('Cleaning data', self._cleaner),
                        ('Converting to triangles', self._tf),
                        ('Writing STL data', self._writer)):
            module_utils.setup_vtk_object_progress(self, textobj[1],
                                               textobj[0])

            
        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(
            self,
            'Select a filename',
            'STL data (*.stl)|*.stl|All files (*)|*',
            {'vtkSTLWriter': self._writer},
            fileOpen=False)

        # set up some defaults
        self._config.filename = ''

        self.sync_module_logic_with_config()
예제 #26
0
파일: plyRDR.py 프로젝트: fvpolpeta/devide
    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)

        self._reader = vtk.vtkPLYReader()

        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(
            self,
            'Select a filename',
            '(Stanford) Polygon File Format (*.ply)|*.ply|All files (*)|*',
            {'vtkPLYReader': self._reader,
             'Module (self)' : self})

        module_utils.setup_vtk_object_progress(
            self, self._reader,
            'Reading PLY PolyData')

        # set up some defaults
        self._config.filename = ''

        # there is no view yet...
        self._module_manager.sync_module_logic_with_config(self)
예제 #27
0
파일: stlWRT.py 프로젝트: nagyistoce/devide
    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)

        # need to make sure that we're all happy triangles and stuff
        self._cleaner = vtk.vtkCleanPolyData()
        self._tf = vtk.vtkTriangleFilter()
        self._tf.SetInput(self._cleaner.GetOutput())
        self._writer = vtk.vtkSTLWriter()
        self._writer.SetInput(self._tf.GetOutput())
        # sorry about this, but the files get REALLY big if we write them
        # in ASCII - I'll make this a gui option later.
        #self._writer.SetFileTypeToBinary()

        # following is the standard way of connecting up the devide progress
        # callback to a VTK object; you should do this for all objects in
        mm = self._module_manager
        for textobj in (('Cleaning data',
                         self._cleaner), ('Converting to triangles', self._tf),
                        ('Writing STL data', self._writer)):
            module_utils.setup_vtk_object_progress(self, textobj[1],
                                                   textobj[0])

        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(
            self,
            'Select a filename',
            'STL data (*.stl)|*.stl|All files (*)|*',
            {'vtkSTLWriter': self._writer},
            fileOpen=False)

        # set up some defaults
        self._config.filename = ''

        self.sync_module_logic_with_config()
예제 #28
0
 def close(self):
     # we should disconnect all inputs
     self.set_input(0, None)
     del self._writer
     FilenameViewModuleMixin.close(self)
예제 #29
0
 def close(self):
     # we should disconnect all inputs
     self.setInput(0, None)
     del self._transformStack
     FilenameViewModuleMixin.close(self)
예제 #30
0
 def close(self):
     FilenameViewModuleMixin.close(self)
예제 #31
0
 def close(self):
     # we should disconnect all inputs
     self.setInput(0, None)
     del self._transformStack
     FilenameViewModuleMixin.close(self)
예제 #32
0
 def close(self):
     del self._transformStack
     FilenameViewModuleMixin.close(self)
예제 #33
0
파일: vtpRDR.py 프로젝트: nagyistoce/devide
 def close(self):
     del self._reader
     FilenameViewModuleMixin.close(self)
예제 #34
0
 def close(self):
     del self._reader
     FilenameViewModuleMixin.close(self)
예제 #35
0
파일: vtiWRT.py 프로젝트: fvpolpeta/devide
 def close(self):
     # we should disconnect all inputs
     self.set_input(0, None)
     del self._writer
     FilenameViewModuleMixin.close(self)
예제 #36
0
 def close(self):
     del self._transformStack
     FilenameViewModuleMixin.close(self)
예제 #37
0
 def close(self):
     FilenameViewModuleMixin.close(self)
예제 #38
0
파일: stlRDR.py 프로젝트: nagyistoce/devide
 def close(self):
     del self._reader
     # call the close method of the mixin
     FilenameViewModuleMixin.close(self)
예제 #39
0
파일: objRDR.py 프로젝트: fvpolpeta/devide
 def close(self):
     del self._reader
     # call the close method of the mixin
     FilenameViewModuleMixin.close(self)