Skip to content

SoniaPujolLab/SlicerTutorialMaker

Repository files navigation

Slicer Tutorial Maker

The Slicer Tutorial Maker is an extension for 3D Slicer that streamlines the creation of illustrated tutorials in multiple languages. It automates screenshot capture, provides a visual annotation editor, and exports finished tutorials to HTML and Markdown formats.

Documentação em Português Documentación en español


Table of Contents

  1. Installation: Extension Manager
  2. Installation: Manual / Developer
  3. How to Use Tutorial Maker
  4. Annotation Tool
  5. Developer Mode
  6. Writing Tutorials
  7. Uninstallation

Installation: Extension Manager

  1. Install 3D Slicer 5.10.0 or the latest stable release.
  2. Open the Extension Manager and search for TutorialMaker.

    TutorialMakerAnnotation

  3. Click Install, then restart Slicer when prompted.

    Restart prompt

  4. Continue to How to Use Tutorial Maker.

Installation: Manual / Developer

Follow these steps to use the latest development version before it appears in the Extension Manager build (published every morning around 9 AM EST).

Warning

We strongly recommend keeping Developer Mode disabled unless you are actively developing the extension. Developer Mode exposes experimental features that may cause instability.

  1. Install the 3D Slicer Stable Release or Preview Release.
  2. Open the TutorialMaker repository on GitHub.
  3. Click the green Code button and select Download ZIP to download TutorialMaker.zip.
  4. Extract the archive to obtain the TutorialMaker-main directory.

Windows

  1. Start 3D Slicer.
  2. Drag and drop the TutorialMaker folder onto the Slicer application window.
  3. In the Select a reader dialog, choose Add Python scripted modules to the application and click OK.
  4. When asked to load the Tutorial Maker module, click Yes.

TutorialMakerInstall

macOS / Linux

  1. Start 3D Slicer.
  2. Go to Edit → Application Settings → Modules.
  3. In the Additional module paths field, drag and drop the file TutorialMaker.py found inside the TutorialMaker-main/TutorialMaker/ directory.
  4. Click OK and restart Slicer.

TutorialMakerInstallMac


How to Use Tutorial Maker

1. Select a Tutorial

Open the Tutorial Maker module from the Utilities category in the Slicer module selector.

Module selector

Important

Before capturing screenshots, switch Slicer to Full-Screen mode and set the application font size to 14 pt to ensure the screenshots are easy to read.

Select the desired tutorial from the list, for example FourMinuteTutorial.

Tutorial list


2. Capture Screenshots

Click Capture Screenshots. A preparation dialog will appear before the capture begins.

Capture Screenshots: preparation dialog

The Screenshot Capture Environment Setup dialog offers three options:

Option Default Description
Save current scene data Off Opens the Save Data dialog so you can preserve your work before the scene is cleared.
Maximize 3D Slicer window for screen capture On Ensures consistent screenshot dimensions across all slides.
Close Python console and Error Log window On Hides developer panels for cleaner screenshots.

Warning

The current scene will always be cleared before capture begins, regardless of the options chosen.

Click OK to proceed. A progress dialog will track each capture step and ask you not to interact with Slicer until the capture is complete.

Screenshot capture progress dialog

When the capture finishes, Slicer returns to the Tutorial Maker module and displays a confirmation:

Screenshot Capture Completed: Captured Tutorial: <tutorial name>


3. Annotate Your Tutorial

After capturing screenshots, the panel shows two buttons side by side:

Button Behavior
Edit Annotations Opens the Annotator with no annotations loaded. Use this button to start annotating from scratch or to discard all previous work.
Resume Annotations Opens the Annotator and automatically reloads the most recently saved annotations.json file for the selected tutorial. Use this button to continue work from a previous session.

Edit Annotations and Resume Annotations buttons

Resume Annotations: annotator opening with saved annotations

Note

Edit Annotations is enabled as soon as a tutorial is selected. Resume Annotations is only enabled when an annotations.json file already exists for the selected tutorial (i.e., you have saved at least once). When enabled, it restores all annotations (labels, positions, styles, slide titles and descriptions) exactly as you left them.


4. Generate Tutorial Output

