コード例 #1
0
 def __init__(self, parent):
     vBoxLayout = qt.QVBoxLayout(parent)
     aiaaGroupBox = ctk.ctkCollapsibleGroupBox()
     aiaaGroupBox.title = 'AI-Assisted Annotation Server'
     aiaaGroupLayout = qt.QFormLayout(aiaaGroupBox)
     serverUrl = qt.QLineEdit()
     aiaaGroupLayout.addRow('Server address:', serverUrl)
     parent.registerProperty('NVIDIA-AIAA/serverUrl', serverUrl, 'text',
                             str(qt.SIGNAL('textChanged(QString)')))
     serverUrlHistory = qt.QLineEdit()
     aiaaGroupLayout.addRow('Server address history:', serverUrlHistory)
     parent.registerProperty('NVIDIA-AIAA/serverUrlHistory',
                             serverUrlHistory, 'text',
                             str(qt.SIGNAL('textChanged(QString)')))
     compressDataCheckBox = qt.QCheckBox()
     compressDataCheckBox.checked = True
     compressDataCheckBox.toolTip = 'Enable this option on computer with slow network upload speed. Data compression reduces network transfer time but increases preprocessing time.'
     aiaaGroupLayout.addRow('Compress data:', compressDataCheckBox)
     compressDataMapper = ctk.ctkBooleanMapper(
         compressDataCheckBox, 'checked', str(qt.SIGNAL('toggled(bool)')))
     parent.registerProperty('NVIDIA-AIAA/compressData', compressDataMapper,
                             'valueAsInt',
                             str(qt.SIGNAL('valueAsIntChanged(int)')))
     vBoxLayout.addWidget(aiaaGroupBox)
     vBoxLayout.addStretch(1)
コード例 #2
0
    def __init__(self, parent):
        vBoxLayout = qt.QVBoxLayout(parent)

        # AIAA settings
        aiaaGroupBox = ctk.ctkCollapsibleGroupBox()
        aiaaGroupBox.title = "AI-Assisted Annotation Server"
        aiaaGroupLayout = qt.QFormLayout(aiaaGroupBox)

        serverUrl = qt.QLineEdit()
        aiaaGroupLayout.addRow("Server address:", serverUrl)
        parent.registerProperty("NVIDIA-AIAA/serverUrl", serverUrl, "text",
                                str(qt.SIGNAL("textChanged(QString)")))

        serverUrlHistory = qt.QLineEdit()
        aiaaGroupLayout.addRow("Server address history:", serverUrlHistory)
        parent.registerProperty("NVIDIA-AIAA/serverUrlHistory",
                                serverUrlHistory, "text",
                                str(qt.SIGNAL("textChanged(QString)")))

        compressDataCheckBox = qt.QCheckBox()
        compressDataCheckBox.checked = True
        compressDataCheckBox.toolTip = (
            "Enable this option on computer with slow network upload speed."
            " Data compression reduces network transfer time but increases preprocessing time."
        )
        aiaaGroupLayout.addRow("Compress data:", compressDataCheckBox)
        compressDataMapper = ctk.ctkBooleanMapper(
            compressDataCheckBox, "checked", str(qt.SIGNAL("toggled(bool)")))
        parent.registerProperty("NVIDIA-AIAA/compressData", compressDataMapper,
                                "valueAsInt",
                                str(qt.SIGNAL("valueAsIntChanged(int)")))

        useSessionCheckBox = qt.QCheckBox()
        useSessionCheckBox.checked = False
        useSessionCheckBox.toolTip = (
            "Enable this option to make use of AIAA sessions."
            " Volume is uploaded to AIAA as part of session once and it makes segmentation/dextr3d/deepgrow operations faster."
        )
        aiaaGroupLayout.addRow("AIAA Session:", useSessionCheckBox)
        useSessionMapper = ctk.ctkBooleanMapper(
            useSessionCheckBox, "checked", str(qt.SIGNAL("toggled(bool)")))
        parent.registerProperty("NVIDIA-AIAA/aiaaSession", useSessionMapper,
                                "valueAsInt",
                                str(qt.SIGNAL("valueAsIntChanged(int)")))

        vBoxLayout.addWidget(aiaaGroupBox)
        vBoxLayout.addStretch(1)
