def setup(self): # Instantiate and connect widgets ... # # # # Reload and Test area # # # reloadCollapsibleButton = ctk.ctkCollapsibleButton() # reloadCollapsibleButton.text = "Reload && Test" # self.layout.addWidget(reloadCollapsibleButton) # reloadFormLayout = qt.QFormLayout(reloadCollapsibleButton) # # reload button # # (use this during development, but remove it when delivering # # your module to users) # self.reloadButton = qt.QPushButton("Reload") # self.reloadButton.toolTip = "Reload this module." # self.reloadButton.name = "PortPlacement Reload" # reloadFormLayout.addWidget(self.reloadButton) # self.reloadButton.connect('clicked()', self.onReload) # # reload and test button # # (use this during development, but remove it when delivering # # your module to users) # self.reloadAndTestButton = qt.QPushButton("Reload and Test") # self.reloadAndTestButton.toolTip = "Reload this module and then run the self tests." # reloadFormLayout.addWidget(self.reloadAndTestButton) # self.reloadAndTestButton.connect('clicked()', self.onReloadAndTest) # # Ports Area # portsCollapsibleButton = ctk.ctkCollapsibleButton() portsCollapsibleButton.text = "Surgical Ports" self.layout.addWidget(portsCollapsibleButton) portsFormLayout = qt.QFormLayout(portsCollapsibleButton) # # port fiducial list selector # self.portListSelector = slicer.qMRMLNodeComboBox() self.portListSelector.nodeTypes = ["vtkMRMLMarkupsFiducialNode"] self.portListSelector.addEnabled = False self.portListSelector.removeEnabled = False self.portListSelector.noneEnabled = True self.portListSelector.setMRMLScene(slicer.mrmlScene) self.portListSelector.setToolTip("Add surgical ports from a markups node.") portsFormLayout.addRow("Markups node of surgical ports", self.portListSelector) # # Add Port List button # self.addPortListButton = qt.QPushButton("Set Port Markups Node") self.addPortListButton.enabled = False portsFormLayout.addRow(self.addPortListButton) # # Port table # self.portsTable = qt.QTableView() self.portsTableModel = qt.QStandardItemModel() self.portsTable.setModel(self.portsTableModel) portsFormLayout.addRow(self.portsTable) # # Remove Port button # self.removePortButton = qt.QPushButton("Remove Selected Port") self.removePortButton.enabled = False portsFormLayout.addRow(self.removePortButton) # # Target area # targetCollapsibleButton = ctk.ctkCollapsibleButton() targetCollapsibleButton.text = "Surgical Target" self.layout.addWidget(targetCollapsibleButton) targetFormLayout = qt.QFormLayout(targetCollapsibleButton) # # target selector # self.targetSelector = slicer.qMRMLNodeComboBox() self.targetSelector.nodeTypes = ["vtkMRMLMarkupsFiducialNode"] self.targetSelector.addEnabled = False self.targetSelector.removeEnabled = False self.targetSelector.noneEnabled = True self.targetSelector.setMRMLScene(slicer.mrmlScene) self.targetSelector.setToolTip("Pick the surgical target that the tools should face.") targetFormLayout.addRow("Surgical Target Fiducial", self.targetSelector) # # Retarget button # self.retargetButton = qt.QPushButton("Aim Tools at Target") self.retargetButton.toolTip = "Reset tool orientations to face target fiducial" self.retargetButton.enabled = False targetFormLayout.addRow(self.retargetButton) # # Port Tool Display Options # toolsCollapsibleButton = ctk.ctkCollapsibleButton() toolsCollapsibleButton.text = "Port Tool Display Options" self.layout.addWidget(toolsCollapsibleButton) toolsFormLayout = qt.QFormLayout(toolsCollapsibleButton) # # Transform sliders # self.transformSliders = slicer.qMRMLTransformSliders() self.transformSliders.TypeOfTransform = slicer.qMRMLTransformSliders.ROTATION self.transformSliders.CoordinateReference = slicer.qMRMLTransformSliders.LOCAL self.transformSliders.Title = 'Tool Orientation' self.transformSliders.minMaxVisible = False toolsFormLayout.addRow(self.transformSliders) # # radius spin box # self.radiusSpinBox = qt.QDoubleSpinBox() self.radiusSpinBox.setMinimum(0.0) self.radiusSpinBox.setMaximum(10.0) self.radiusSpinBox.setValue(2.0) toolsFormLayout.addRow("Tool radius", self.radiusSpinBox) # # length spin box # self.lengthSpinBox = qt.QDoubleSpinBox() self.lengthSpinBox.setMinimum(0.0) self.lengthSpinBox.setMaximum(250.0) self.lengthSpinBox.setValue(150.0) toolsFormLayout.addRow("Tool length", self.lengthSpinBox) # connections self.portListSelector.connect('currentNodeChanged(bool)', self.onPortListSelectorChanged) self.targetSelector.connect('currentNodeChanged(bool)', self.onTargetSelectorChanged) self.addPortListButton.connect('clicked(bool)', self.onAddPortListButton) self.removePortButton.connect('clicked(bool)', self.onRemovePortButton) self.retargetButton.connect('clicked(bool)', self.onRetargetButton) self.radiusSpinBox.connect('valueChanged(double)', self.onToolShapeChanged) self.lengthSpinBox.connect('valueChanged(double)', self.onToolShapeChanged) # Add vertical spacer self.layout.addStretch(1) # Add observer to scene for removal of fiducial nodes self.sceneObserverTag = slicer.mrmlScene.AddObserver(slicer.mrmlScene.NodeRemovedEvent, self.onNodeRemoved) # instantiate port placement module logic self.logic = PortPlacementLogic() self.currentMarkupsNode = None self.onMarkupAddedTag = None
def setup(self): ScriptedLoadableModuleWidget.setup(self) # Instantiate and connect widgets ... # # Parameters Area # parametersCollapsibleButton = ctk.ctkCollapsibleButton() parametersCollapsibleButton.text = "Parameters" self.layout.addWidget(parametersCollapsibleButton) # Layout within the dummy collapsible button parametersFormLayout = qt.QFormLayout(parametersCollapsibleButton) # # input volume selector # self.inputSelector = slicer.qMRMLNodeComboBox() self.inputSelector.nodeTypes = (("vtkMRMLScalarVolumeNode"), "") self.inputSelector.addAttribute("vtkMRMLScalarVolumeNode", "LabelMap", 0) self.inputSelector.selectNodeUponCreation = True self.inputSelector.addEnabled = False self.inputSelector.removeEnabled = False self.inputSelector.noneEnabled = False self.inputSelector.showHidden = False self.inputSelector.showChildNodeTypes = False self.inputSelector.setMRMLScene(slicer.mrmlScene) self.inputSelector.setToolTip("Pick the input to the algorithm.") parametersFormLayout.addRow("Input Volume: ", self.inputSelector) # # output volume selector # self.outputSelector = slicer.qMRMLNodeComboBox() self.outputSelector.nodeTypes = (("vtkMRMLScalarVolumeNode"), "") self.outputSelector.addAttribute("vtkMRMLScalarVolumeNode", "LabelMap", 0) self.outputSelector.selectNodeUponCreation = False self.outputSelector.addEnabled = True self.outputSelector.removeEnabled = True self.outputSelector.noneEnabled = False self.outputSelector.showHidden = False self.outputSelector.showChildNodeTypes = False self.outputSelector.setMRMLScene(slicer.mrmlScene) self.outputSelector.setToolTip("Pick the output to the algorithm.") parametersFormLayout.addRow("Output Volume: ", self.outputSelector) # # check box to trigger taking screen shots for later use in tutorials # self.enableScreenshotsFlagCheckBox = qt.QCheckBox() self.enableScreenshotsFlagCheckBox.checked = 0 self.enableScreenshotsFlagCheckBox.setToolTip("If checked, take screen shots for tutorials. Use Save Data to write them to disk.") parametersFormLayout.addRow("Enable Screenshots", self.enableScreenshotsFlagCheckBox) # # scale factor for screen shots # self.screenshotScaleFactorSliderWidget = ctk.ctkSliderWidget() self.screenshotScaleFactorSliderWidget.singleStep = 1.0 self.screenshotScaleFactorSliderWidget.minimum = 1.0 self.screenshotScaleFactorSliderWidget.maximum = 50.0 self.screenshotScaleFactorSliderWidget.value = 1.0 self.screenshotScaleFactorSliderWidget.setToolTip("Set scale factor for the screen shots.") parametersFormLayout.addRow("Screenshot scale factor", self.screenshotScaleFactorSliderWidget) # # Apply Button # self.applyButton = qt.QPushButton("Apply") self.applyButton.toolTip = "Run the algorithm." self.applyButton.enabled = False parametersFormLayout.addRow(self.applyButton) # connections self.applyButton.connect('clicked(bool)', self.onApplyButton) self.inputSelector.connect("currentNodeChanged(vtkMRMLNode*)", self.onSelect) self.outputSelector.connect("currentNodeChanged(vtkMRMLNode*)", self.onSelect) # Add vertical spacer # self.layout.addStretch(1) # # Load Data # dm = DataManager() loadDataCollapsibleButton = ctk.ctkCollapsibleButton() loadDataCollapsibleButton.text = "Load Data" self.layout.addWidget(loadDataCollapsibleButton) loadDataFormLayout = qt.QFormLayout(loadDataCollapsibleButton) # Load MRI Button self.loadMRIButton = qt.QPushButton("Load MRI") self.loadMRIButton.toolTip = "Load the MRI File." self.loadMRIButton.name = "LoadMRI" loadDataFormLayout.addWidget(self.loadMRIButton) self.loadMRIButton.connect('clicked()', dm.loadMRI) # Load Histology Button self.loadHistologyButton = qt.QPushButton("Load Histology") self.loadHistologyButton.toolTip = "Load the Histology File." self.loadHistologyButton.name = "LoadHistology" loadDataFormLayout.addWidget(self.loadHistologyButton) self.loadHistologyButton.connect('clicked()', dm.loadHistology) '''lm = slicer.app.layoutManager() red = lm.sliceWidget('Red') redLogic = red.sliceLogic() # Print current slice offset position print redLogic.GetSliceOffset() # Change slice position redLogic.SetSliceOffset(20)''' self.alignButton = qt.QPushButton("Align Volumes") self.alignButton.toolTip = "Rotate to Volume Plane." self.alignButton.name = "AlignVolumes" loadDataFormLayout.addWidget(self.alignButton) self.alignButton.connect('clicked()', dm.alignSlices) self.positionSliderWidget = slicer.qMRMLTransformSliders() self.positionSliderWidget.Title = 'Position' self.positionSliderWidget.TypeOfTransform = slicer.qMRMLTransformSliders.TRANSLATION self.positionSliderWidget.CoordinateReference = slicer.qMRMLTransformSliders.LOCAL self.positionSliderWidget.setMRMLScene(slicer.mrmlScene) dm.setPositionSliderWidget(self.positionSliderWidget) #self.positionSliderWidget.setMRMLTransformNode(slicer.util.getNode(self.transformNode.GetID())) loadDataFormLayout.addRow("Translation", self.positionSliderWidget) self.orientationSliderWidget = slicer.qMRMLTransformSliders() self.orientationSliderWidget.Title = 'Orientation' self.orientationSliderWidget.setMRMLScene(slicer.mrmlScene) # Setting of qMRMLTransformSliders.TypeOfTransform is not robust: it has to be set after setMRMLScene and # has to be set twice (with setting the type to something else in between). # Therefore the following 3 lines are needed, and they are needed here: self.orientationSliderWidget.TypeOfTransform = slicer.qMRMLTransformSliders.ROTATION self.orientationSliderWidget.TypeOfTransform = slicer.qMRMLTransformSliders.TRANSLATION self.orientationSliderWidget.TypeOfTransform = slicer.qMRMLTransformSliders.ROTATION self.orientationSliderWidget.CoordinateReference=slicer.qMRMLTransformSliders.LOCAL self.orientationSliderWidget.minMaxVisible = False dm.setOrientationSliderWidget(self.orientationSliderWidget) #self.orientationSliderWidget.setMRMLTransformNode(self.getPivotToRasTransformNode()) loadDataFormLayout.addRow("Orientation", self.orientationSliderWidget) # # Bounding Box # boundingBoxCollapsibleButton = ctk.ctkCollapsibleButton() boundingBoxCollapsibleButton.text = "Mark Extents" self.layout.addWidget(boundingBoxCollapsibleButton) boundingBoxFormLayout = qt.QFormLayout(boundingBoxCollapsibleButton) # # ROI definition # roiDefintitionCollapsibleButton = ctk.ctkCollapsibleButton() roiDefintitionCollapsibleButton.text = "ROI definition" self.layout.addWidget(roiDefintitionCollapsibleButton) roiDefintitionFormLayout = qt.QFormLayout(roiDefintitionCollapsibleButton) roiManager = ROIManager(dm) # Mark Prostate Button self.markProstateButton = qt.QPushButton("Mark Prostate") self.markProstateButton.toolTip = "Mark the boundaries of the prostate." self.markProstateButton.name = "MarkProstate" roiDefintitionFormLayout.addWidget(self.markProstateButton) self.markProstateButton.connect('clicked()', roiManager.markProstate) # Mark Urethra Button self.markUrethraButton = qt.QPushButton("Mark Urethra") self.markUrethraButton.toolTip = "Mark the boundaries of the urethra." self.markUrethraButton.name = "MarkUrethra" roiDefintitionFormLayout.addWidget(self.markUrethraButton) self.markUrethraButton.connect('clicked()', roiManager.markUrethra) # # PET/MR alignment # petMRIAlignmentCollapsibleButton = ctk.ctkCollapsibleButton() petMRIAlignmentCollapsibleButton.text = "PET/MR alignment" self.layout.addWidget(petMRIAlignmentCollapsibleButton) petMRAlignmentFormLayout = qt.QFormLayout(petMRIAlignmentCollapsibleButton) # # Landmarking on histology and PET/MR # landmarksCollapsibleButton = ctk.ctkCollapsibleButton() landmarksCollapsibleButton.text = "Set Landmarks" self.layout.addWidget(landmarksCollapsibleButton) landmarksFormLayout = qt.QFormLayout(landmarksCollapsibleButton) landmarkManager = LandmarkManager(dm) # Set MRI Landmarks Button self.switchToLandmarksLayoutButton = qt.QPushButton("Switch to Landmarks Layout") self.switchToLandmarksLayoutButton.toolTip = "Switch to Landmarks Layout" self.switchToLandmarksLayoutButton.name = "SwitchToLandmarksLayout" landmarksFormLayout.addWidget(self.switchToLandmarksLayoutButton) self.switchToLandmarksLayoutButton.connect('clicked()', landmarkManager.setLayout) self.setMRILandmarksButton = qt.QPushButton("Set MRI Landmarks") self.setMRILandmarksButton.toolTip = "Set MRI Landmarks" self.setMRILandmarksButton.name = "SetMRILandmarks" landmarksFormLayout.addWidget(self.setMRILandmarksButton) self.setMRILandmarksButton.connect('clicked()', landmarkManager.setLandmarksForMRI) self.finishedMRIButton = qt.QPushButton("Finished MRI") self.finishedMRIButton.toolTip = "Finished MRI Landmarks" self.finishedMRIButton.name = "FinishedMRILandmarks" landmarksFormLayout.addWidget(self.finishedMRIButton) self.finishedMRIButton.connect('clicked()', landmarkManager.setMouseModeBack) # Set Histology Landmarks Button self.setHistoLandmarksButton = qt.QPushButton("Set Histology Landmarks") self.setHistoLandmarksButton.toolTip = "Set Histology Landmarks" self.setHistoLandmarksButton.name = "SetHistoLandmarks" landmarksFormLayout.addWidget(self.setHistoLandmarksButton) self.setHistoLandmarksButton.connect('clicked()', landmarkManager.setLandmarksForHisto) self.finishedHistoButton = qt.QPushButton("Finished Histo") self.finishedHistoButton.toolTip = "Finished MRI Landmarks" self.finishedHistoButton.name = "FinishedMRILandmarks" landmarksFormLayout.addWidget(self.finishedHistoButton) self.finishedHistoButton.connect('clicked()', landmarkManager.setMouseModeBack) # # Registration Optimization # registrationCollapsibleButton = ctk.ctkCollapsibleButton() registrationCollapsibleButton.text = "Optimize Registration" self.layout.addWidget(registrationCollapsibleButton) registrationFormLayout = qt.QFormLayout(registrationCollapsibleButton)
def setup(self): # Collapsible button self.centrarCollapsibleButton = ctk.ctkCollapsibleButton() self.centrarCollapsibleButton.text = u"Centrar imagen y guardar transformación" self.layout.addWidget(self.centrarCollapsibleButton) # Layout within the collapsible button self.centrarLayout = qt.QFormLayout(self.centrarCollapsibleButton) #selector de imgen a centrar self.imagenSelector = slicer.qMRMLNodeComboBox() self.imagenSelector.objectName = 'imagenSelector' self.imagenSelector.toolTip = 'Seleccione la imagen que desea centrar' self.imagenSelector.nodeTypes = ['vtkMRMLScalarVolumeNode'] self.imagenSelector.noneEnabled = True self.imagenSelector.addEnabled = False # Se quita la posibilidad al usuario de crear un nuevo nodo con este widget self.imagenSelector.removeEnabled = False # Se le quita al usuario la posibilidad de eliminar el nodo seleccionado en ese momento ## self.imagenSelector.connect('currentNodeChanged(bool)', self.enableOrDisableCentrarButton) self.imagenSelector.setMRMLScene(slicer.mrmlScene) self.centrarLayout.addRow("Volumen a centrar:", self.imagenSelector) self.parent.connect('mrmlSceneChanged(vtkMRMLScene*)', self.imagenSelector, 'setMRMLScene(vtkMRMLScene*)') #Boton centrar self.centrarButton = qt.QPushButton("Centrar") self.centrarButton.toolTip = u"Centre la imagen y guarde la transoformación de sentrado y su transformada inversa" self.centrarLayout.addWidget(self.centrarButton) self.centrarButton.connect('clicked(bool)', self.onCentrar) self.centrarButton.enabled = True self.layout.addStretch(1) # Collapsible button self.registrarCollapsibleButton = ctk.ctkCollapsibleButton() self.registrarCollapsibleButton.text = u"Registrar imágenes" self.layout.addWidget(self.registrarCollapsibleButton) # Layout within the collapsible button self.registrarLayout = qt.QFormLayout(self.registrarCollapsibleButton) #selector de transformacion self.transformSelector = slicer.qMRMLNodeComboBox() self.transformSelector.objectName = 'transformSelector' self.transformSelector.toolTip = u'El método requiere que sólo centre la resonancia con este modulo' self.transformSelector.nodeTypes = ['vtkMRMLLinearTransformNode'] self.transformSelector.noneEnabled = True self.transformSelector.addEnabled = True # Se quita la posibilidad al usuario de crear un nuevo nodo con este widget self.transformSelector.removeEnabled = True # Se le quita al usuario la posibilidad de eliminar el nodo seleccionado en ese momento ## self.transformSelector.connect('currentNodeChanged(bool)', self.enableOrDisableRegistrarButton) self.transformSelector.setMRMLScene(slicer.mrmlScene) self.registrarLayout.addRow("Transformacion de entrada:", self.transformSelector) self.parent.connect('mrmlSceneChanged(vtkMRMLScene*)', self.transformSelector, 'setMRMLScene(vtkMRMLScene*)') #selector de imgen fija self.imagenFijaSelector = slicer.qMRMLNodeComboBox() self.imagenFijaSelector.objectName = 'imagenFijaSelector' self.imagenFijaSelector.toolTip = 'Seleccione la imagen fija' self.imagenFijaSelector.nodeTypes = ['vtkMRMLScalarVolumeNode'] self.imagenFijaSelector.noneEnabled = True self.imagenFijaSelector.addEnabled = False # Se quita la posibilidad al usuario de crear un nuevo nodo con este widget self.imagenFijaSelector.removeEnabled = False # Se le quita al usuario la posibilidad de eliminar el nodo seleccionado en ese momento ## self.imagenFijaSelector.connect('currentNodeChanged(bool)', self.enableOrDisableRegistrarButton) self.imagenFijaSelector.setMRMLScene(slicer.mrmlScene) self.registrarLayout.addRow("Imagen Fija:", self.imagenFijaSelector) self.parent.connect('mrmlSceneChanged(vtkMRMLScene*)', self.imagenFijaSelector, 'setMRMLScene(vtkMRMLScene*)') #selector de imgen movil self.imagenMovilSelector = slicer.qMRMLNodeComboBox() self.imagenMovilSelector.objectName = 'imagenMovilSelector' self.imagenMovilSelector.toolTip = u'Seleccione la imagen móvil' self.imagenMovilSelector.nodeTypes = ['vtkMRMLScalarVolumeNode'] self.imagenMovilSelector.noneEnabled = True self.imagenMovilSelector.addEnabled = False # Se quita la posibilidad al usuario de crear un nuevo nodo con este widget self.imagenMovilSelector.removeEnabled = False # Se le quita al usuario la posibilidad de eliminar el nodo seleccionado en ese momento ## self.imagenMovilSelector.connect('currentNodeChanged(bool)', self.enableOrDisableRegistrarButton) self.imagenMovilSelector.setMRMLScene(slicer.mrmlScene) self.registrarLayout.addRow(u"Imagen Móvil:", self.imagenMovilSelector) self.parent.connect('mrmlSceneChanged(vtkMRMLScene*)', self.imagenMovilSelector, 'setMRMLScene(vtkMRMLScene*)') #selector de imgen Salida self.imagenSalidaSelector = slicer.qMRMLNodeComboBox() self.imagenSalidaSelector.objectName = 'imagenMovilSelector' self.imagenSalidaSelector.toolTip = u'Seleccione la imagen Salida' self.imagenSalidaSelector.nodeTypes = ['vtkMRMLScalarVolumeNode'] self.imagenSalidaSelector.noneEnabled = True self.imagenSalidaSelector.addEnabled = True # Se quita la posibilidad al usuario de crear un nuevo nodo con este widget self.imagenSalidaSelector.removeEnabled = False # Se le quita al usuario la posibilidad de eliminar el nodo seleccionado en ese momento ## self.imagenMovilSelector.connect('currentNodeChanged(bool)', self.enableOrDisableRegistrarButton) self.imagenSalidaSelector.setMRMLScene(slicer.mrmlScene) self.registrarLayout.addRow(u"Imagen Salida:", self.imagenSalidaSelector) self.parent.connect('mrmlSceneChanged(vtkMRMLScene*)', self.imagenSalidaSelector, 'setMRMLScene(vtkMRMLScene*)') #Boton ajustar self.ajustarButton = qt.QPushButton(u"Pre-ajustar imágenes") self.ajustarButton.toolTip = u"ajustar imágenes para facilitar el registro" self.registrarLayout.addWidget(self.ajustarButton) self.ajustarButton.connect('clicked(bool)', self.onAjustar) self.ajustarButton.enabled = True self.layout.addStretch(1) #Boton registrar self.registrarButton = qt.QPushButton(u"Registrar imágenes") self.registrarButton.toolTip = u"Centre una imagen y guarde la transformación de centrado y su inversa" self.registrarLayout.addWidget(self.registrarButton) self.registrarButton.connect('clicked(bool)', self.onRegistrar) self.registrarButton.enabled = True self.layout.addStretch(1) # Collapsible button #self.ajustarCollapsibleButton = ctk.ctkCollapsibleButton() #self.ajustarCollapsibleButton.text = u"Preajustar imágenes" #self.layout.addWidget(self.ajustarCollapsibleButton) self.ajustarDialog = qt.QDialog() #self.ajustarDialog.rejected.connect(self.onCancelarPreajuste) #self.ajustarDialog.accepted.connect(self.onAplicarPreajuste) # Layout within the collapsible button self.ajustarLayout = qt.QFormLayout(self.ajustarDialog) #sliders para de desplazamiento la posicion de la imagen movil self.transformTraslationSliders = slicer.qMRMLTransformSliders() self.transformTraslationSliders.toolTip = u"Desplace para trasladar la imagen móvil" self.transformTraslationSliders.Title = u'Traslación' self.transformTraslationSliders.TypeOfTransform = self.transformTraslationSliders.TRANSLATION self.ajustarLayout.addRow(self.transformTraslationSliders) #sliders para de desplazamiento la posicion de la imagen movil self.transformRotationSliders = slicer.qMRMLTransformSliders() self.transformRotationSliders.toolTip = u"Desplace para rotar la imagen móvil" self.transformRotationSliders.TypeOfTransform = self.transformRotationSliders.ROTATION self.transformRotationSliders.Title = u'Rotación' self.transformRotationSliders.LRLabel = 'Sagital' self.transformRotationSliders.PALabel = 'Coronal' self.transformRotationSliders.ISLabel = 'Axial' self.transformRotationSliders.minMaxVisible = False self.ajustarLayout.addRow(self.transformRotationSliders) self.cancelarButton = qt.QPushButton(u"Cancelar") self.cancelarButton.toolTip = u"Devuelve la imagen movil al estado inicial del preajuste" self.ajustarLayout.addWidget(self.cancelarButton) self.cancelarButton.connect('clicked(bool)', self.onCancelarPreajuste) self.cancelarButton.enabled = True self.capplyButton = qt.QPushButton(u"Aplicar") self.capplyButton.toolTip = u"Aplica el preajuste" self.ajustarLayout.addWidget(self.capplyButton) self.capplyButton.connect('clicked(bool)', self.onAplicarPreajuste) self.capplyButton.enabled = True
def setup(self): ScriptedLoadableModuleWidget.setup(self) # Instantiate and connect widgets ... self.iconsPath = "H:/src/S4Mods/UltrasoundSimulator/UltrasoundSimulator/Resources/Icons" # Used Icons self.recordIcon = qt.QIcon(self.iconsPath + '/icon_Record.png') self.playIcon = qt.QIcon(self.iconsPath + '/icon_Play.png') self.stopIcon = qt.QIcon(self.iconsPath + '/icon_Stop.png') self.restartIcon = qt.QIcon(self.iconsPath + '/icon_Restart.png') self.openIcon = qt.QIcon(self.iconsPath + '/icon_Open.png') # # Parameters Area # self.calibrate1CollapsibleButton = ctk.ctkCollapsibleButton() self.calibrate1CollapsibleButton.text = "Calibrate I" self.layout.addWidget(self.calibrate1CollapsibleButton) # Layout within the dummy collapsible button calibrate1FormLayout = qt.QFormLayout(self.calibrate1CollapsibleButton) # # transform selector # self.IMUTransformSelector = slicer.qMRMLNodeComboBox() self.IMUTransformSelector.nodeTypes = ["vtkMRMLLinearTransformNode"] self.IMUTransformSelector.selectNodeUponCreation = False self.IMUTransformSelector.addEnabled = False self.IMUTransformSelector.removeEnabled = False self.IMUTransformSelector.noneEnabled = False self.IMUTransformSelector.showHidden = False self.IMUTransformSelector.showChildNodeTypes = False self.IMUTransformSelector.setMRMLScene( slicer.mrmlScene ) self.IMUTransformSelector.setToolTip( "Select the IMU orientation transform." ) calibrate1FormLayout.addRow("Orientation Transform: ", self.IMUTransformSelector) # Calibration info self.calibrationInstructionsGroupBox = qt.QGroupBox() self.calibrationInstructionsGroupBox.setLayout(qt.QVBoxLayout()) self.calibrationInstructionsLabel01 = qt.QLabel("Initialize calibration") self.calibrationInstructionsLabel01.setStyleSheet("QLabel {color: #000000; text-decoration: underline;}") self.calibrationInstructionsGroupBox.layout().addWidget(self.calibrationInstructionsLabel01) self.calibrationInstructionsLabel02 = qt.QLabel("Select Orientation Transform and press Start Calibration.") self.calibrationInstructionsLabel02.setWordWrap(True) self.calibrationInstructionsLabel02.setStyleSheet("QLabel {color: #A0A0A0;}") self.calibrationInstructionsGroupBox.layout().addWidget(self.calibrationInstructionsLabel02) self.calibrationInstructionsLabel11 = qt.QLabel("Place initial fiducials") self.calibrationInstructionsLabel11.setStyleSheet("QLabel {color: #000000; text-decoration: underline;}") self.calibrationInstructionsGroupBox.layout().addWidget(self.calibrationInstructionsLabel11) self.calibrationInstructionsLabel12 = qt.QLabel("Scroll through the slice views, locate the sphere numbered 1, press the point in the center of the sphere.") self.calibrationInstructionsLabel12.setWordWrap(True) self.calibrationInstructionsLabel12.setStyleSheet("QLabel {color: #A0A0A0;}") self.calibrationInstructionsGroupBox.layout().addWidget(self.calibrationInstructionsLabel12) self.calibrationInstructionsLabel21 = qt.QLabel("Align calibration model") self.calibrationInstructionsLabel21.setWordWrap(True) self.calibrationInstructionsLabel21.setStyleSheet("QLabel {color: #000000; text-decoration: underline;}") self.calibrationInstructionsGroupBox.layout().addWidget(self.calibrationInstructionsLabel21) self.calibrationInstructionsLabel22 = qt.QLabel("Use sliders (LR, PA, IS) and the scroll wheel, in order to align the digit inside sphere 1. \nWhen finished, press Calibration Model Aligned.") self.calibrationInstructionsLabel22.setWordWrap(True) self.calibrationInstructionsLabel22.setStyleSheet("QLabel {color: #A0A0A0;}") self.calibrationInstructionsGroupBox.layout().addWidget(self.calibrationInstructionsLabel22) self.calibrationInstructionsLabel31 = qt.QLabel("Place calibration fiducials") self.calibrationInstructionsLabel31.setWordWrap(True) self.calibrationInstructionsLabel31.setStyleSheet("QLabel {color: #000000; text-decoration: underline;}") self.calibrationInstructionsGroupBox.layout().addWidget(self.calibrationInstructionsLabel31) self.calibrationInstructionsLabel32 = qt.QLabel("Scroll through the slice views, locate the sphere numbered 2, press the point in the center of the sphere.") self.calibrationInstructionsLabel32.setWordWrap(True) self.calibrationInstructionsLabel32.setStyleSheet("QLabel {color: #A0A0A0;}") self.calibrationInstructionsGroupBox.layout().addWidget(self.calibrationInstructionsLabel32) self.calibrationInstructionsLabel41 = qt.QLabel("Calculate calibration transform") self.calibrationInstructionsLabel41.setWordWrap(True) self.calibrationInstructionsLabel41.setStyleSheet("QLabel {color: #000000; text-decoration: underline;}") self.calibrationInstructionsGroupBox.layout().addWidget(self.calibrationInstructionsLabel41) self.calibrationInstructionsLabel42 = qt.QLabel("Press Calculate Calibration Transform") self.calibrationInstructionsLabel42.setWordWrap(True) self.calibrationInstructionsLabel42.setStyleSheet("QLabel {color: #A0A0A0;}") self.calibrationInstructionsGroupBox.layout().addWidget(self.calibrationInstructionsLabel42) calibrate1FormLayout.addRow("Calibration Steps:", self.calibrationInstructionsGroupBox) buttonHeight = 35 # Start/Stop/Restart calibration Button calibrateControlsLayout = qt.QHBoxLayout() calibrate1FormLayout.addRow(calibrateControlsLayout) self.startCalibrationButton = qt.QPushButton(" Start Calibration") self.startCalibrationButton.setCheckable(False) self.startCalibrationButton.setIcon(self.playIcon) self.startCalibrationButton.setEnabled(False) self.startCalibrationButton.setToolTip("Start calibration of the Ultrasound Simulator") self.startCalibrationButton.setSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding) self.startCalibrationButton.setFixedHeight(buttonHeight) calibrateControlsLayout.addWidget(self.startCalibrationButton) self.stopCalibrationButton = qt.QPushButton(" Stop Calibration") self.stopCalibrationButton.setCheckable(False) self.stopCalibrationButton.setIcon(self.stopIcon) self.stopCalibrationButton.setEnabled(False) self.stopCalibrationButton.setToolTip("Stop calibration of the Ultrasound Simulator") self.stopCalibrationButton.setSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding) self.stopCalibrationButton.setFixedHeight(buttonHeight) calibrateControlsLayout.addWidget(self.stopCalibrationButton) self.restartCalibrationButton = qt.QPushButton(" Restart Calibration") self.restartCalibrationButton.setCheckable(False) self.restartCalibrationButton.setIcon(self.restartIcon) self.restartCalibrationButton.setEnabled(False) self.restartCalibrationButton.setToolTip("Restart calibration of the Ultrasound Simulator") self.restartCalibrationButton.setSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding) self.restartCalibrationButton.setFixedHeight(buttonHeight) calibrateControlsLayout.addWidget(self.restartCalibrationButton) # qMRMLTransformSliders widget self.w = slicer.qMRMLTransformSliders() self.w.CoordinateReference = self.w.GLOBAL self.w.TypeOfTransform = self.w.ROTATION calibrate1FormLayout.addRow(self.w) alignButtonLayout = qt.QHBoxLayout() calibrate1FormLayout.addRow(alignButtonLayout) self.alignedButton = qt.QPushButton("Calibration Model Aligned") self.alignedButton.setCheckable(False) self.alignedButton.setEnabled(False) self.alignedButton.setToolTip("Calibration model aligned") self.alignedButton.setSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding) self.alignedButton.setFixedHeight(buttonHeight) alignButtonLayout.addWidget(self.alignedButton) self.calculateTransformButton = qt.QPushButton("Calculate Calibration Transform") self.calculateTransformButton.setCheckable(False) self.calculateTransformButton.setEnabled(False) self.calculateTransformButton.setToolTip("Calculate calibration transform") self.calculateTransformButton.setSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding) self.calculateTransformButton.setFixedHeight(buttonHeight) alignButtonLayout.addWidget(self.calculateTransformButton) # # Calibrate 2 Area # self.calibrate2CollapsibleButton = ctk.ctkCollapsibleButton() self.calibrate2CollapsibleButton.text = "Calibrate II" self.layout.addWidget(self.calibrate2CollapsibleButton) # Layout within the dummy collapsible button calibrate2FormLayout = qt.QFormLayout(self.calibrate2CollapsibleButton) self.calibrate2Button = qt.QPushButton("Calibrate") self.calibrate2Button.setCheckable(False) self.calibrate2Button.setEnabled(True) self.calibrate2Button.setSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding) self.calibrate2Button.setFixedHeight(buttonHeight) calibrate2FormLayout.addWidget(self.calibrate2Button) # # Simulator Area # simulatorCollapsibleButton = ctk.ctkCollapsibleButton() simulatorCollapsibleButton.text = "Simulate Ultrasound" self.layout.addWidget(simulatorCollapsibleButton) # Layout within the dummy collapsible button simulatorFormLayout = qt.QFormLayout(simulatorCollapsibleButton) self.calibrationStatusLabel = qt.QLabel("Run calibration!") self.calibrationStatusLabel.setStyleSheet("QLabel {color: #FF0000;}") simulatorFormLayout.addRow("Calibration Status: ", self.calibrationStatusLabel) # Start/Stop/Restart calibration Button simulatorControlsLayout = qt.QHBoxLayout() simulatorFormLayout.addRow(simulatorControlsLayout) self.loadSampleVolumeButton = qt.QPushButton(" Load Sample Volume") self.loadSampleVolumeButton.setCheckable(False) self.loadSampleVolumeButton.setEnabled(False) self.loadSampleVolumeButton.setIcon(self.openIcon) self.loadSampleVolumeButton.setToolTip("Load sample abdominal phantom") self.loadSampleVolumeButton.setSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding) self.loadSampleVolumeButton.setFixedHeight(buttonHeight) simulatorControlsLayout.addWidget(self.loadSampleVolumeButton) self.runSimulatorButton = qt.QPushButton(" Run Simulator") self.runSimulatorButton.setCheckable(False) self.runSimulatorButton.setEnabled(False) self.runSimulatorButton.setIcon(self.playIcon) self.runSimulatorButton.setToolTip("Start the Ultrasound Simulator") self.runSimulatorButton.setSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding) self.runSimulatorButton.setFixedHeight(buttonHeight) simulatorControlsLayout.addWidget(self.runSimulatorButton) # Connections self.calibrate2Button.connect('clicked(bool)', self.onCalibrate2Button) self.calculateTransformButton.connect('clicked(bool)', self.onCalculateTransformButton) self.alignedButton.connect('clicked(bool)', self.onAlignedButton) self.startCalibrationButton.connect('clicked(bool)', self.onStartCalibrationButton) self.restartCalibrationButton.connect('clicked(bool)', self.onRestartCalibrationButton) self.stopCalibrationButton.connect('clicked(bool)', self.onStopCalibrationButton) self.IMUTransformSelector.connect("currentNodeChanged(vtkMRMLNode*)", self.onIMUTransformSelector) self.loadSampleVolumeButton.connect('clicked(bool)', self.onLoadSampleVolumeButton) self.runSimulatorButton.connect('clicked(bool)', self.onRunSimulatorButton) # Logic and Node members self.calibrationModelNode = None self.calibrationModelDisplayNode = None self.IMUTransformNode = None self.startFiducialNode = None self.endFiducialNode = None self.crosshairNode = None self.markupsModuleLogic = None self.tempTransform = None self.saveTransform = None self.volumeCurrentlyLoaded = None self.inverseTransform = None self.finalTransform = None self.translateTransform = None self.maskVolumeNode = None # Parameter members self.nbrOfFiducialsPlaced = 0 self.nbrOfFiducialsToPlace = 3 # Bool memebers self.calibrationInitialized = False self.placingFiducials = False self.layoutOneUpRedSliceView = False self.tempTransformApplied = False self.tempTransformAligned = False # Calibration state self.calibrationStateTimer = qt.QTimer() self.calibrationStateTimer.timeout.connect(self.calibrationStateTimeOut) self.currentCalibrationState = "PLACE_START_FIDUCIALS" # Layout manager self.applicationLogic = slicer.logic.vtkSlicerApplicationLogic() self.lm = slicer.app.layoutManager() # Left mouse click in Slice view observers self.redSliceWidget = self.lm.sliceWidget('Red') self.greenSliceWidget = self.lm.sliceWidget('Green') self.yellowSliceWidget = self.lm.sliceWidget('Yellow') self.redInteractor = self.redSliceWidget.sliceView().interactorStyle().GetInteractor() self.greenInteractor = self.greenSliceWidget.sliceView().interactorStyle().GetInteractor() self.yellowInteractor = self.yellowSliceWidget.sliceView().interactorStyle().GetInteractor() self.redInteractorObserverID = -1 self.greenInteractorObserverID = -1 self.yellowInteractorObserverID = -1 self.redSliceLogic = self.redSliceWidget.sliceLogic() self.redSliceNode = self.redSliceLogic.GetSliceNode() self.redSliceFGLayer = self.redSliceLogic.GetForegroundLayer() self.redSliceBGLayer = self.redSliceLogic.GetBackgroundLayer() self.redSliceCompositeNode = self.redSliceLogic.GetSliceCompositeNode() # For disabling mouse interaction self.interactorObserverTags = [] self.mouseEvents = ( "LeftButtonPressEvent", "LeftButtonReleaseEvent", "MiddleButtonPressEvent", "MiddleButtonReleaseEvent", "RightButtonPressEvent", "RightButtonReleaseEvent", "MouseMoveEvent", "KeyPressEvent", "EnterEvent", "LeaveEvent", "MouseWheelForwardEvent", "MouseWheelBackwardEvent" ) # Refresh state self.onIMUTransformSelector()
def setup(self): ScriptedLoadableModuleWidget.setup(self) # Instantiate and connect widgets ... # # Parameters Area # parametersCollapsibleButton = ctk.ctkCollapsibleButton() parametersCollapsibleButton.text = "Parameters" self.layout.addWidget(parametersCollapsibleButton) # Layout within the dummy collapsible button parametersFormLayout = qt.QFormLayout(parametersCollapsibleButton) # # input volume selector # self.inputSelector = slicer.qMRMLNodeComboBox() self.inputSelector.nodeTypes = (("vtkMRMLScalarVolumeNode"), "") self.inputSelector.addAttribute("vtkMRMLScalarVolumeNode", "LabelMap", 0) self.inputSelector.selectNodeUponCreation = True self.inputSelector.addEnabled = False self.inputSelector.removeEnabled = False self.inputSelector.noneEnabled = False self.inputSelector.showHidden = False self.inputSelector.showChildNodeTypes = False self.inputSelector.setMRMLScene(slicer.mrmlScene) self.inputSelector.setToolTip("Pick the input to the algorithm.") parametersFormLayout.addRow("Input Volume: ", self.inputSelector) # # output volume selector # self.outputSelector = slicer.qMRMLNodeComboBox() self.outputSelector.nodeTypes = (("vtkMRMLScalarVolumeNode"), "") self.outputSelector.addAttribute("vtkMRMLScalarVolumeNode", "LabelMap", 0) self.outputSelector.selectNodeUponCreation = False self.outputSelector.addEnabled = True self.outputSelector.removeEnabled = True self.outputSelector.noneEnabled = False self.outputSelector.showHidden = False self.outputSelector.showChildNodeTypes = False self.outputSelector.setMRMLScene(slicer.mrmlScene) self.outputSelector.setToolTip("Pick the output to the algorithm.") parametersFormLayout.addRow("Output Volume: ", self.outputSelector) # # check box to trigger taking screen shots for later use in tutorials # self.enableScreenshotsFlagCheckBox = qt.QCheckBox() self.enableScreenshotsFlagCheckBox.checked = 0 self.enableScreenshotsFlagCheckBox.setToolTip( "If checked, take screen shots for tutorials. Use Save Data to write them to disk." ) parametersFormLayout.addRow("Enable Screenshots", self.enableScreenshotsFlagCheckBox) # # scale factor for screen shots # self.screenshotScaleFactorSliderWidget = ctk.ctkSliderWidget() self.screenshotScaleFactorSliderWidget.singleStep = 1.0 self.screenshotScaleFactorSliderWidget.minimum = 1.0 self.screenshotScaleFactorSliderWidget.maximum = 50.0 self.screenshotScaleFactorSliderWidget.value = 1.0 self.screenshotScaleFactorSliderWidget.setToolTip( "Set scale factor for the screen shots.") parametersFormLayout.addRow("Screenshot scale factor", self.screenshotScaleFactorSliderWidget) # # Apply Button # self.applyButton = qt.QPushButton("Apply") self.applyButton.toolTip = "Run the algorithm." self.applyButton.enabled = False parametersFormLayout.addRow(self.applyButton) # connections self.applyButton.connect('clicked(bool)', self.onApplyButton) self.inputSelector.connect("currentNodeChanged(vtkMRMLNode*)", self.onSelect) self.outputSelector.connect("currentNodeChanged(vtkMRMLNode*)", self.onSelect) # Add vertical spacer # self.layout.addStretch(1) # # Load Data # dm = DataManager() loadDataCollapsibleButton = ctk.ctkCollapsibleButton() loadDataCollapsibleButton.text = "Load Data" self.layout.addWidget(loadDataCollapsibleButton) loadDataFormLayout = qt.QFormLayout(loadDataCollapsibleButton) # Load MRI Button self.loadMRIButton = qt.QPushButton("Load MRI") self.loadMRIButton.toolTip = "Load the MRI File." self.loadMRIButton.name = "LoadMRI" loadDataFormLayout.addWidget(self.loadMRIButton) self.loadMRIButton.connect('clicked()', dm.loadMRI) # Load Histology Button self.loadHistologyButton = qt.QPushButton("Load Histology") self.loadHistologyButton.toolTip = "Load the Histology File." self.loadHistologyButton.name = "LoadHistology" loadDataFormLayout.addWidget(self.loadHistologyButton) self.loadHistologyButton.connect('clicked()', dm.loadHistology) '''lm = slicer.app.layoutManager() red = lm.sliceWidget('Red') redLogic = red.sliceLogic() # Print current slice offset position print redLogic.GetSliceOffset() # Change slice position redLogic.SetSliceOffset(20)''' self.alignButton = qt.QPushButton("Align Volumes") self.alignButton.toolTip = "Rotate to Volume Plane." self.alignButton.name = "AlignVolumes" loadDataFormLayout.addWidget(self.alignButton) self.alignButton.connect('clicked()', dm.alignSlices) self.positionSliderWidget = slicer.qMRMLTransformSliders() self.positionSliderWidget.Title = 'Position' self.positionSliderWidget.TypeOfTransform = slicer.qMRMLTransformSliders.TRANSLATION self.positionSliderWidget.CoordinateReference = slicer.qMRMLTransformSliders.LOCAL self.positionSliderWidget.setMRMLScene(slicer.mrmlScene) dm.setPositionSliderWidget(self.positionSliderWidget) #self.positionSliderWidget.setMRMLTransformNode(slicer.util.getNode(self.transformNode.GetID())) loadDataFormLayout.addRow("Translation", self.positionSliderWidget) self.orientationSliderWidget = slicer.qMRMLTransformSliders() self.orientationSliderWidget.Title = 'Orientation' self.orientationSliderWidget.setMRMLScene(slicer.mrmlScene) # Setting of qMRMLTransformSliders.TypeOfTransform is not robust: it has to be set after setMRMLScene and # has to be set twice (with setting the type to something else in between). # Therefore the following 3 lines are needed, and they are needed here: self.orientationSliderWidget.TypeOfTransform = slicer.qMRMLTransformSliders.ROTATION self.orientationSliderWidget.TypeOfTransform = slicer.qMRMLTransformSliders.TRANSLATION self.orientationSliderWidget.TypeOfTransform = slicer.qMRMLTransformSliders.ROTATION self.orientationSliderWidget.CoordinateReference = slicer.qMRMLTransformSliders.LOCAL self.orientationSliderWidget.minMaxVisible = False dm.setOrientationSliderWidget(self.orientationSliderWidget) #self.orientationSliderWidget.setMRMLTransformNode(self.getPivotToRasTransformNode()) loadDataFormLayout.addRow("Orientation", self.orientationSliderWidget) # # Bounding Box # boundingBoxCollapsibleButton = ctk.ctkCollapsibleButton() boundingBoxCollapsibleButton.text = "Mark Extents" self.layout.addWidget(boundingBoxCollapsibleButton) boundingBoxFormLayout = qt.QFormLayout(boundingBoxCollapsibleButton) # # ROI definition # roiDefintitionCollapsibleButton = ctk.ctkCollapsibleButton() roiDefintitionCollapsibleButton.text = "ROI definition" self.layout.addWidget(roiDefintitionCollapsibleButton) roiDefintitionFormLayout = qt.QFormLayout( roiDefintitionCollapsibleButton) roiManager = ROIManager(dm) # Mark Prostate Button self.markProstateButton = qt.QPushButton("Mark Prostate") self.markProstateButton.toolTip = "Mark the boundaries of the prostate." self.markProstateButton.name = "MarkProstate" roiDefintitionFormLayout.addWidget(self.markProstateButton) self.markProstateButton.connect('clicked()', roiManager.markProstate) # Mark Urethra Button self.markUrethraButton = qt.QPushButton("Mark Urethra") self.markUrethraButton.toolTip = "Mark the boundaries of the urethra." self.markUrethraButton.name = "MarkUrethra" roiDefintitionFormLayout.addWidget(self.markUrethraButton) self.markUrethraButton.connect('clicked()', roiManager.markUrethra) # # PET/MR alignment # petMRIAlignmentCollapsibleButton = ctk.ctkCollapsibleButton() petMRIAlignmentCollapsibleButton.text = "PET/MR alignment" self.layout.addWidget(petMRIAlignmentCollapsibleButton) petMRAlignmentFormLayout = qt.QFormLayout( petMRIAlignmentCollapsibleButton) # # Landmarking on histology and PET/MR # landmarksCollapsibleButton = ctk.ctkCollapsibleButton() landmarksCollapsibleButton.text = "Set Landmarks" self.layout.addWidget(landmarksCollapsibleButton) landmarksFormLayout = qt.QFormLayout(landmarksCollapsibleButton) landmarkManager = LandmarkManager(dm) # Set MRI Landmarks Button self.switchToLandmarksLayoutButton = qt.QPushButton( "Switch to Landmarks Layout") self.switchToLandmarksLayoutButton.toolTip = "Switch to Landmarks Layout" self.switchToLandmarksLayoutButton.name = "SwitchToLandmarksLayout" landmarksFormLayout.addWidget(self.switchToLandmarksLayoutButton) self.switchToLandmarksLayoutButton.connect('clicked()', landmarkManager.setLayout) self.setMRILandmarksButton = qt.QPushButton("Set MRI Landmarks") self.setMRILandmarksButton.toolTip = "Set MRI Landmarks" self.setMRILandmarksButton.name = "SetMRILandmarks" landmarksFormLayout.addWidget(self.setMRILandmarksButton) self.setMRILandmarksButton.connect('clicked()', landmarkManager.setLandmarksForMRI) self.finishedMRIButton = qt.QPushButton("Finished MRI") self.finishedMRIButton.toolTip = "Finished MRI Landmarks" self.finishedMRIButton.name = "FinishedMRILandmarks" landmarksFormLayout.addWidget(self.finishedMRIButton) self.finishedMRIButton.connect('clicked()', landmarkManager.setMouseModeBack) # Set Histology Landmarks Button self.setHistoLandmarksButton = qt.QPushButton( "Set Histology Landmarks") self.setHistoLandmarksButton.toolTip = "Set Histology Landmarks" self.setHistoLandmarksButton.name = "SetHistoLandmarks" landmarksFormLayout.addWidget(self.setHistoLandmarksButton) self.setHistoLandmarksButton.connect( 'clicked()', landmarkManager.setLandmarksForHisto) self.finishedHistoButton = qt.QPushButton("Finished Histo") self.finishedHistoButton.toolTip = "Finished MRI Landmarks" self.finishedHistoButton.name = "FinishedMRILandmarks" landmarksFormLayout.addWidget(self.finishedHistoButton) self.finishedHistoButton.connect('clicked()', landmarkManager.setMouseModeBack) # # Registration Optimization # registrationCollapsibleButton = ctk.ctkCollapsibleButton() registrationCollapsibleButton.text = "Optimize Registration" self.layout.addWidget(registrationCollapsibleButton) registrationFormLayout = qt.QFormLayout(registrationCollapsibleButton)