Пример #1
0
    def createDockPanel(self):
        self.modules = []

        self.dockPanel = qt.QDockWidget('Plane Control')
        self.dockPanel.windowTitle = "Plane Control"
        self.dockPanel.setAllowedAreas(qt.Qt.LeftDockWidgetArea
                                       | qt.Qt.RightDockWidgetArea)

        self.dockFrame = qt.QFrame(self.dockPanel)
        self.dockFrame.setFrameStyle(qt.QFrame.NoFrame)
        self.dockLayout = qt.QVBoxLayout()

        ## Button Frame
        self.dockButtonFrame = qt.QFrame(self.dockFrame)
        self.dockButtonFrame.setFrameStyle(qt.QFrame.NoFrame)
        self.dockButtonLayout = qt.QHBoxLayout()

        self.dockButtonFrame.setLayout(self.dockButtonLayout)

        ## Wizard Frame
        self.dockWizardFrame = qt.QFrame(self.dockFrame)
        self.dockWizardFrame.setFrameStyle(qt.QFrame.NoFrame)
        self.dockWizardLayout = qt.QHBoxLayout()

        self.transversalCheckBox = ctk.ctkCheckBox()
        self.transversalCheckBox.text = "Transversal"
        self.transversalCheckBox.enabled = True
        self.transversalCheckBox.checked = False

        self.inplane0CheckBox = ctk.ctkCheckBox()
        self.inplane0CheckBox.text = "Inplane0"
        self.inplane0CheckBox.enabled = True
        self.inplane0CheckBox.checked = False

        self.inplane90CheckBox = ctk.ctkCheckBox()
        self.inplane90CheckBox.text = "Inplane90"
        self.inplane90CheckBox.enabled = True
        self.inplane90CheckBox.checked = False

        self.dockWizardLayout.addWidget(self.transversalCheckBox)
        self.dockWizardLayout.addWidget(self.inplane0CheckBox)
        self.dockWizardLayout.addWidget(self.inplane90CheckBox)

        self.dockWizardFrame.setLayout(self.dockWizardLayout)
        self.dockLayout.addWidget(self.dockWizardFrame)

        self.dockFrame.setLayout(self.dockLayout)
        self.dockPanel.setWidget(self.dockFrame)

        self.dockButtonFrame.show()
        self.dockWizardFrame.show()
        mw = slicer.util.mainWindow()
        mw.addDockWidget(qt.Qt.LeftDockWidgetArea, self.dockPanel)
        self.dockFrame.show()
Пример #2
0
    def createMainMenuDockWidget(self):
        # Set up main frame
        self.mainMenuDockWidget = qt.QDockWidget(self.parent)
        self.mainMenuDockWidget.setTitleBarWidget(
            qt.QWidget())  # hide title bar
        self.mainMenuDockWidget.setObjectName('FirstTaskPanel')
        self.mainMenuDockWidget.setWindowTitle('First Task')

        # self.mainMenuDockWidget.setStyleSheet(self.styleSheet)
        self.mainMenuDockWidget.setFeatures(
            qt.QDockWidget.DockWidgetMovable
            | qt.QDockWidget.DockWidgetFloatable)  # not closable

        mainWindow = slicer.util.mainWindow()
        self.mainMenuDockWidget.setParent(mainWindow)

        # Setup scroll area
        self.mainFrame = qt.QFrame(self.mainMenuDockWidget)
        self.mainLayout = qt.QVBoxLayout(self.mainFrame)
        self.mainLayout.setContentsMargins(0, 0, 0, 0)
        self.mainLayout.spacing = 0

        self.mainScrollArea = qt.QScrollArea(self.mainFrame)
        self.mainScrollArea.widgetResizable = True
        self.mainScrollArea.sizeAdjustPolicy = qt.QAbstractScrollArea.AdjustToContentsOnFirstShow
        self.mainScrollArea.horizontalScrollBarPolicy = qt.Qt.ScrollBarAlwaysOff
        self.mainScrollArea.setSizePolicy(
            qt.QSizePolicy(qt.QSizePolicy.Minimum, qt.QSizePolicy.Expanding))
        self.mainScrollArea.frameShape = qt.QFrame.NoFrame

        # Slicelet panel
        self.sliceletPanel = qt.QFrame(self.mainFrame)
        self.sliceletPanelLayout = qt.QVBoxLayout(self.sliceletPanel)
        self.sliceletPanelLayout.spacing = 0
        self.mainScrollArea.setWidget(self.sliceletPanel)

        self.mainLayout.addWidget(self.mainScrollArea)
        self.mainMenuDockWidget.setWidget(self.mainFrame)

        # Setup feature panel
        self.setupUi()

        self.sliceletPanelLayout.addStretch(1)

        self.setupSettingsPanel()

        self.mainScrollArea.minimumWidth = self.sliceletPanel.sizeHint.width()
