Skip to content

Add SlicerTrame extension #2174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Thibault-Pelletier
Copy link
Contributor

New extension

Tier 1

Any extension that is listed in the Extensions Catalog must fulfill these requirements.

  • Repository name is Slicer+ExtensionName (except if the repository that hosts the extension can be also used without Slicer)
  • Repository is associated with 3d-slicer-extension GitHub topic so that it is listed here. To edit topics, click the settings icon in the right side of "About" section header and enter 3d-slicer-extension in "Topics" and click "Save changes". To learn more about topics, read https://help.github.com/en/articles/about-topics
  • Extension description summarizes in 1-2 sentences what the extension is usable (should be understandable for non-experts)
  • Any known related patents must be mentioned in the extension description.
  • LICENSE.txt is present in the repository root and the name of the license is mentioned in extension homepage. We suggest you use a permissive license that includes patent and contribution clauses. This will help protect developers and ensure the code remains freely available. MIT (https://choosealicense.com/licenses/mit/) or Apache (https://choosealicense.com/licenses/apache-2.0/) license is recommended. Read here to learn more about licenses. If source code license is more restrictive for users than MIT, BSD, Apache, or 3D Slicer license then describe the reason for the license choice and include the name of the used license in the extension description.
  • Extension URL and revision (scmurl, scmrevision) is correct, consider using a branch name (main, release, ...) instead of a specific git hash to avoid re-submitting pull request whenever the extension is updated
  • Extension icon URL is correct (do not use the icon's webpage but the raw data download URL that you get from the download button - it should look something like this: https://raw.githubusercontent.com/user/repo/main/SomeIcon.png)
  • Screenshot URLs (screenshoturls) are correct, contains at least one
  • Content of submitted json file is consistent with the top-level CMakeLists.txt file in the repository (dependencies, etc. are the same)
  • Homepage URL points to valid webpage containing the following:
    • Extension name
    • Short description: 1-2 sentences, which summarizes what the extension is usable for
    • At least one nice, informative image, that illustrates what the extension can do. It may be a screenshot.
    • Description of contained modules: at one sentence for each module
    • Publication: link to publication and/or to PubMed reference (if available)
  • Hide unused github features (such as Wiki, Projects, and Discussions, Releases, Packages) in the repository to reduce noise/irrelevant information:
    • Click Settings and in repository settings uncheck Wiki, Projects, and Discussions (if they are currently not used).
    • Click the settings icon next to About in the top-right corner of the repository main page and uncheck Releases and Packages (if they are currently not used)
  • The extension is safe:
    • Does not include or download binaries from unreliable sources
    • Does not send any information anywhere without user consent (explicit opt-in is required)

Tier 3

Community-supported extensions.

  • Extension has a reasonable name (not too general, not too narrow, suggests what the extension is for)
  • Documentation, tutorial, and test data are provided for most modules. A tutorial provides step-by-step description of at least the most typical use case, include a few screenshots. Any sample data sets that is used in tutorials must be registered with the Sample Data module to provide easy access to the user.
  • Follows programming and user interface conventions of 3D Slicer (e.g., GUI and logic are separated, usage of popups is minimized, no unnecessary custom GUI styling, etc.)
  • The extension can be successfully built and packaged on all supported platforms (Windows, macOS, Linux)
  • Maintainers respond to issues and pull request submitted to the extension's repository.
  • Maintainers respond to questions directly addressed to him/her via @mention on the Slicer Forum.
  • Permissive license is used for the main functions of the extension (recommended Apache or MIT). The extension can provide additional functionality in optional components that are distributed with non-permissive license, but the user has to explicitly approve those before using them (e.g., a pop-up can be displayed that explains the licensing terms and the user has to acknowledge them to proceed).
  • All requirements of tiers < 3.

Tier 5

Critically important extensions, supported by Slicer core developers. New Slicer Stable Release is released only if all Tier 5 extension packages are successfully created on all supported platforms.

  • Slicer core developers accept the responsibility of fixing any issues caused by Slicer core changes; at least one Slicer core developer (anyone who has commit right to Slicer core) must be granted commit right to the extension's repository.
  • Automated tests for all critical features.
  • Maintainers respond to questions related to the extension on the Slicer Forum.
  • All requirements of tiers < 5.

@lassoan
Copy link
Contributor

lassoan commented May 18, 2025

This will be awesome, thank you! I'll test this and provide feedback within a few days

@Thibault-Pelletier
Copy link
Contributor Author

Hey @lassoan!
Did you get some time to have a look at the extension?

@jcfr jcfr changed the title ENH: Add SlicerTrame extension Add SlicerTrame extension Jun 9, 2025
@lassoan
Copy link
Contributor

lassoan commented Jun 10, 2025

@Thibault-Pelletier thank you for your patience. The extension looks great. However, I had an installation issue, which prevented me from actually trying it.

I've built the extension, built a package, and installed it from Slicer. However, when I tried to launch it, it did not find vtkWebCore. What I noticed that vtkWebGLExporter.dll was not included in the install package. However, it was still a VTK-9.2 based build, so it was possible that there were some issues due to that, too. I've now updated my build options to use VTK-9.4 and the build is in progress.

A few nitpicks:

  • Installing prerequisites takes a few minutes, would be nicer to ask user confirmation and show a popup (or at least wait cursor until installation is completed).
  • Pre-populate "Server script path" dropdown menu with with examples paths (or at least set the current path to the Examples folder).
  • It would be also nice to include the examples at https://github.com/KitwareMedical/trame-slicer/ - either fetch at runtime (download .zip from github and unzip - SampleData module logic has some convenience functions for that) or fetch the files in the extension superbuild and bundle in the extension package.
  • Set default port to a valid number to make users' life a tiny bit easier (to establish a commonly used port number for SlicerTrame - makes tutorials, demos simpler)

@Thibault-Pelletier
Copy link
Contributor Author

Hi @lassoan,
Thanks for the review!

You are correct, the extension is only compatible with VTK 9.4+ (I was waiting for the Slicer update to go through to submit the extension).
As it's the first time I'm trying to create an extension bringing missing VTK options (vtkWebCore and vtkWebGLExporter) please let me know if you see any problems on your side.

Regarding the port, 0 will provide a new unused port when starting the server, so it should be a good default for users trying the server locally.

I will probably address your other comments next week.

@lassoan
Copy link
Contributor

lassoan commented Jun 11, 2025

After building from scratch with latest Slicer main (VTK-9.4), build and packaging is successful, but the VTK remote modules don't seem to be all included/placed in the right location in the installation package. When installing the package and attempting to start SlicerTrame, I get this error:

if "Server script path" does not exist then no message is displayed

qSlicerMarkupsModulePrivate::addToolBar: no main window is available, toolbar is not added

qSlicerSequencesModulePrivate::addToolBar: no main window is available, toolbar is not added

Loading Slicer RC file [C:/Users/andra/.slicerrc.py]

Traceback (most recent call last):

  File "<string>", line 5, in <module>
  File "<string>", line 14, in <module>
  File "C:\D\S4R\python-install\Lib\site-packages\trame_slicer\rca_view\__init__.py", line 3, in <module>
    from .rca_view_factory import (
  File "C:\D\S4R\python-install\Lib\site-packages\trame_slicer\rca_view\rca_view_factory.py", line 8, in <module>
    from trame_rca.utils import RcaEncoder, RcaRenderScheduler, RcaViewAdapter
  File "C:\D\S4R\python-install\Lib\site-packages\trame_rca\utils.py", line 22, in <module>

    from vtkmodules.vtkWebCore import vtkRemoteInteractionAdapter
ModuleNotFoundError: No module named 'vtkmodules.vtkWebCore'

@jcfr could you help with this? It should work very similarly to the VirtualReality extension's VTK module build.

@Thibault-Pelletier
Copy link
Contributor Author

@lassoan thanks for your feedbacks.
I just pushed a fix for the vtkWebGLExporter which was not packaged correctly (and also added some feedback for the install step / example donwload as well).

Packaging the extension and using the packaged .zip file should work now.
I'm not sure the path to the pyd file is updaetd in the install tree though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants