Exemplo n.º 1
0
  def load(self,loadable):
    """Load the selection as an RT object
    using the DicomSroImport module
    """
    success = False

    # Export file lists to DicomExamineInfo
    loadInfo = slicer.vtkDICOMImportInfo()
    fileListIndex = loadInfo.InsertNextFileList() 
    fileList = loadInfo.GetFileList(fileListIndex) # vtk.vtkStringArray()      
    for f in loadable.files:
      fileList.InsertNextValue(f) 
    loadInfo.InsertNextLoadable(fileList, loadable.name, loadable.tooltip, loadable.warning, loadable.selected, loadable.confidence)

    logic = slicer.vtkSlicerDicomSroImportModuleLogic()
    #logic = slicer.modules.DicomSroimport.logic()
    logic.SetMRMLScene(slicer.mrmlScene)
    if logic.LoadDicomSro(loadInfo):
      success = True

    return success
Exemplo n.º 2
0
    def examine(self, fileLists):
        """ Returns a list of qSlicerDICOMLoadable instances
    corresponding to ways of interpreting the 
    fileLists parameter.
    """

        # Export file lists to DicomExamineInfo
        examineInfo = slicer.vtkDICOMImportInfo()
        for files in fileLists:
            fileListIndex = examineInfo.InsertNextFileList()
            fileList = examineInfo.GetFileList(
                fileListIndex)  # vtk.vtkStringArray()
            for f in files:
                fileList.InsertNextValue(f)

        # Examine files
        logic = slicer.vtkSlicerDicomSroImportModuleLogic()
        #logic = slicer.modules.DicomSroimport.logic()
        print "reg inside examine"
        logic.Examine(examineInfo)

        # Import loadables from DicomExamineInfo
        loadables = []
        for loadableIndex in xrange(examineInfo.GetNumberOfLoadables()):
            loadable = slicer.qSlicerDICOMLoadable()
            loadableFilesVtk = examineInfo.GetLoadableFiles(loadableIndex)
            loadableFilesPy = []
            for fileIndex in xrange(loadableFilesVtk.GetNumberOfValues()):
                loadableFilesPy.append(loadableFilesVtk.GetValue(fileIndex))
            loadable.files = loadableFilesPy

            name = examineInfo.GetLoadableName(loadableIndex)
            loadable.name = name
            loadable.tooltip = examineInfo.GetLoadableTooltip(loadableIndex)
            loadable.selected = examineInfo.GetLoadableSelected(loadableIndex)
            loadable.confidence = examineInfo.GetLoadableConfidence(
                loadableIndex)
            loadables.append(loadable)

        return loadables
Exemplo n.º 3
0
    def load(self, loadable):
        """Load the selection as an RT object
    using the DicomSroImport module
    """
        success = False

        # Export file lists to DicomExamineInfo
        loadInfo = slicer.vtkDICOMImportInfo()
        fileListIndex = loadInfo.InsertNextFileList()
        fileList = loadInfo.GetFileList(fileListIndex)  # vtk.vtkStringArray()
        for f in loadable.files:
            fileList.InsertNextValue(f)
        loadInfo.InsertNextLoadable(fileList, loadable.name, loadable.tooltip,
                                    loadable.warning, loadable.selected,
                                    loadable.confidence)

        logic = slicer.vtkSlicerDicomSroImportModuleLogic()
        logic.SetMRMLScene(slicer.mrmlScene)
        if logic.LoadDicomSro(loadInfo):
            success = True

        return success
Exemplo n.º 4
0
  def examine(self,fileLists):
    """ Returns a list of qSlicerDICOMLoadable instances
    corresponding to ways of interpreting the 
    fileLists parameter.
    """    
 
    # Export file lists to DicomExamineInfo
    examineInfo = slicer.vtkDICOMImportInfo()
    for files in fileLists:
      fileListIndex = examineInfo.InsertNextFileList() 
      fileList = examineInfo.GetFileList(fileListIndex) # vtk.vtkStringArray()  	  
      for f in files:
        fileList.InsertNextValue(f)	

    # Examine files
    logic = slicer.vtkSlicerDicomSroImportModuleLogic()
    #logic = slicer.modules.DicomSroimport.logic()
    print "reg inside examine"
    logic.Examine(examineInfo)	
    
    # Import loadables from DicomExamineInfo
    loadables = []
    for loadableIndex in xrange(examineInfo.GetNumberOfLoadables()):
      loadable = slicer.qSlicerDICOMLoadable()
      loadableFilesVtk = examineInfo.GetLoadableFiles(loadableIndex)
      loadableFilesPy = []
      for fileIndex in xrange(loadableFilesVtk.GetNumberOfValues()):
        loadableFilesPy.append(loadableFilesVtk.GetValue(fileIndex))
      loadable.files = loadableFilesPy

      name = examineInfo.GetLoadableName(loadableIndex)
      loadable.name = name
      loadable.tooltip = examineInfo.GetLoadableTooltip(loadableIndex)
      loadable.selected = examineInfo.GetLoadableSelected(loadableIndex)
      loadable.confidence = examineInfo.GetLoadableConfidence(loadableIndex)
      loadables.append(loadable)

    return loadables