Exemple #1
0
 def setupLayoutWidget(self):
   self.layoutWidget = qt.QWidget()
   self.layoutWidget.setLayout(qt.QHBoxLayout())
   layoutWidget = slicer.qMRMLLayoutWidget()
   layoutManager = slicer.qSlicerLayoutManager()
   layoutManager.setMRMLScene(slicer.mrmlScene)
   layoutManager.setScriptedDisplayableManagerDirectory(slicer.app.slicerHome + "/bin/Python/mrmlDisplayableManager")
   layoutWidget.setLayoutManager(layoutManager)
   slicer.app.setLayoutManager(layoutManager)
   layoutWidget.setLayout(slicer.vtkMRMLLayoutNode.SlicerLayoutFourUpView)
   self.layoutWidget.layout().addWidget(layoutWidget)
 def setupLayoutWidget(self):
   self.layoutWidget = qt.QWidget()
   self.layoutWidget.setLayout(qt.QHBoxLayout())
   layoutWidget = slicer.qMRMLLayoutWidget()
   layoutManager = slicer.qSlicerLayoutManager()
   layoutManager.setMRMLScene(slicer.mrmlScene)
   layoutManager.setScriptedDisplayableManagerDirectory(slicer.app.slicerHome + "/bin/Python/mrmlDisplayableManager")
   layoutWidget.setLayoutManager(layoutManager)
   slicer.app.setLayoutManager(layoutManager)
   layoutWidget.setLayout(slicer.vtkMRMLLayoutNode.SlicerLayoutFourUpView)
   self.layoutWidget.layout().addWidget(layoutWidget)
