Esempio n. 1
0
 def addSideBySideSliceAnnotations(self):
   self.removeSliceAnnotations()
   kwargs = {"yPos":55 if ModuleWidgetMixin.isQtVersionOlder() else 80, "size":30}
   self.sliceAnnotations.append(SliceAnnotation(self.redWidget, constants.LEFT_VIEWER_SLICE_ANNOTATION_TEXT, **kwargs))
   self.sliceAnnotations.append(SliceAnnotation(self.yellowWidget, constants.RIGHT_VIEWER_SLICE_ANNOTATION_TEXT, **kwargs))
   self.addNewImageAnnotation(self.yellowWidget, constants.RIGHT_VIEWER_SLICE_NEEDLE_IMAGE_ANNOTATION_TEXT)
   self.addOldImageAnnotation(self.yellowWidget, constants.RIGHT_VIEWER_SLICE_TRANSFORMED_ANNOTATION_TEXT)
   self.addRegistrationResultStatusAnnotation(self.yellowWidget)
Esempio n. 2
0
 def _addMissingPreopDataAnnotation(self, widget):
     self._removeMissingPreopDataAnnotation()
     self.noPreopSegmentationAnnotation = SliceAnnotation(
         widget,
         constants.MISSING_PREOP_ANNOTATION_TEXT,
         opacity=0.7,
         color=(1, 0, 0))
Esempio n. 3
0
 def addZFrameInstructions(self, step=1):
   self.removeZFrameInstructionAnnotation()
   self.zFrameStep = step
   text = ProstateAblationConstants.ZFrame_INSTRUCTION_STEPS[self.zFrameStep]
   self.zFrameInstructionAnnotation = SliceAnnotation(self.redWidget, text, yPos=55, horizontalAlign="center",
                                                      opacity=0.6, color=(0,0.6,0))
   self.zFrameClickObserver = self.redSliceViewInteractor.AddObserver(vtk.vtkCommand.LeftButtonReleaseEvent,
                                                     self.onZFrameStepAccomplished)
Esempio n. 4
0
 def addFourUpSliceAnnotations(self):
   self.removeSliceAnnotations()
   if not (self.currentResult.skipped or (self.session.seriesTypeManager.isCoverProstate(self.currentResult.name) and
                                            not self.session.data.usePreopData)):
     self.sliceAnnotations.append(SliceAnnotation(self.redWidget, constants.RIGHT_VIEWER_SLICE_ANNOTATION_TEXT,
                                                  yPos=50 if ModuleWidgetMixin.isQtVersionOlder() else 75, size=20))
     self.addNewImageAnnotation(self.redWidget, constants.RIGHT_VIEWER_SLICE_NEEDLE_IMAGE_ANNOTATION_TEXT, size=15)
     self.addOldImageAnnotation(self.redWidget, constants.RIGHT_VIEWER_SLICE_TRANSFORMED_ANNOTATION_TEXT, size=15)
   self.addRegistrationResultStatusAnnotation(self.redWidget)
Esempio n. 5
0
 def addRegistrationResultStatusAnnotation(self, widget):
   annotationText = None
   if self.currentResult.approved:
     annotationText = constants.APPROVED_RESULT_TEXT_ANNOTATION
   elif self.currentResult.rejected:
     annotationText = constants.REJECTED_RESULT_TEXT_ANNOTATION
   elif self.currentResult.skipped:
     annotationText = constants.SKIPPED_RESULT_TEXT_ANNOTATION
   if annotationText:
     self.sliceAnnotations.append(SliceAnnotation(widget, annotationText, yPos=20, size=15))
 def addSliceAnnotations(self):
     self.removeSliceAnnotations()
     widgets = [self.yellowWidget] if self.layoutManager.layout == constants.LAYOUT_SIDE_BY_SIDE else \
       [self.redWidget, self.yellowWidget, self.greenWidget]
     for widget in widgets:
         self.sliceAnnotations.append(
             SliceAnnotation(widget,
                             "Targeting Mode",
                             opacity=0.5,
                             verticalAlign="top",
                             horizontalAlign="center"))
Esempio n. 7
0
  def enableTargetMovingMode(self):
    self.clearTargetMovementObserverAndAnnotations()
    targetName = self.targetTableModel.targetList.GetNthFiducialLabel(self.currentlyMovedTargetModelIndex.row())

    widgets = [self.yellowWidget] if self.layoutManager.layout == constants.LAYOUT_SIDE_BY_SIDE else \
                 [self.redWidget, self.yellowWidget, self.greenWidget]
    for widget in widgets:
      sliceView = widget.sliceView()
      interactor = sliceView.interactorStyle().GetInteractor()
      observer = interactor.AddObserver(vtk.vtkCommand.LeftButtonReleaseEvent, self.onViewerClickEvent)
      sliceView.setCursor(qt.Qt.CrossCursor)
      annotation = SliceAnnotation(widget, "Target Movement Mode (%s)" % targetName, opacity=0.5,
                                   verticalAlign="top", horizontalAlign="center")
      self.mouseReleaseEventObservers[widget] = (observer, annotation)
    self.moveTargetMode = True
Esempio n. 8
0
 def addOldImageAnnotation(self, widget, text, size=20):
   self.oldImageAnnotation = SliceAnnotation(widget, text, yPos=35 if ModuleWidgetMixin.isQtVersionOlder() else 45,
                                             size=size)
   self.sliceAnnotations.append(self.oldImageAnnotation)
Esempio n. 9
0
 def addNewImageAnnotation(self, widget, text, size=20):
   self.newImageAnnotation = SliceAnnotation(widget, text, yPos=35 if ModuleWidgetMixin.isQtVersionOlder() else 45,
                                             opacity=0.0, color=(0, 0.5, 0), size=size)
   self.sliceAnnotations.append(self.newImageAnnotation)