After saving your annotations, click Generate Tutorial to produce the final HTML and Markdown files.

Generate Tutorial button

If no annotations file is found, you will see a warning:

No Annotations Found: You don't have any annotations to export. Please annotate your screenshots first using "Edit Annotations".

When generation completes successfully, Slicer opens the output folder automatically and displays a confirmation:

Tutorial Generated: Generated Tutorial: <tutorial name>

Output folder opened in File Explorer

Generated HTML output in browser


Annotation Tool

The Annotator window opens as a separate modal window.

The thumbnail strip on the left displays all captured slides. Click any thumbnail to select it.

Annotator window: full layout overview

Editing slide content

On regular screenshot slides, you can edit the Title and Description fields at the top of the panel at any time during the annotation session.

Slide title and description fields

Special slides (such as the Cover Slide) do not have Title and Description fields. Instead, they contain pre-made annotations (author, date, description, etc.) that you can select and edit directly on the slide canvas.

Editing cover slide premade annotations

Adding annotations

  1. Select an annotation tool from the toolbar (Rectangle, Arrow, Text, etc.).

    Annotation toolbar

  2. Choose the annotation style (color, font size, line thickness).

    Annotation style options

  3. Click on the slide area where you want to place the annotation and type the label.

    Placing a rectangle annotation

Saving

Click the Save button in the toolbar to save annotations to Outputs/Annotations/<tutorial name>/annotations.json inside the extension installation folder.

Save button in toolbar

Note

When closing the Annotator, a dialog will ask whether you want to Save, Discard, or Cancel unsaved changes.

Layout customization

You can resize or rearrange panels by dragging the dividers.

Dragging panel dividers to rearrange layout


Keyboard Shortcuts

The following keyboard shortcuts are available while the Annotator window is in focus:

Key Action
Del Deletes the selected annotation.
Esc Deselects the current annotation without deleting it.
Shift + click Places an annotation and keeps the same tool active, allowing you to add multiple annotations in quick succession without reselecting the tool.

Shift+click to place multiple annotations in succession


Developer Mode

If Developer Mode is enabled in Slicer (Edit → Application Settings → Developer → Enable developer mode), additional options will appear in the Tutorial Maker panel.

Developer Mode extra options

  • Fetch From GitHub: Downloads tutorial scripts directly from a curated list of external repositories. Currently disabled by default to avoid issues with GitHub API rate limits.
  • Tutorial Creation Tools: Assists in developing new tutorials by automatically recording widget names and paths.

Warning

Developer Mode features are experimental and may cause instability. We strongly recommend keeping Developer Mode disabled for routine tutorial creation.


Writing Tutorials

For guidance on developing your own tutorial scripts, follow the templates and examples available at the SlicerTutorialMakerCollection.


Uninstallation

Via Extension Manager (recommended)

  1. In 3D Slicer, open View → Extension Manager (or the Extensions Manager button in the toolbar).
  2. Switch to the Installed Extensions tab.
  3. Locate TutorialMaker in the list.
  4. Click the Uninstall (trash / remove) button next to the extension.
  5. Restart 3D Slicer when prompted to complete the removal.

Uninstalling via Extension Manager

Manual removal (developer / source installation)

If you installed the extension by adding it to the Additional module paths, follow these steps:

  1. Open Edit → Application Settings → Modules.
  2. In the Additional module paths list, select the entry pointing to the TutorialMaker folder (or TutorialMaker.py).
  3. Click the Remove (minus) button to delete the path entry.
  4. Click OK and restart 3D Slicer.
  5. After restarting, you can safely delete the TutorialMaker-main directory from your file system.

Note

Removing the module path only unregisters the extension in Slicer. You must manually delete the source folder from disk to remove all files.

Removing generated output files

Tutorial output files (screenshots, annotations, HTML and Markdown) are stored inside the extension installation folder under TutorialMaker/Outputs/. These files are not removed automatically. Delete the Outputs/ directory manually if you no longer need them.

About

This is an extension for 3D Slicer that contain tools for creating tutorials that can be automatically translated to multiple languages.

Topics

Resources

License

Stars

2 stars

Watchers

4 watching

Forks

Contributors