Ejemplo n.º 1
0
    def examineForExport(self, subjectHierarchyItemID):
        """Return a list of DICOMExportable instances that describe the
    available techniques that this plugin offers to convert MRML
    data into DICOM data
    """

        # Check if setting of DICOM UIDs is suported (if not, then we cannot export to sequence)
        dicomUIDSettingSupported = False
        createDicomSeriesParameterNode = slicer.modules.createdicomseries.cliModuleLogic(
        ).CreateNode()
        for groupIndex in range(
                createDicomSeriesParameterNode.GetNumberOfParameterGroups()):
            if createDicomSeriesParameterNode.GetParameterGroupLabel(
                    groupIndex) == "Unique Identifiers (UIDs)":
                dicomUIDSettingSupported = True
        if not dicomUIDSettingSupported:
            # This version of Slicer does not allow setting DICOM UIDs for export
            return []

        # cannot export if there is no data node or the data node is not a volume
        shn = slicer.vtkMRMLSubjectHierarchyNode.GetSubjectHierarchyNode(
            slicer.mrmlScene)
        dataNode = shn.GetItemDataNode(subjectHierarchyItemID)
        if dataNode is None or not dataNode.IsA('vtkMRMLScalarVolumeNode'):
            # not a volume node
            return []

        sequenceBrowserNode = self.getSequenceBrowserNodeForMasterOutputNode(
            dataNode)
        if not sequenceBrowserNode:
            # this seems to be a simple volume node (not a proxy node of a volume
            # sequence). This plugin only deals with volume sequences.
            return []

        sequenceItemCount = sequenceBrowserNode.GetMasterSequenceNode(
        ).GetNumberOfDataNodes()
        if sequenceItemCount <= 1:
            # this plugin is only relevant if there are multiple items in the sequence
            return []

        # Define basic properties of the exportable
        exportable = slicer.qSlicerDICOMExportable()
        exportable.name = self.loadType
        exportable.tooltip = "Creates a series of DICOM files from volume sequences"
        exportable.subjectHierarchyItemID = subjectHierarchyItemID
        exportable.pluginClass = self.__module__
        exportable.confidence = 0.6  # Simple volume has confidence of 0.5, use a slightly higher value here

        # Define required tags and default values
        exportable.setTag('SeriesDescription',
                          f'Volume sequence of {sequenceItemCount} frames')
        exportable.setTag('Modality', 'CT')
        exportable.setTag('Manufacturer', 'Unknown manufacturer')
        exportable.setTag('Model', 'Unknown model')
        exportable.setTag('StudyID', '1')
        exportable.setTag('SeriesNumber', '1')
        exportable.setTag('SeriesDate', '')
        exportable.setTag('SeriesTime', '')

        return [exportable]
Ejemplo n.º 2
0
  def examineForExport(self,node):
    """Return a list of DICOMExportable instances that describe the
    available techniques that this plugin offers to convert MRML
    data into DICOM data
    """
    # cannot export if there is no data node or the data node is not a volume
    if node.GetAssociatedNode() == None or not node.GetAssociatedNode().IsA('vtkMRMLScalarVolumeNode'):
      return []

    # Define basic properties of the exportable
    exportable = slicer.qSlicerDICOMExportable()
    exportable.name = self.loadType
    exportable.tooltip = "Creates a series of DICOM files from scalar volumes"
    exportable.nodeID = node.GetID()
    exportable.pluginClass = self.__module__
    exportable.confidence = 0.5 # There could be more specialized volume types

    # Define required tags and default values
    exportable.setTag('SeriesDescription', 'No series description')
    exportable.setTag('Modality', 'CT')
    exportable.setTag('Manufacturer', 'Unknown manufacturer')
    exportable.setTag('Model', 'Unknown model')
    exportable.setTag('SeriesNumber', '1')

    return [exportable]
Ejemplo n.º 3
0
    def examineForExport(self, node):
        """Return a list of DICOMExportable instances that describe the
    available techniques that this plugin offers to convert MRML
    data into DICOM data
    """
        # cannot export if there is no data node or the data node is not a volume
        if node.GetAssociatedNode() == None or not node.GetAssociatedNode(
        ).IsA('vtkMRMLScalarVolumeNode'):
            return []

        # Define basic properties of the exportable
        exportable = slicer.qSlicerDICOMExportable()
        exportable.name = self.loadType
        exportable.tooltip = "Creates a series of DICOM files from scalar volumes"
        exportable.nodeID = node.GetID()
        exportable.pluginClass = self.__module__
        exportable.confidence = 0.5  # There could be more specialized volume types

        # Define required tags and default values
        exportable.setTag('SeriesDescription', 'No series description')
        exportable.setTag('Modality', 'CT')
        exportable.setTag('Manufacturer', 'Unknown manufacturer')
        exportable.setTag('Model', 'Unknown model')
        exportable.setTag('SeriesNumber', '1')

        return [exportable]
Ejemplo n.º 4
0
  def examineForExport(self,node):
    """Return a list of DICOMExportable instances that describe the
    available techniques that this plugin offers to convert MRML
    data into DICOM data
    """
    from vtkSlicerRtCommon import SlicerRtCommon
    from vtkSlicerSubjectHierarchyModuleMRMLPython import vtkMRMLSubjectHierarchyConstants
    exportable = None

    # RT dose volume
    if node.GetAssociatedNode() and SlicerRtCommon.IsDoseVolumeNode(node.GetAssociatedNode()):
      exportable = slicer.qSlicerDICOMExportable()
      exportable.confidence = 1.0
      # Define type-specific required tags and default values
      exportable.setTag('Modality', 'RTDOSE')
    # RT structure set
    elif node.GetAssociatedNode() and node.GetAssociatedNode().IsA('vtkMRMLSegmentationNode'):
      exportable = slicer.qSlicerDICOMExportable()
      exportable.confidence = 1.0
      # Define type-specific required tags and default values
      exportable.setTag('Modality', 'RTSTRUCT')
    # Potential anatomical image for an RT study
    elif node.GetAssociatedNode() and node.GetAssociatedNode().IsA('vtkMRMLScalarVolumeNode'):
      exportable = slicer.qSlicerDICOMExportable()
      exportable.confidence = 0.3 # Might be some other kind of scalar volume, but also anatomical volume in an RT study
      # Define type-specific required tags and default values
      exportable.setTag('Modality', 'CT')
      exportable.setTag('Manufacturer', 'Unknown manufacturer')
      exportable.setTag('Model', 'Unknown model')
      exportable.setTag('SeriesUID', 'XXXXXXX')

    # Node is exportable as RT series
    if exportable != None:
      # Set common properties for RT exportable
      exportable.name = self.loadType
      exportable.tooltip = "Create DICOM files from RT study"
      exportable.nodeID = node.GetID()
      exportable.pluginClass = self.__module__
      # Define common required tags and default values
      exportable.setTag('SeriesDescription', 'No series description')
      exportable.setTag('SeriesNumber', '1')
      return [exportable]

    # Not recognized as potential RT object
    return []