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)
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()())
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)
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)
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)