How to use the slicer.app.layoutManager function in slicer

To help you get started, we’ve selected a few slicer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SlicerProstate / SliceTracker / SliceTrackerUtils / mixins.py View on Github external
def layoutManager(self):
    return slicer.app.layoutManager()
github SlicerRt / SlicerRT / SegmentEditor / SegmentEditor.py View on Github external
def getDefaultMasterVolumeNodeID(self):
    layoutManager = slicer.app.layoutManager()
    # Use first background volume node in any of the displayed layouts
    for layoutName in layoutManager.sliceViewNames():
      compositeNode = self.getCompositeNode(layoutName)
      if compositeNode.GetBackgroundVolumeID():
        return compositeNode.GetBackgroundVolumeID()
    # Use first background volume node in any of the displayed layouts
    for layoutName in layoutManager.sliceViewNames():
      compositeNode = self.getCompositeNode(layoutName)
      if compositeNode.GetForegroundVolumeID():
        return compositeNode.GetForegroundVolumeID()
    # Not found anything
    return None
github SlicerHeart / SlicerHeart / CardiacDeviceSimulator / CardiacDeviceSimulator.py View on Github external
probeToRasMatrix = vtk.vtkMatrix4x4()
      probeToRasTransformNode.GetMatrixTransformToWorld(probeToRasMatrix)

      rasToProbeMatrix = vtk.vtkMatrix4x4()
      rasToProbeMatrix.DeepCopy(probeToRasMatrix)
      rasToProbeMatrix.Invert()

      positioningTransformNode = self.parameterNode.GetNodeReference('PositioningTransform')
      positioningTransformNode.ApplyTransformMatrix(rasToProbeMatrix)

      # set probeToRas transform to identity
      identityMatrix = vtk.vtkMatrix4x4()
      probeToRasTransformNode.SetMatrixTransformFromParent(identityMatrix)

      # reset slice views and 3d views (to refocus on RVOT model)
      manager = slicer.app.layoutManager()
      manager.resetSliceViews()
      manager.resetThreeDViews()

    from CardiacDeviceSimulatorUtils.DeviceSelectorWidget import DeviceImplantWidget
    self.addObserver(self.parameterNode, CardiacDeviceBase.DEVICE_CLASS_MODIFIED_EVENT, self.onDeviceClassModified)
    self.addObserver(self.parameterNode, CardiacDeviceBase.DEVICE_PARAMETER_VALUE_MODIFIED_EVENT, self.onDeviceParameterValueModified)
github Kitware / SlicerSALT / Modules / Scripted / ShapeAnalysisToolBox / DataImporter.py View on Github external
def center3dView(self):
    layoutManager = slicer.app.layoutManager()
    threeDWidget = layoutManager.threeDWidget(0)
    threeDView = threeDWidget.threeDView()
    threeDView.resetFocalPoint()
github QIICR / QuantitativeReporting / QuantitativeReporting / QuantitativeReporting.py View on Github external
def setupFourUpTableViewConnection(self):
    if not self.fourUpTableView and self.layoutManager.layout == self.fourUpSliceTableViewLayoutButton.LAYOUT:
      if slicer.app.layoutManager().tableWidget(0):
        self.fourUpTableView = slicer.app.layoutManager().tableWidget(0).tableView()
        self.fourUpTableView.selectionModel().selectionChanged.connect(self.onSegmentSelectionChanged)
        self.fourUpTableView.setSelectionBehavior(qt.QTableView.SelectRows)