Пример #3
0
    def __init__(self,
                 parent,
                 logic,
                 configurationName='Default',
                 sliceletDockWidgetPosition=qt.Qt.LeftDockWidgetArea):
        logging.debug('Guidelet.__init__')
        self.sliceletDockWidgetPosition = sliceletDockWidgetPosition
        self.parent = parent
        self.logic = logic
        self.configurationName = configurationName
        self.parameterNodeObserver = None
        self.parameterNode = self.logic.getParameterNode()
        self.layoutManager = slicer.app.layoutManager()
        self.layoutNameToIdMap = {}
        self.layoutNameToSelectCallbackMap = {}
        self.defaultLayoutName = self.VIEW_ULTRASOUND

        self.logic.updateParameterNodeFromSettings(self.parameterNode,
                                                   self.configurationName)
        self.setAndObserveParameterNode(self.parameterNode)

        self.ultrasound = self.getUltrasoundClass()
        self.fitUltrasoundImageToViewOnConnect = True
        self.setupConnectorNode()

        self.sliceletDockWidget = qt.QDockWidget(self.parent)
        self.mainWindow = slicer.util.mainWindow()
        self.sliceletDockWidget.setParent(self.mainWindow)
        self.mainWindow.addDockWidget(self.sliceletDockWidgetPosition,
                                      self.sliceletDockWidget)
        self.sliceletPanel = qt.QFrame(self.sliceletDockWidget)
        self.sliceletPanelLayout = qt.QVBoxLayout(self.sliceletPanel)
        self.sliceletDockWidget.setWidget(self.sliceletPanel)

        self.topPanelLayout = qt.QGridLayout(self.sliceletPanel)
        self.sliceletPanelLayout.addLayout(self.topPanelLayout)
        self.setupTopPanel()

        self.setupFeaturePanelList()
        self.setupAdvancedPanel()
        self.setupAdditionalPanel()

        self.addConnectorObservers()
        self.setupConnections()

        self.sliceletDockWidget.setStyleSheet(self.loadStyleSheet())
