diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b043447..584e7cf9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,9 @@ # Changelog -## v24.0.2 +## v24.1.0 Enhancements: + - Add option to edit help text #441 - Update corner annotation with axis label #433 - Add title to ViewerCoordsDockWidget #422 - Adds methods to CILviewer and CILviewer2D #425 diff --git a/Wrappers/Python/ccpi/viewer/CILViewer.py b/Wrappers/Python/ccpi/viewer/CILViewer.py index 14babf21..5ac166fb 100644 --- a/Wrappers/Python/ccpi/viewer/CILViewer.py +++ b/Wrappers/Python/ccpi/viewer/CILViewer.py @@ -36,6 +36,7 @@ def __init__(self, callback): self.AddObserver('LeftButtonReleaseEvent', self.OnLeftMouseRelease) #self.AddObserver('RightButtonPressEvent', self.OnRightMousePress, -0.5) #self.AddObserver('RightButtonReleaseEvent', self.OnRightMouseRelease, -0.5) + self.htext = None def GetSliceOrientation(self): return self._viewer.sliceOrientation @@ -323,7 +324,7 @@ def DisplayHelp(self): self.Render() return - font_size = 24 + font_size = 16 # Create the text mappers and the associated Actor2Ds. @@ -340,25 +341,27 @@ def DisplayHelp(self): # The text is on multiple lines and center-justified (both horizontal and # vertical). textMapperC = vtk.vtkTextMapper() - textMapperC.SetInput("Mouse Interactions:\n" - "\n" - " - Slice: Mouse Scroll\n" - " - Zoom: Right Mouse + Move Up/Down\n" - " - Pan: Middle Mouse Button + Move or Shift + Left Mouse + Move\n" - " - Adjust Camera: Left Mouse + Move\n" - " - Rotate: Ctrl + Left Mouse + Move\n" - "\n" - "Keyboard Interactions:\n" - "\n" - "h: Display this help\n" - "x: YZ Plane\n" - "y: XZ Plane\n" - "z: XY Plane\n" - "r: Save render to current_render.png\n" - "s: Toggle visibility of slice\n" - "v: Toggle visibility of volume render\n" - "c: Activates volume render clipping plane widget\n" - "a: Whole image Auto Window/Level\n") + if self.htext == None: + self.htext = """ +Mouse Interactions: + - Slice: Mouse Scroll + - Zoom: Right Mouse + Move Up/Down + - Pan: Middle Mouse Button + Move or Shift + Left Mouse + Move + - Adjust Camera: Left Mouse + Move + - Rotate: Ctrl + Left Mouse + Move + +Keyboard Interactions: + h: Display this help + x: YZ Plane + y: XZ Plane + z: XY Plane + r: Save render to current_render.png + s: Toggle visibility of slice + v: Toggle visibility of volume render + c: Activates volume render clipping plane widget + a: Whole image Auto Window/Level + """ + textMapperC.SetInput(self.htext) tprop = textMapperC.GetTextProperty() tprop.ShallowCopy(multiLineTextProp) tprop.SetJustificationToLeft() diff --git a/Wrappers/Python/ccpi/viewer/CILViewer2D.py b/Wrappers/Python/ccpi/viewer/CILViewer2D.py index 90be5929..6c656520 100644 --- a/Wrappers/Python/ccpi/viewer/CILViewer2D.py +++ b/Wrappers/Python/ccpi/viewer/CILViewer2D.py @@ -49,6 +49,7 @@ def __init__(self, callback): self.dy = 0 self._reslicing_enabled = True + self.htext = None @property def reslicing_enabled(self): @@ -896,7 +897,7 @@ def DisplayHelp(self): self.Render() return - font_size = 24 + font_size = 16 # Create the text mappers and the associated Actor2Ds. @@ -913,33 +914,36 @@ def DisplayHelp(self): # The text is on multiple lines and center-justified (both horizontal and # vertical). textMapperC = vtk.vtkTextMapper() - textMapperC.SetInput("Mouse Interactions:\n" - "\n" - " - Slice: Mouse Scroll\n" - " - Quick Slice: Shift + Mouse Scroll\n" - " - Pick: Left Click\n" - " - Zoom: Shift + Right Mouse + Move Up/Down\n" - " - Pan: Ctrl + Right Mouse + Move\n" - " - Adjust Window: Alt+ Right Mouse + Move Up/Down\n" - " - Adjust Level: Alt + Right Mouse + Move Left/Right\n" - " Region of Interest (ROI):\n" - " - Create: Ctrl + Left Click\n" - " - Delete: Alt + Left Click\n" - " - Resize: Click + Drag handles\n" - " - Translate: Middle Mouse + Move within ROI\n" - "\n" - "Keyboard Interactions:\n" - "\n" - " - a: Whole image Auto Window/Level\n" - " - w: Region around cursor Auto Window/Level\n" - " - l: Line Profile at cursor\n" - " - s: Save Current Image\n" - " - x: YZ Plane\n" - " - y: XZ Plane\n" - " - z: XY Plane\n" - " - t: Tracing\n" - " - i: toggle interpolation of slice\n" - " - h: this help\n") + if self.htext == None: + self.htext = """ + Mouse Interactions: + - Slice: Mouse Scroll + - Quick Slice: Shift + Mouse Scroll + - Pick: Left Click + - Zoom: Shift + Right Mouse + Move Up/Down + - Pan: Ctrl + Right Mouse + Move + - Adjust Window: Alt+ Right Mouse + Move Up/Down + - Adjust Level: Alt + Right Mouse + Move Left/Right + + Region of Interest (ROI): + - Create: Ctrl + Left Click + - Delete: Alt + Left Click + - Resize: Click + Drag handles + - Translate: Middle Mouse + Move within ROI + + Keyboard Interactions: + h: This help + x: YZ Plane + y: XZ Plane + z: XY Plane + a: Whole image Auto Window/Level + w: Region around cursor Auto Window/Level + l: Line Profile at cursor + s: Save Current Image + t: Tracing + i: Toggle interpolation of slice + """ + textMapperC.SetInput(self.htext) tprop = textMapperC.GetTextProperty() tprop.ShallowCopy(multiLineTextProp) tprop.SetJustificationToLeft()