コード例 #3
0
    def __init__(self, parent):
        vBoxLayout = qt.QVBoxLayout(parent)
        # Add generic settings
        genericGroupBox = ctk.ctkCollapsibleGroupBox()
        genericGroupBox.title = "Generic DICOM settings"
        genericGroupBoxFormLayout = qt.QFormLayout(genericGroupBox)

        directoryButton = ctk.ctkDirectoryButton()
        genericGroupBoxFormLayout.addRow("Database location:", directoryButton)
        parent.registerProperty(slicer.dicomDatabaseDirectorySettingsKey,
                                directoryButton, "directory",
                                str(qt.SIGNAL("directoryChanged(QString)")),
                                "DICOM general settings",
                                ctk.ctkSettingsPanel.OptionRequireRestart)
        # Restart is forced because no mechanism is implemented that would reopen the DICOM database after
        # folder location is changed. It is easier to restart the application than implementing an update
        # mechanism.

        loadReferencesComboBox = ctk.ctkComboBox()
        loadReferencesComboBox.toolTip = "Determines whether referenced DICOM series are " \
          "offered when loading DICOM, or the automatic behavior if interaction is disabled. " \
          "Interactive selection of referenced series is the default selection"
        loadReferencesComboBox.addItem("Ask user", qt.QMessageBox.InvalidRole)
        loadReferencesComboBox.addItem("Always", qt.QMessageBox.Yes)
        loadReferencesComboBox.addItem("Never", qt.QMessageBox.No)
        loadReferencesComboBox.currentIndex = 0
        genericGroupBoxFormLayout.addRow("Load referenced series:",
                                         loadReferencesComboBox)
        parent.registerProperty("DICOM/automaticallyLoadReferences",
                                loadReferencesComboBox,
                                "currentUserDataAsString",
                                str(qt.SIGNAL("currentIndexChanged(int)")))

        detailedLoggingCheckBox = qt.QCheckBox()
        detailedLoggingCheckBox.toolTip = (
            "Log more details during DICOM operations."
            " Useful for investigating DICOM loading issues but may impact performance."
        )
        genericGroupBoxFormLayout.addRow("Detailed logging:",
                                         detailedLoggingCheckBox)
        detailedLoggingMapper = ctk.ctkBooleanMapper(
            detailedLoggingCheckBox, "checked",
            str(qt.SIGNAL("toggled(bool)")))
        parent.registerProperty("DICOM/detailedLogging", detailedLoggingMapper,
                                "valueAsInt",
                                str(qt.SIGNAL("valueAsIntChanged(int)")))

        vBoxLayout.addWidget(genericGroupBox)

        # Add settings panel for the plugins
        plugins = slicer.modules.dicomPlugins
        for pluginName in plugins.keys():
            if hasattr(plugins[pluginName], 'settingsPanelEntry'):
                pluginGroupBox = ctk.ctkCollapsibleGroupBox()
                pluginGroupBox.title = pluginName
                vBoxLayout.addWidget(pluginGroupBox)
                plugins[pluginName].settingsPanelEntry(parent, pluginGroupBox)
        vBoxLayout.addStretch(1)