Пример #4
0
    def create(self, widgetType='window', showHeader=False, showPreview=False):
        """
    main window is a frame with widgets from the app
    widget repacked into it along with slicer-specific 
    extra widgets
    """

        # find internals of widget for reference and repacking
        self.toolBar = slicer.util.findChildren(self.dicomApp, 'ToolBar')[0]
        self.databaseNameLabel = slicer.util.findChildren(
            self.dicomApp, 'DatabaseNameLabel')[0]
        self.databaseDirectoryButton = slicer.util.findChildren(
            self.dicomApp, 'DirectoryButton')[0]
        self.tree = slicer.util.findChildren(self.dicomApp, 'TreeView')[0]
        self.userFrame = slicer.util.findChildren(self.dicomApp,
                                                  'UserFrame')[0]
        self.thumbs = slicer.util.findChildren(self.dicomApp,
                                               'ThumbnailsWidget')[0]
        self.widthSlider = slicer.util.findChildren(self.dicomApp,
                                                    'ThumbnailWidthSlider')[0]
        self.preview = slicer.util.findChildren(self.dicomApp,
                                                'PreviewFrame')[0]

        self.widgetType = widgetType
        if widgetType == 'dialog':
            self.window = qt.QDialog(self.dicomApp)
        elif widgetType == 'window':
            self.window = qt.QWidget()
        elif widgetType == 'popup':
            self.window = ctk.ctkPopupWidget(self.dicomApp)
            self.window.orientation = 1
            self.window.horizontalDirection = 0
            self.window.alignment = 0x82
        elif widgetType == 'dock':
            self.dock = qt.QDockWidget(slicer.util.mainWindow())
            self.dock.setFeatures(qt.QDockWidget.DockWidgetFloatable
                                  | qt.QDockWidget.DockWidgetMovable
                                  | qt.QDockWidget.DockWidgetClosable)
            slicer.util.mainWindow().addDockWidget(0x15, self.dock)
            self.window = qt.QFrame()
            self.dock.setWidget(self.window)
        else:
            raise "Unknown widget type - should be dialog, window, dock or popup"

        self.window.setWindowTitle('DICOM Details')

        self.layout = qt.QGridLayout()
        self.window.setLayout(self.layout)

        # overall layout - tree on top, preview and selection below
        toolRow = 0
        treeRow = 1
        selectionRow = 2

        # tool row at top, with commands and database
        self.toolLayout = qt.QHBoxLayout()
        self.layout.addLayout(self.toolLayout, toolRow, 0, 1, 2)
        self.toolLayout.addWidget(self.toolBar)
        self.toolLayout.addWidget(self.databaseNameLabel)
        self.toolLayout.addWidget(self.databaseDirectoryButton)

        # tree goes next, spread across 1 row, 2 columns
        self.layout.addWidget(self.tree, treeRow, 0, 1, 2)

        #
        # preview related column
        #
        self.previewLayout = qt.QVBoxLayout()
        self.layout.addLayout(self.previewLayout, selectionRow, 0)

        self.previewLayout.addWidget(self.thumbs)
        self.previewLayout.addWidget(self.widthSlider)
        if showPreview:
            self.previewLayout.addWidget(self.preview)
        else:
            self.preview.hide()

        #
        # action related column (interacting with slicer)
        #
        self.actionLayout = qt.QVBoxLayout()
        self.layout.addLayout(self.actionLayout, selectionRow, 1)
        self.actionLayout.addWidget(self.userFrame)

        tableWidth = 350 if showHeader else 700
        self.loadableTable = DICOMLoadableTable(self.userFrame,
                                                width=tableWidth)
        self.actionLayout.addWidget(self.loadableTable.widget)

        #
        # button row for action column
        #
        self.actionButtonLayout = qt.QHBoxLayout()
        self.actionLayout.addLayout(self.actionButtonLayout)

        self.uncheckAllButton = qt.QPushButton('Uncheck All')
        self.actionButtonLayout.addWidget(self.uncheckAllButton)
        self.uncheckAllButton.connect('clicked()', self.uncheckAllLoadables)

        self.loadButton = qt.QPushButton('Load Selection to Slicer')
        self.loadButton.enabled = False
        self.actionButtonLayout.addWidget(self.loadButton)
        self.loadButton.connect('clicked()', self.loadCheckedLoadables)

        self.closeButton = qt.QPushButton('Close')
        self.actionButtonLayout.addWidget(self.closeButton)
        self.closeButton.connect('clicked()', self.close)

        if self.setBrowserPersistence:
            self.browserPersistentButton = qt.QCheckBox(
                'Make DICOM Browser Persistent')
            self.browserPersistentButton.toolTip = 'When enabled, DICOM Broswer remains open and usable after leaving DICOM module'
            self.actionLayout.addWidget(self.browserPersistentButton)
            self.browserPersistentButton.connect('stateChanged(int)',
                                                 self.setBrowserPersistence)

        #
        # header related column (more details about the selected file)
        #
        if showHeader:
            self.headerLayout = qt.QVBoxLayout()
            self.layout.addLayout(self.headerLayout, selectionRow, 2)
            self.header = DICOMHeaderWidget(self.window)
            self.headerLayout.addWidget(self.header.widget)