Exemple #3
0
  def __init__(self, parent, developerMode=False, widgetClass=None):
    VTKObservationMixin.__init__(self)
    # Set up main frame
    self.parent = parent
    self.parent.setLayout(qt.QHBoxLayout())

    self.layout = self.parent.layout()
    self.layout.setMargin(0)
    self.layout.setSpacing(0)

    self.sliceletPanel = qt.QFrame(self.parent)
    self.sliceletPanelLayout = qt.QVBoxLayout(self.sliceletPanel)
    self.sliceletPanelLayout.setMargin(4)
    self.sliceletPanelLayout.setSpacing(0)
    self.layout.addWidget(self.sliceletPanel,1)

    #Set Advanced Parameters Collapsible Button
    self.parametersCollapsibleButton = ctk.ctkCollapsibleButton()
    self.parametersCollapsibleButton.text = "Set Advanced Segmentation Parameters"
    self.parametersCollapsibleButton.collapsed = True
    self.sliceletPanelLayout.addWidget(self.parametersCollapsibleButton)
    # Layout within the collapsible button
    self.parametersLayout = qt.QFormLayout(self.parametersCollapsibleButton)
    # Set Minimum Threshold of Percentage Increase to First Post-Contrast Image
    self.inputMinimumThreshold = qt.QLabel("Minimum Threshold of Increase", self.parametersCollapsibleButton)
    self.inputMinimumThreshold.setToolTip('Minimum Threshold of Percentage Increase (Pre- to First Post-contrast (Range: 10% to 150%)')
    self.inputSelectorMinimumThreshold = qt.QDoubleSpinBox(self.parametersCollapsibleButton)
    self.inputSelectorMinimumThreshold.setSuffix("%")
    self.inputSelectorMinimumThreshold.singleStep = (1)
    self.inputSelectorMinimumThreshold.minimum = (10)
    self.inputSelectorMinimumThreshold.maximum = (150)
    self.inputSelectorMinimumThreshold.value = (75)
    self.inputSelectorMinimumThreshold.setToolTip('Minimum Threshold of Percentage Increase (Pre- to First Post-contrast (Range: 10% to 150%)')
    self.parametersLayout.addRow(self.inputMinimumThreshold, self.inputSelectorMinimumThreshold)
    # Curve 1 Type Parameters (Slopes from First to Fourth Post-Contrast Images)
    self.inputCurve1 = qt.QLabel("Type 1 (Persistent) Curve Minimum Slope", self.parametersCollapsibleButton)
    self.inputCurve1.setToolTip('Minimum Slope of Delayed Curve to classify as Persistent (Range: 0.02 to 0.3)')
    self.inputSelectorCurve1 = qt.QDoubleSpinBox(self.parametersCollapsibleButton)
    self.inputSelectorCurve1.singleStep = (0.02)
    self.inputSelectorCurve1.minimum = (0.02)
    self.inputSelectorCurve1.maximum = (0.30)
    self.inputSelectorCurve1.value = (0.20)
    self.inputSelectorCurve1.setToolTip('Minimum Slope of Delayed Curve to classify as Persistent (Range: 0.02 to 0.3)')
    self.parametersLayout.addRow(self.inputCurve1, self.inputSelectorCurve1)
    # Curve 3 Type Parameters (Slopes from First to Fourth Post-Contrast Images)
    self.inputCurve3 = qt.QLabel("Type 3 (Washout) Curve Maximum Slope", self.parametersCollapsibleButton)
    self.inputCurve3.setToolTip('Maximum Slope of Delayed Curve to classify as Washout (Range: -0.02 to -0.3)')
    self.inputSelectorCurve3 = qt.QDoubleSpinBox(self.parametersCollapsibleButton)
    self.inputSelectorCurve3.singleStep = (0.02)
    self.inputSelectorCurve3.setPrefix("-")
    self.inputSelectorCurve3.minimum = (0.02)
    self.inputSelectorCurve3.maximum = (0.30)
    self.inputSelectorCurve3.value = (0.20)
    self.inputSelectorCurve3.setToolTip('Maximum Slope of Delayed Curve to classify as Washout (Range: -0.02 to -0.3)')
    self.parametersLayout.addRow(self.inputCurve3, self.inputSelectorCurve3)

    # Path input for dicom data to analyze
    self.inputPath = qt.QFileDialog()
    self.inputPath.setFileMode(qt.QFileDialog.Directory)
    self.sliceletPanelLayout.addWidget(self.inputPath)
    self.inputPath.connect('accepted()', self.createLogic)


    ##############
    self.layoutWidget = slicer.qMRMLLayoutWidget()
    self.layoutWidget.setMRMLScene(slicer.mrmlScene)
    self.layoutWidget.setLayout(slicer.vtkMRMLLayoutNode.SlicerLayoutOneUp3DView)
    self.layout.addWidget(self.layoutWidget,2)


    if widgetClass:
      self.widget = widgetClass(self.parent)
    self.parent.show()
  def __init__(self, FrameParent):

    self.currentMummyName = ""
    self.currentExplanation = ""
   
    self.frameParent = FrameParent
    self.frameParent.setLayout(qt.QHBoxLayout())

    self.layout = self.frameParent.layout()
    self.layout.setMargin(0)
    self.layout.setSpacing(0)

    moduleDir = os.path.dirname(__file__)
    uiPath = os.path.join(moduleDir, 'Resources', 'UI', 'MummyInterface.ui')

    # Load widget from .ui file (created by Qt Designer)
    self.uiWidget = slicer.util.loadUI(uiPath)
    self.layout.addWidget(self.uiWidget)
    self.ui = slicer.util.childWidgetVariables(self.uiWidget)

    # keyboard "v" shows the control panel
    shortcutShow = qt.QShortcut(self.frameParent)
    shortcutShow.setKey(qt.QKeySequence("v"))
    shortcutShow.connect('activated()', lambda: self.showPanel())

    # keyboard "e" hides the control panel
    shortcutHide = qt.QShortcut(self.frameParent)
    shortcutHide.setKey(qt.QKeySequence("e"))
    shortcutHide.connect('activated()', lambda: self.hidePanel())

    # Add layout widget
    self.layoutWidget = slicer.qMRMLLayoutWidget()
    self.layoutWidget.setMRMLScene(slicer.mrmlScene)
    self.frameParent.layout().addWidget(self.layoutWidget)
    self.layoutWidget.setLayout(slicer.vtkMRMLLayoutNode.SlicerLayoutOneUp3DView)
    
    self.threeDWidget = self.layoutWidget.layoutManager().threeDWidget(0)
    self.threeDWidget.threeDController().setVisible(False)

    self.threeDView = self.threeDWidget.threeDView()

    # Set up the Volumen rendering
    self.volRenLogic = slicer.modules.volumerendering.logic()
    self.setupCustomPreset()
    # Set the Default rendering method. They can be:
    #    - vtkMRMLCPURayCastVolumeRenderingDisplayNode (combobox: "VTK CPU Ray Casting" )
    #    - vtkMRMLGPURayCastVolumeRenderingDisplayNode (combobox: "VTK GPU Ray Casting" )
    #    - vtkMRMLMultiVolumeRenderingDisplayNode (combobox: "VTK Multi-Volume" )
    self.volRenLogic.SetDefaultRenderingMethod("vtkMRMLGPURayCastVolumeRenderingDisplayNode")

    # set up background color, box, label axis
    self.setup3DView()

    self.setupConnections()

    # Show defaul mummy (Mummy1)
    self.onLoadMummy1()

    #Full screen
    self.frameParent.showFullScreen() 
    self.frameParent.show()