コード例 #4
0
    def settingsPanelEntry(panel, parent):
        """Create a settings panel entry for this plugin class.
    It is added to the DICOM panel of the application settings
    by the DICOM module.
    """
        formLayout = qt.QFormLayout(parent)

        readersComboBox = qt.QComboBox()
        for approach in DICOMScalarVolumePluginClass.readerApproaches():
            readersComboBox.addItem(approach)
        readersComboBox.toolTip = (
            "Preferred back end.  Archetype was used by default in Slicer before June of 2017."
            "Change this setting if data that previously loaded stops working (and report an issue)."
        )
        formLayout.addRow("DICOM reader approach:", readersComboBox)
        panel.registerProperty("DICOM/ScalarVolume/ReaderApproach",
                               readersComboBox, "currentIndex",
                               str(qt.SIGNAL("currentIndexChanged(int)")))

        importFormatsComboBox = ctk.ctkComboBox()
        importFormatsComboBox.toolTip = (
            "Enable adding non-linear transform to regularize images acquired irregular geometry:"
            " non-rectilinear grid (such as tilted gantry CT acquisitions) and non-uniform slice spacing."
            " If no regularization is applied then image may appear distorted if it was acquired with irregular geometry."
        )
        importFormatsComboBox.addItem("default (none)", "default")
        importFormatsComboBox.addItem("none", "none")
        importFormatsComboBox.addItem("apply regularization transform",
                                      "transform")
        # in the future additional option, such as "resample" may be added
        importFormatsComboBox.currentIndex = 0
        formLayout.addRow("Acquisition geometry regularization:",
                          importFormatsComboBox)
        panel.registerProperty(
            "DICOM/ScalarVolume/AcquisitionGeometryRegularization",
            importFormatsComboBox, "currentUserDataAsString",
            str(qt.SIGNAL("currentIndexChanged(int)")),
            "DICOM examination settings",
            ctk.ctkSettingsPanel.OptionRequireRestart)
        # DICOM examination settings are cached so we need to restart to make sure changes take effect

        allowLoadingByTimeCheckBox = qt.QCheckBox()
        allowLoadingByTimeCheckBox.toolTip = (
            "Offer loading of individual slices or group of slices"
            " that were acquired at a specific time (content or trigger time)."
            " If this option is enabled then a large number of loadable items may be displayed in the Advanced section of DICOM browser."
        )
        formLayout.addRow("Allow loading subseries by time:",
                          allowLoadingByTimeCheckBox)
        allowLoadingByTimeMapper = ctk.ctkBooleanMapper(
            allowLoadingByTimeCheckBox, "checked",
            str(qt.SIGNAL("toggled(bool)")))
        panel.registerProperty("DICOM/ScalarVolume/AllowLoadingByTime",
                               allowLoadingByTimeMapper, "valueAsInt",
                               str(qt.SIGNAL("valueAsIntChanged(int)")),
                               "DICOM examination settings",
                               ctk.ctkSettingsPanel.OptionRequireRestart)
コード例 #5
0
  def settingsPanelEntry(panel, parent):
    """Create a settings panel entry for this plugin class.
    It is added to the DICOM panel of the application settings
    by the DICOM module.
    """
    formLayout = qt.QFormLayout(parent)

    readersComboBox = qt.QComboBox()
    for approach in DICOMScalarVolumePluginClass.readerApproaches():
      readersComboBox.addItem(approach)
    readersComboBox.toolTip = ("Preferred back end.  Archetype was used by default in Slicer before June of 2017."
      "Change this setting if data that previously loaded stops working (and report an issue).")
    formLayout.addRow("DICOM reader approach:", readersComboBox)
    panel.registerProperty(
      "DICOM/ScalarVolume/ReaderApproach", readersComboBox,
      "currentIndex", str(qt.SIGNAL("currentIndexChanged(int)")))

    importFormatsComboBox = ctk.ctkComboBox()
    importFormatsComboBox.toolTip = ("Enable adding non-linear transform to regularize images acquired irregular geometry:"
      " non-rectilinear grid (such as tilted gantry CT acquisitions) and non-uniform slice spacing."
      " If no regularization is applied then image may appear distorted if it was acquired with irregular geometry.")
    importFormatsComboBox.addItem("default (none)", "default")
    importFormatsComboBox.addItem("none", "none")
    importFormatsComboBox.addItem("apply regularization transform", "transform")
     # in the future additional option, such as "resample" may be added
    importFormatsComboBox.currentIndex = 0
    formLayout.addRow("Acquisition geometry regularization:", importFormatsComboBox)
    panel.registerProperty(
      "DICOM/ScalarVolume/AcquisitionGeometryRegularization", importFormatsComboBox,
      "currentUserDataAsString", str(qt.SIGNAL("currentIndexChanged(int)")),
      "DICOM examination settings", ctk.ctkSettingsPanel.OptionRequireRestart)
    # DICOM examination settings are cached so we need to restart to make sure changes take effect

    allowLoadingByTimeCheckBox = qt.QCheckBox()
    allowLoadingByTimeCheckBox.toolTip = ("Offer loading of individual slices or group of slices"
      " that were acquired at a specific time (content or trigger time)."
      " If this option is enabled then a large number of loadable items may be displayed in the Advanced section of DICOM browser.")
    formLayout.addRow("Allow loading subseries by time:", allowLoadingByTimeCheckBox)
    allowLoadingByTimeMapper = ctk.ctkBooleanMapper(allowLoadingByTimeCheckBox, "checked", str(qt.SIGNAL("toggled(bool)")))
    panel.registerProperty(
      "DICOM/ScalarVolume/AllowLoadingByTime", allowLoadingByTimeMapper,
      "valueAsInt", str(qt.SIGNAL("valueAsIntChanged(int)")),
      "DICOM examination settings", ctk.ctkSettingsPanel.OptionRequireRestart)