Пример #5
0
    def create(self, widgetType='window', showHeader=False, showPreview=False):
        """
    main window is a frame with widgets from the app
    widget repacked into it along with slicer-specific
    extra widgets
    """

        # find internals of widget for reference and repacking
        self.toolBar = slicer.util.findChildren(self.dicomBrowser,
                                                'ToolBar')[0]
        self.databaseNameLabel = slicer.util.findChildren(
            self.dicomBrowser, 'DatabaseNameLabel')[0]
        self.databaseDirectoryButton = slicer.util.findChildren(
            self.dicomBrowser, 'DirectoryButton')[0]
        #self.tables = self.dicomBrowser.tableManager
        self.tables = slicer.util.findChildren(self.dicomBrowser,
                                               'dicomTableManager')[0]

        #self.userFrame = slicer.util.findChildren(self.dicomBrowser, 'UserFrame')[0]
        self.userFrame = qt.QWidget()
        #self.thumbs = slicer.util.findChildren(self.dicomBrowser, 'ThumbnailsWidget')[0]
        #self.widthSlider = slicer.util.findChildren(self.dicomBrowser, 'ThumbnailWidthSlider')[0]
        self.preview = qt.QWidget()

        self.widgetType = widgetType
        if widgetType == 'dialog':
            self.window = qt.QDialog(self.dicomBrowser)
        elif widgetType == 'window':
            self.window = qt.QWidget()
        elif widgetType == 'popup':
            self.window = ctk.ctkPopupWidget(self.dicomBrowser)
            self.window.orientation = 1
            self.window.horizontalDirection = 0
            self.window.alignment = 0x82
        elif widgetType == 'dock':
            self.dock = qt.QDockWidget(slicer.util.mainWindow())
            self.dock.setFeatures(qt.QDockWidget.DockWidgetFloatable
                                  | qt.QDockWidget.DockWidgetMovable
                                  | qt.QDockWidget.DockWidgetClosable)
            slicer.util.mainWindow().addDockWidget(0x15, self.dock)
            self.window = qt.QFrame()
            self.dock.setWidget(self.window)
        else:
            raise "Unknown widget type - should be dialog, window, dock or popup"

        self.window.setWindowTitle('DICOM Browser')

        self.layout = qt.QVBoxLayout(self.window)

        # tool row at top, with commands and database
        self.toolFrame = qt.QWidget()
        self.toolFrame.setMaximumHeight(40)
        self.toolLayout = qt.QHBoxLayout(self.toolFrame)
        self.layout.addWidget(self.toolFrame)
        self.toolLayout.addWidget(self.toolBar)
        self.toolLayout.addWidget(self.databaseNameLabel)
        self.databaseNameLabel.visible = False
        self.toolLayout.addWidget(self.databaseDirectoryButton)
        self.databaseDirectoryButton.visible = False
        self.settingsButton = ctk.ctkExpandButton()
        self.toolBar.addWidget(self.settingsButton)
        self.settingsButton.connect('toggled(bool)', self.onSettingsButton)

        # tables goes next, spread across 1 row, 2 columns
        self.tables.tableOrientation = self.tableOrientation
        self.tables.dynamicTableLayout = False
        self.tablesExpandableWidget = ctk.ctkExpandableWidget()
        self.tablesLayout = qt.QVBoxLayout(self.tablesExpandableWidget)
        self.tablesLayout.addWidget(self.tables)
        self.tablesExpandableWidget.setMinimumHeight(400)
        self.layout.addWidget(self.tablesExpandableWidget)

        #
        # preview related column
        #
        self.previewLayout = qt.QVBoxLayout()
        #self.layout.addLayout(self.previewLayout,selectionRow,0)

        #self.previewLayout.addWidget(self.thumbs)
        #self.previewLayout.addWidget(self.widthSlider)
        if showPreview:
            self.previewLayout.addWidget(self.preview)
        else:
            self.preview.hide()

        #
        # action related column (interacting with slicer)
        #
        self.loadableTableFrame = qt.QWidget()
        self.loadableTableLayout = qt.QFormLayout(self.loadableTableFrame)
        self.layout.addWidget(self.loadableTableFrame)

        self.loadableTableLayout.addWidget(self.userFrame)
        self.userFrame.hide()

        tableWidth = 350 if showHeader else 600
        self.loadableTable = DICOMLoadableTable(self.userFrame,
                                                width=tableWidth)
        #self.loadableTableLayout.addWidget(self.loadableTable.widget)
        #self.loadableTable.widget.hide()

        #
        # button row for action column
        #
        self.actionButtonsFrame = qt.QWidget()
        self.actionButtonsFrame.setMaximumHeight(40)
        self.layout.addWidget(self.actionButtonsFrame)
        #self.layout.addStretch(1)
        self.actionButtonLayout = qt.QHBoxLayout()
        self.actionButtonsFrame.setLayout(self.actionButtonLayout)

        self.loadButton = qt.QPushButton('Load')
        self.loadButton.enabled = True
        self.loadButton.toolTip = 'Load Selection to Slicer'
        self.actionButtonLayout.addWidget(self.loadButton)
        self.loadButton.connect('clicked()', self.loadCheckedLoadables)

        self.headerPopup = DICOMLib.DICOMHeaderPopup()

        self.viewMetadataButton = qt.QPushButton('Metadata')
        self.viewMetadataButton.toolTip = 'Display Metadata of the Selected Series'
        self.viewMetadataButton.enabled = False
        self.actionButtonLayout.addWidget(self.viewMetadataButton)
        self.viewMetadataButton.connect('clicked()', self.onViewHeaderButton)
        self.viewMetadataButton.connect('clicked()', self.headerPopup.open)
        self.actionButtonLayout.addStretch(1)

        self.examineButton = qt.QPushButton('Examine')
        self.actionButtonLayout.addWidget(self.examineButton)
        self.examineButton.enabled = False
        self.examineButton.connect('clicked()', self.examineForLoading)

        self.uncheckAllButton = qt.QPushButton('Uncheck All')
        self.actionButtonLayout.addWidget(self.uncheckAllButton)
        self.uncheckAllButton.connect('clicked()', self.uncheckAllLoadables)
        self.actionButtonLayout.addStretch(1)

        self.closeButton = qt.QPushButton('Close')
        #self.actionButtonLayout.addWidget(self.closeButton)
        self.closeButton.connect('clicked()', self.close)

        self.advancedViewButton = qt.QCheckBox('Advanced')
        self.actionButtonLayout.addWidget(self.advancedViewButton)
        self.advancedViewButton.enabled = True
        self.advancedViewButton.checked = self.advancedViewCheckState
        self.advancedViewButton.connect('clicked()', self.onAdvanedViewButton)

        self.horizontalViewCheckBox = qt.QCheckBox('Horizontal Tables')
        self.horizontalViewCheckBox.visible = False
        self.toolLayout.addWidget(self.horizontalViewCheckBox)
        self.horizontalViewCheckBox.enabled = True
        if self.tableOrientation == 1:
            self.horizontalViewCheckBox.checked = True
        self.horizontalViewCheckBox.connect('stateChanged(int)',
                                            self.onHorizontalViewCheckBox)

        if self.setBrowserPersistence:
            self.browserPersistentButton = qt.QCheckBox('Browser Persistent')
            self.browserPersistentButton.toolTip = 'When enabled, DICOM Broswer remains open and usable after leaving DICOM module'
            self.actionButtonLayout.addWidget(self.browserPersistentButton)
            self.browserPersistentButton.connect('stateChanged(int)',
                                                 self.setBrowserPersistence)

        if self.advancedViewCheckState == True:
            self.loadableTableFrame.show()
            self.window.adjustSize()
        else:
            self.examineButton.hide()
            self.uncheckAllButton.hide()
            self.loadableTableFrame.hide()
            self.window.adjustSize()
        #
        # header related column (more details about the selected file)
        #
        if showHeader:
            self.headerLayout = qt.QVBoxLayout()
            self.layout.addLayout(self.headerLayout, selectionRow, 2)
            self.header = DICOMHeaderWidget(self.window)
            self.headerLayout.addWidget(self.header.widget)

        #
        # Plugin selection widget
        #
        self.pluginSelector = DICOMPluginSelector(self.window)
        self.loadableTableLayout.addRow(self.pluginSelector.widget,
                                        self.loadableTable.widget)
        self.checkBoxByPlugins = []

        for pluginClass in slicer.modules.dicomPlugins:
            self.checkBox = self.pluginSelector.checkBoxByPlugin[pluginClass]
            self.checkBox.connect('stateChanged(int)',
                                  self.onPluginStateChanged)
            self.checkBoxByPlugins.append(self.checkBox)
