예제 #1
0
파일: DICOM.py 프로젝트: Slicer/Slicer
  def performPostModuleDiscoveryTasks(self):
    """Since dicom plugins are discovered while the application
    is initialized, they may be found after the DICOM module
    itself if initialized.  This method is tied to a singleShot
    that will be called once the event loop is read to start.
    """

    if slicer.mrmlScene.GetTagByClassName( "vtkMRMLScriptedModuleNode" ) != 'ScriptedModule':
      slicer.mrmlScene.RegisterNodeClass(vtkMRMLScriptedModuleNode())

    # initialize the dicom infrastructure
    slicer.dicomDatabase = None
    settings = qt.QSettings()
    # the dicom database is a global object for slicer
    if settings.contains('DatabaseDirectory'):
      databaseDirectory = settings.value('DatabaseDirectory')
      if databaseDirectory:
        slicer.dicomDatabase = ctk.ctkDICOMDatabase()
        slicer.dicomDatabase.openDatabase(databaseDirectory + "/ctkDICOM.sql", "SLICER")
        if not slicer.dicomDatabase.isOpen:
          # can't open the database, so prompt the user later if they enter module
          slicer.dicomDatabase = None
        else:
          self.startListener()
        if slicer.dicomDatabase:
          slicer.app.setDICOMDatabase(slicer.dicomDatabase)
    # set the dicom pre-cache tags once all plugin classes have been initialized
    DICOMLib.setDatabasePrecacheTags()

    if not slicer.app.commandOptions().noMainWindow:
      # add to the main app file menu
      self.addMenu()
      # add the settings options
      self.settingsPanel = DICOMSettingsPanel()
      slicer.app.settingsDialog().addPanel("DICOM", self.settingsPanel)
예제 #2
0
    def performPostModuleDiscoveryTasks(self):
        """Since dicom plugins are discovered while the application
    is initialized, they may be found after the DICOM module
    itself if initialized.  This method is tied to a singleShot
    that will be called once the event loop is read to start.
    """

        if slicer.mrmlScene.GetTagByClassName(
                "vtkMRMLScriptedModuleNode") != 'ScriptedModule':
            slicer.mrmlScene.RegisterNodeClass(vtkMRMLScriptedModuleNode())

        # initialize the dicom infrastructure
        slicer.dicomDatabase = None
        settings = qt.QSettings()
        # the dicom database is a global object for slicer
        if settings.contains('DatabaseDirectory'):
            databaseDirectory = settings.value('DatabaseDirectory')
            if databaseDirectory:
                slicer.dicomDatabase = ctk.ctkDICOMDatabase()
                slicer.dicomDatabase.openDatabase(
                    databaseDirectory + "/ctkDICOM.sql", "SLICER")
                if not slicer.dicomDatabase.isOpen:
                    # can't open the database, so prompt the user later if they enter module
                    slicer.dicomDatabase = None
                else:
                    self.startListener()
                if slicer.dicomDatabase:
                    slicer.app.setDICOMDatabase(slicer.dicomDatabase)
        # set the dicom pre-cache tags once all plugin classes have been initialized
        DICOMLib.setDatabasePrecacheTags()

        if not slicer.app.commandOptions().noMainWindow:
            # add to the main app file menu
            self.addMenu()
            # add the settings options
            self.settingsPanel = DICOMSettingsPanel()
            slicer.app.settingsDialog().addPanel("DICOM", self.settingsPanel)

            dataProbe = slicer.util.mainWindow().findChild(
                "QWidget", "DataProbeCollapsibleWidget")
            self.wasDataProbeVisible = dataProbe.isVisible()

            layoutManager = slicer.app.layoutManager()
            layoutManager.layoutChanged.connect(self.onLayoutChanged)
            layout = ("<layout type=\"horizontal\">"
                      " <item>"
                      "  <dicombrowser></dicombrowser>"
                      " </item>"
                      "</layout>")
            layoutNode = slicer.app.layoutManager().layoutLogic(
            ).GetLayoutNode()
            layoutNode.AddLayoutDescription(
                slicer.vtkMRMLLayoutNode.SlicerLayoutDicomBrowserView, layout)
            self.currentViewArrangement = layoutNode.GetViewArrangement()
            self.previousViewArrangement = layoutNode.GetViewArrangement()

        self.detailsPopup = None
        self.viewWidget = None
        self.browserSettingsWidget = None
        self.setDetailsPopup(DICOMWidget.getSavedDICOMDetailsWidgetType()())
예제 #3
0
 def performPostModuleDiscoveryTasks(self):
   """Since dicom plugins are discovered while the application
   is initialized, they may be found after the DICOM module
   itself if initialized.  This method is tied to a singleShot
   that will be called once the event loop is read to start.
   """
   # set the dicom pre-cache tags once all plugin classes have been initialized
   DICOMLib.setDatabasePrecacheTags()
   # add to the main app file menu
   self.addMenu()
   # add the settings options
   self.settingsPanel = DICOMSettingsPanel()
   slicer.app.settingsDialog().addPanel("DICOM", self.settingsPanel)
예제 #4
0
파일: DICOM.py 프로젝트: fedorov/Slicer
  def performPostModuleDiscoveryTasks(self):
    """Since dicom plugins are discovered while the application
    is initialized, they may be found after the DICOM module
    itself if initialized.  This method is tied to a singleShot
    that will be called once the event loop is read to start.
    """
    # set the dicom pre-cache tags once all plugin classes have been initialized
    DICOMLib.setDatabasePrecacheTags()

    if not slicer.app.commandOptions().noMainWindow:
      # add to the main app file menu
      self.addMenu()
      # add the settings options
      self.settingsPanel = DICOMSettingsPanel()
      slicer.app.settingsDialog().addPanel("DICOM", self.settingsPanel)
예제 #5
0
    def performPostModuleDiscoveryTasks(self):
        """Since dicom plugins are discovered while the application
    is initialized, they may be found after the DICOM module
    itself if initialized.  This method is tied to a singleShot
    that will be called once the event loop is read to start.
    """

        if slicer.mrmlScene.GetTagByClassName(
                "vtkMRMLScriptedModuleNode") != 'ScriptedModule':
            slicer.mrmlScene.RegisterNodeClass(vtkMRMLScriptedModuleNode())

        # initialize the dicom infrastructure
        slicer.dicomDatabase = None
        settings = qt.QSettings()
        # the dicom database is a global object for slicer
        if settings.contains('DatabaseDirectory'):
            databaseDirectory = settings.value('DatabaseDirectory')
            if databaseDirectory:
                slicer.dicomDatabase = ctk.ctkDICOMDatabase()
                slicer.dicomDatabase.openDatabase(
                    databaseDirectory + "/ctkDICOM.sql", "SLICER")
                if not slicer.dicomDatabase.isOpen:
                    # can't open the database, so prompt the user later if they enter module
                    slicer.dicomDatabase = None
                else:
                    self.startListener()
                if slicer.dicomDatabase:
                    slicer.app.setDICOMDatabase(slicer.dicomDatabase)
        # set the dicom pre-cache tags once all plugin classes have been initialized
        DICOMLib.setDatabasePrecacheTags()

        if not slicer.app.commandOptions().noMainWindow:
            # add to the main app file menu
            self.addMenu()
            # add the settings options
            self.settingsPanel = DICOMSettingsPanel()
            slicer.app.settingsDialog().addPanel("DICOM", self.settingsPanel)