Skip to content

Commit

Permalink
ENH: Update ScreenCapture module renaming "Animation mode" to "Captur…
Browse files Browse the repository at this point in the history
…e mode"

Improve terminology replacing the previous "Animation mode" with the more
intuitive "Capture mode.". Additionally, the default "none" animation mode
has been relabeled as "single frame".

This change aims to streamline user decision-making by adopting a more descriptive
default capture mode.

Suggested-by: James Butler <james.butler@revvity.com>
Suggested-by: Steve Pieper <pieper@isomics.com>
  • Loading branch information
jcfr committed Nov 17, 2023
1 parent 9d3d1a1 commit bcbd166
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
11 changes: 6 additions & 5 deletions Docs/user_guide/modules/screencapture.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ This module is for creating videos, image sequences, or lightbox image from 3D a

### Input

- **Main view:** This view will be changed during the animation (rotated, sweeped, etc.).
- **Capture all views:** If enabled then all the view in the view layout will be captured. If disabled then only the main view will be captured. By capturing all views, it is possible to see the animated view (such as a moving slice) in 3D and in other slice views.
- **Animation mode:** specifies how the main view will be modified during capture.
- **Main view:** This view is used for capturing (rotated, sweeped, etc.).
- **Capture all views:** When enabled, all views in the layout will be captured. Otherwise, only the main view is captured. By capturing all views, it is possible to see the animated view (such as a moving slice) in 3D and in other slice views.
- **Capture mode:** specifies how the main view will be modified during capture.
- **single frame:** Acquire a single frame of selected main view or all views if "Capture all views" is enabled.
- **3D rotation:** Acquire video of a rotating 3D view. For smooth repeated display of a 360-degree rotation it is recommended to choose 31 or 61 as "Number of images".
- **slice sweep:** Acquire video while going through selected range of image frames (for slice viewer only).
- **slice fade:** Acquire video while fading between the foreground and background image (for slice viewer only).).
Expand Down Expand Up @@ -39,7 +40,7 @@ This module is for creating videos, image sequences, or lightbox image from 3D a
![lightbox image](https://github.com/Slicer/Slicer/releases/download/docs-resources/module_screencapture_lightbox.png)
- **Number of images:** Defines how many frames are generated in the specified range. Higher number results in smoother animation but larger video file. If **single** option is enabled then a single image is captured (and counter in the filename is automatically incremented, therefore it can be used to acquire many screenshots manually).
- **Number of images:** Defines how many frames are generated in the specified range. Higher number results in smoother animation but larger video file. If **single frame** capture mode is selected then a single image is captured (and counter in the filename is automatically incremented, therefore it can be used to acquire many screenshots manually).
- **Output directory:** Output image or video will be saved in this directory.
- **Output file name:** Output file name for video and lightbox.
- **Video format:**
Expand Down Expand Up @@ -67,7 +68,7 @@ This module is for creating videos, image sequences, or lightbox image from 3D a
- **Image file name pattern:** Defines image file naming pattern. `%05d` will be replaced by the image number (5 numbers, padded with zeros). This is only used if image series output is selected.
- **Lightbox image columns:** Number of columns in the generated lighbox image.
- **Maximum number of images:** Specifies the maximum range of the "number of images" slider. Useful for creating very long animations.
- **Output volume node:** If a single image output is selected then the output can be saved into the selected volume node.
- **Output volume node:** If "single frame" capture mode is selected then the output can be saved into the selected volume node.
- **View controllers:** Show view controllers. If unchecked then view controllers will be temporarily hidden during screen capture.
- **Transparent background:** If checked then images will be captured with transparent background.
- **Watermark image:** Adds a watermark image to the captured images.
Expand Down
14 changes: 7 additions & 7 deletions Modules/Scripted/ScreenCapture/ScreenCapture.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def setup(self):
self.viewNodeSelector.showChildNodeTypes = False
self.viewNodeSelector.setMRMLScene(slicer.mrmlScene)
self.viewNodeSelector.setToolTip(_("This slice or 3D view will be updated during capture."
"Only this view will be captured unless 'Capture of all views' option in output section is enabled."))
"Only this view will be captured unless 'Capture all views' option is enabled."))
inputFormLayout.addRow(_("Main view: "), self.viewNodeSelector)

self.captureAllViewsCheckBox = qt.QCheckBox(" ")
Expand All @@ -96,8 +96,8 @@ def setup(self):

# Mode
self.animationModeWidget = qt.QComboBox()
self.animationModeWidget.setToolTip(_("Select the property that will be adjusted"))
inputFormLayout.addRow(_("Animation mode:"), self.animationModeWidget)
self.animationModeWidget.setToolTip(_("Specify how the main view will be modified during capture."))
inputFormLayout.addRow(_("Capture mode:"), self.animationModeWidget)

# Slice start offset position
self.sliceStartOffsetLabel = qt.QLabel(_("Start sweep offset:"))
Expand Down Expand Up @@ -470,7 +470,7 @@ def onShowCreatedOutputFile(self):
def updateOutputType(self, selectionIndex=0):
outputType = self.outputTypeWidget.currentData
forceSingleImage = False
if self.animationModeWidget.currentData == "NONE":
if self.animationModeWidget.currentData == "SINGLE_FRAME":
outputType = "IMAGE_SERIES"
forceSingleImage = True

Expand Down Expand Up @@ -534,11 +534,11 @@ def updateViewOptions(self):

self.animationModeWidget.clear()
if self.viewNodeType == VIEW_SLICE:
self.animationModeWidget.addItem(_("none"), "NONE")
self.animationModeWidget.addItem(_("single frame"), "SINGLE_FRAME")
self.animationModeWidget.addItem(_("slice sweep"), "SLICE_SWEEP")
self.animationModeWidget.addItem(_("slice fade"), "SLICE_FADE")
if self.viewNodeType == VIEW_3D:
self.animationModeWidget.addItem(_("none"), "NONE")
self.animationModeWidget.addItem(_("single frame"), "SINGLE_FRAME")
self.animationModeWidget.addItem(_("3D rotation"), "3D_ROTATION")
if sequencesModuleAvailable:
self.animationModeWidget.addItem(_("sequence"), "SEQUENCE")
Expand Down Expand Up @@ -668,7 +668,7 @@ def onCaptureButton(self):
videoOutputRequested = (self.outputTypeWidget.currentData == "VIDEO")
viewNode = self.viewNodeSelector.currentNode()
numberOfSteps = int(self.numberOfStepsSliderWidget.value)
if self.animationModeWidget.currentData == "NONE":
if self.animationModeWidget.currentData == "SINGLE_FRAME":
numberOfSteps = 1
if numberOfSteps < 2:
# If a single image is selected
Expand Down

0 comments on commit bcbd166

Please sign in to comment.