Пример #6
0
  def create(self,widgetType='window',showHeader=False,showPreview=False):
    """
    main window is a frame with widgets from the app
    widget repacked into it along with slicer-specific
    extra widgets
    """

    # find internals of widget for reference and repacking
    self.toolBar = slicer.util.findChildren(self.dicomBrowser, 'ToolBar')[0]
    self.databaseNameLabel = slicer.util.findChildren(self.dicomBrowser, 'DatabaseNameLabel')[0]
    self.databaseDirectoryButton = slicer.util.findChildren(self.dicomBrowser, 'DirectoryButton')[0]
    self.tableDensityLabel = qt.QLabel('Density: ')
    self.tableDensityComboBox = slicer.util.findChildren(self.dicomBrowser, 'tableDensityComboBox')[0]
    self.tableDensityComboBox.connect('currentIndexChanged(QString)', self.onTableDensityComboBox)
    index = self.tableDensityComboBox.findText(self.tableDensity)
    if  (index != -1) :
      self.tableDensityComboBox.setCurrentIndex(index)

    #self.tables = self.dicomBrowser.tableManager
    self.tables = slicer.util.findChildren(self.dicomBrowser, 'dicomTableManager')[0]
    patientTable = slicer.util.findChildren(self.tables, 'patientsTable')[0]
    patientTableView = slicer.util.findChildren(patientTable, 'tblDicomDatabaseView')[0]
    patientSearchBox = slicer.util.findChildren(patientTable, 'leSearchBox')[0]
    studyTable = slicer.util.findChildren(self.tables, 'studiesTable')[0]
    studyTableView = slicer.util.findChildren(studyTable, 'tblDicomDatabaseView')[0]
    studySearchBox = slicer.util.findChildren(studyTable, 'leSearchBox')[0]
    seriesTable = slicer.util.findChildren(self.tables, 'seriesTable')[0]
    seriesTableView = slicer.util.findChildren(seriesTable, 'tblDicomDatabaseView')[0]
    seriesSearchBox = slicer.util.findChildren(seriesTable, 'leSearchBox')[0]
    self.tableSplitter = qt.QSplitter()
    self.tableSplitter.addWidget(patientTableView)
    self.tableSplitter.addWidget(studyTableView)
    self.tableSplitter.addWidget(seriesTableView)

    # TODO: Move to this part to CTK
    patientTableView.resizeColumnsToContents()
    studyTableView.resizeColumnsToContents()
    seriesTableView.resizeColumnsToContents()

    #self.userFrame = slicer.util.findChildren(self.dicomBrowser, 'UserFrame')[0]
    self.userFrame = qt.QWidget()
    #self.thumbs = slicer.util.findChildren(self.dicomBrowser, 'ThumbnailsWidget')[0]
    #self.widthSlider = slicer.util.findChildren(self.dicomBrowser, 'ThumbnailWidthSlider')[0]
    self.preview = qt.QWidget()

    self.widgetType = widgetType
    if widgetType == 'dialog':
      self.window = qt.QDialog(self.dicomBrowser)
    elif widgetType == 'window':
      self.window = qt.QWidget()
    elif widgetType == 'popup':
      self.window = ctk.ctkPopupWidget(self.dicomBrowser)
      self.window.orientation = 1
      self.window.horizontalDirection = 0
      self.window.alignment = 0x82
    elif widgetType == 'dock':
      self.dock = qt.QDockWidget(slicer.util.mainWindow())
      self.dock.setFeatures( qt.QDockWidget.DockWidgetFloatable |
                                qt.QDockWidget.DockWidgetMovable |
                                qt.QDockWidget.DockWidgetClosable )
      slicer.util.mainWindow().addDockWidget(0x15, self.dock)
      self.window = qt.QFrame()
      self.dock.setWidget(self.window)
    else:
      raise "Unknown widget type - should be dialog, window, dock or popup"

    self.setModality(not self.browserPersistent)

    self.window.setWindowTitle('DICOM Browser')

    self.layout = qt.QVBoxLayout(self.window)

    # tool row at top, with commands and database
    self.toolFrame = qt.QWidget()
    self.toolFrame.setMaximumHeight(40)
    self.toolFrame.setContentsMargins(-5,-5,-5,-5)
    self.toolLayout = qt.QHBoxLayout(self.toolFrame)
    self.layout.addWidget(self.toolFrame)
    self.toolLayout.addWidget(self.toolBar)
    self.settingsButton = ctk.ctkExpandButton()
    self.toolLayout.addWidget(self.settingsButton)
    self.toolLayout.addWidget(self.databaseNameLabel)
    self.databaseNameLabel.visible = False
    self.toolLayout.addWidget(self.databaseDirectoryButton)
    self.databaseDirectoryButton.visible = False
    self.toolLayout.addWidget(self.tableDensityLabel)
    self.tableDensityLabel.visible = False
    self.toolLayout.addWidget(self.tableDensityComboBox)
    self.tableDensityComboBox.visible = False
    self.settingsButton.connect('toggled(bool)', self.onSettingsButton)

    # enable export button and make new connection
    self.actionExport = self.dicomBrowser.findChildren('QAction', 'ActionExport')[0]
    self.actionExport.enabled = 1
    self.actionExport.connect('triggered()', self.onExportAction)

    # search row
    self.searchFrame = qt.QWidget()
    self.searchFrame.setMaximumHeight(40)
    self.searchLayout = qt.QHBoxLayout(self.searchFrame)
    self.layout.addWidget(self.searchFrame)
    patinetsLabel = qt.QLabel('Patients: ')
    self.searchLayout.addWidget(patinetsLabel)
    self.searchLayout.addWidget(patientSearchBox)
    studiesLabel = qt.QLabel('Studies: ')
    self.searchLayout.addWidget(studiesLabel)
    self.searchLayout.addWidget(studySearchBox)
    seriesLabel = qt.QLabel('Series: ')
    self.searchLayout.addWidget(seriesLabel)
    self.searchLayout.addWidget(seriesSearchBox)

    # tables goes next, spread across 1 row, 2 columns
    if self.horizontalTables:
      self.tableSplitter.setOrientation(1)
    else:
      self.tableSplitter.setOrientation(0)
    self.layout.addWidget(self.tableSplitter)

    #
    # preview related column
    #
    self.previewLayout = qt.QVBoxLayout()
    #self.layout.addLayout(self.previewLayout,selectionRow,0)

    #self.previewLayout.addWidget(self.thumbs)
    #self.previewLayout.addWidget(self.widthSlider)
    if showPreview:
      self.previewLayout.addWidget(self.preview)
    else:
      self.preview.hide()

    #
    # action related column (interacting with slicer)
    #
    self.loadableTableFrame = qt.QWidget()
    self.loadableTableFrame.setMaximumHeight(200)
    self.loadableTableLayout = qt.QFormLayout(self.loadableTableFrame)
    self.layout.addWidget(self.loadableTableFrame)

    self.loadableTableLayout.addWidget(self.userFrame)
    self.userFrame.hide()

    tableWidth = 350 if showHeader else 600
    self.loadableTable = DICOMLoadableTable(self.userFrame,width=tableWidth)
    #self.loadableTableLayout.addWidget(self.loadableTable.widget)
    #self.loadableTable.widget.hide()

    #
    # button row for action column
    #
    self.actionButtonsFrame = qt.QWidget()
    self.actionButtonsFrame.setMaximumHeight(40)
    self.layout.addWidget(self.actionButtonsFrame)
    #self.layout.addStretch(1)
    self.actionButtonLayout = qt.QHBoxLayout()
    self.actionButtonsFrame.setLayout(self.actionButtonLayout)

    self.loadButton = qt.QPushButton('Load')
    self.loadButton.enabled = True
    self.loadButton.toolTip = 'Load Selection to Slicer'
    self.actionButtonLayout.addWidget(self.loadButton)
    self.loadButton.connect('clicked()', self.loadCheckedLoadables)

    self.headerPopup = DICOMLib.DICOMHeaderPopup()

    self.viewMetadataButton = qt.QPushButton('Metadata')
    self.viewMetadataButton.toolTip = 'Display Metadata of the Selected Series'
    self.viewMetadataButton.enabled = False
    self.actionButtonLayout.addWidget(self.viewMetadataButton)
    self.viewMetadataButton.connect('clicked()', self.onViewHeaderButton)
    self.viewMetadataButton.connect('clicked()', self.headerPopup.open)
    self.actionButtonLayout.addStretch(1)

    self.examineButton = qt.QPushButton('Examine')
    self.actionButtonLayout.addWidget(self.examineButton)
    self.examineButton.enabled = False
    self.examineButton.connect('clicked()', self.examineForLoading)

    self.uncheckAllButton = qt.QPushButton('Uncheck All')
    self.actionButtonLayout.addWidget(self.uncheckAllButton)
    self.uncheckAllButton.connect('clicked()', self.uncheckAllLoadables)
    self.actionButtonLayout.addStretch(1)

    self.closeButton = qt.QPushButton('Close')
    #self.actionButtonLayout.addWidget(self.closeButton)
    self.closeButton.connect('clicked()', self.close)

    self.advancedViewButton = qt.QCheckBox('Advanced')
    self.actionButtonLayout.addWidget(self.advancedViewButton)
    self.advancedViewButton.enabled = True
    self.advancedViewButton.checked = self.advancedView
    self.advancedViewButton.connect('clicked()', self.onAdvanedViewButton)

    self.horizontalViewCheckBox = qt.QCheckBox('Horizontal')
    self.horizontalViewCheckBox.checked = self.horizontalTables
    self.horizontalViewCheckBox.connect('clicked()', self.onHorizontalViewCheckBox)
    self.actionButtonLayout.addWidget(self.horizontalViewCheckBox)
    self.toolLayout.addStretch(1)

    self.browserPersistentButton = qt.QCheckBox('Browser Persistent')
    self.browserPersistentButton.toolTip = 'When enabled, DICOM Browser remains open after loading data or switching to another module'
    self.browserPersistentButton.checked = self.browserPersistent
    self.actionButtonLayout.addWidget(self.browserPersistentButton)
    self.browserPersistentButton.connect('stateChanged(int)', self.setBrowserPersistence)

    if self.advancedView:
      self.loadableTableFrame.visible = True
    else:
      self.loadableTableFrame.visible = False
      self.examineButton.visible = False
      self.uncheckAllButton.visible = False
    #
    # header related column (more details about the selected file)
    #
    if showHeader:
      self.headerLayout = qt.QVBoxLayout()
      self.layout.addLayout(self.headerLayout,selectionRow,2)
      self.header = DICOMHeaderWidget(self.window)
      self.headerLayout.addWidget(self.header.widget)

    #
    # Plugin selection widget
    #
    self.pluginSelector = DICOMPluginSelector(self.window)
    self.loadableTableLayout.addRow(self.pluginSelector.widget,self.loadableTable.widget)
    self.checkBoxByPlugins = []

    for pluginClass in slicer.modules.dicomPlugins:
      self.checkBox = self.pluginSelector.checkBoxByPlugin[pluginClass]
      self.checkBox.connect('stateChanged(int)', self.onPluginStateChanged)
      self.checkBoxByPlugins.append(self.checkBox)