Skip to content

Add SegTemplateEditor extension #2171

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 11 commits into
base: main
Choose a base branch
from
Open

Conversation

esheo-skia
Copy link

@esheo-skia esheo-skia commented May 7, 2025

This pull request adds the metadata for a new 3D Slicer extension: SegTemplateEditor.


Extension Overview

SegTemplateEditor is a simple extension that allows users to:

  • Create and save custom label groups for segmentation
  • Apply visually distinct colors to each label using golden-ratio hue stepping
  • Load, reuse, and apply label groups via GUI
  • Automatically apply selected groups to the Segment Editor

Repository: https://github.com/esheo-skia/Slicer-SegTemplateEditor
License: MIT
Category: Segmentation


Checklist for Tier 1 (All Completed)

  • Repository follows naming convention: Slicer-SegTemplateEditor
  • Extension has license: MIT
  • README, icon, and basic documentation provided
  • Extension metadata file (.s4ext) is complete
  • SegTemplateEditor.json has been added
  • scmrevision uses main (not a specific commit hash)
  • Public GitHub repository is accessible
  • Icon URL uses raw format and is accessible
  • Screenshot URLs added
  • Extension does not include or download binaries, and does not send data
  • GitHub wiki, projects, and discussions have been disabled

All CircleCI checks have passed and the repository satisfies all Tier 1 requirements.
Looking forward to review and feedback from the core team.

@LenaGiebeler
Copy link

Hi, my name is Lena, a computer science student working with Andrey Fedorov (@fedorov). I am currently working on an extension of the Segmentation Verification module. During development, we came across your module and gave it a try. First of all, thank you for making it available! I wanted to share some feedback and suggestions that might be helpful if you're planning future updates.

One thing we found a bit challenging was understanding the intended functionality of the module based on the current documentation. It would be great if the README could provide a bit more context about the purpose and capabilities of the module — that would make it easier for new users to get started.

In our experience, the segment names weren’t preserved when we applied the selected group — instead, segments were automatically named “Segment_1”, “Segment_2”, etc., without the original label names. It's possible we missed something, but this made it hard to track specific structures. Also, since the colors are randomly assigned, some ended up being very similar, which made distinguishing them visually a bit difficult. Perhaps colors could be chosen to be more distinct by default?
Label Names we wanted to add
Missing Structure Names 2
Label names we got; The shades of green look very similar
Missing Structure Names

Another issue we encountered was that a new segmentation was created even when no volume was loaded, which didn’t behave as expected. Also, when using the Segment Editor, regardless of which segmentation is selected, new segments always seem to be added to the same segmentation node.
It seems like a Volume is created when no Volume is loaded beforehand. When you load a volume afterwards you can switch between both volumes
Missing Volume
Switching back and forth between volumes enables the add button although no correct volume is selected
Missing Volume 2

One of the advantages of creating a segmentation directly using the Segment Editor (in combination with the Terminologies module) is that it allows users to create segmentations with standardized metadata — which is particularly important when exporting segmentations to DICOM.
It might be helpful if your module could recognize matching segment names and, when a match is found, automatically apply the corresponding color and metadata from the terminology database. This would make the module especially valuable for workflows involving DICOM export.

Terminology 2
Terminology

If you consider adding that feature, it might also be worthwhile to create a Terminology JSON File instead of a JSON file only containing name and color (Terminologies)

Thank you again for your work on this module!
Best regards,
 Lena

@esheo-skia
Copy link
Author

esheo-skia commented May 8, 2025 via email

@esheo-skia
Copy link
Author

Hi @jcfr, this PR is now ready for review!

The extension structure has been finalized, and the previously included labels.json file has been removed.
Let me know if there’s anything else I should update. Thanks a lot for your time!

@esheo-skia
Copy link
Author

Hi @jcfr,

I've removed the .gitignore file and all CI checks have now passed (including check-filenames).
Could you please approve the workflow so it can proceed?

Thanks again for your time!

@esheo-skia
Copy link
Author

Hi @jcfr,

The pre-commit hook is currently failing due to check-jsonschema not recognizing the structure of LabelNameGenerator.json.

This file follows the Slicer extension metadata format, which is consistent with other accepted entries in the ExtensionsIndex. Since it's not intended to comply with a general JSON schema and $schema is not required in this context, the failure appears to be a false positive.

All other checks have passed successfully.
Would you be able to approve the PR despite this schema check? Thank you!

@jamesobutler
Copy link
Contributor

It appears LabelNameGenerator is not following the JSON schema defined for the Slicer extensions index. See for example recently accepted extension:

{
"$schema": "https://raw.githubusercontent.com/Slicer/Slicer/main/Schemas/slicer-extension-catalog-entry-schema-v1.0.1.json#",
"build_dependencies": [],
"build_subdirectory": ".",
"category": "Segmentation",
"scm_revision": "main",
"scm_url": "https://github.com/coendevente/SlicerNNInteractive.git",
"tier": 3
}

@lassoan
Copy link
Contributor

lassoan commented May 18, 2025

I would add that the new color table feature in recent Slicer Preview Releases allow users to define a text file (in CSV format) that describes a list of segments (name, color, label value, terminology codes). The user can choose the color table in the terminology selector (when double-clicking on a segment name or color) and easily choose a label from there. This may offer a better user experience than a separate module.

That said, a module like yours could be still useful in automatically generating colors and offer other tools that make creating and editing color tables (or as you call them "segment groups") more convenient.

@esheo-skia
Copy link
Author

I would add that the new color table feature in recent Slicer Preview Releases allow users to define a text file (in CSV format) that describes a list of segments (name, color, label value, terminology codes). The user can choose the color table in the terminology selector (when double-clicking on a segment name or color) and easily choose a label from there. This may offer a better user experience than a separate module.

That said, a module like yours could be still useful in automatically generating colors and offer other tools that make creating and editing color tables (or as you call them "segment groups") more convenient.

Thank you @lassoan for the insightful suggestion!

Indeed, the color table feature via CSV + terminology selector is very convenient — I’ll definitely consider integrating it or aligning the UX with that approach in the future.

For now, LabelNameGenerator aims to offer quick label group management with automatic color assignment, but I really appreciate your input and will keep refining the concept based on your feedback.

@esheo-skia
Copy link
Author

Hi @jamesobutler @lassoan,
Just wanted to follow up on this PR — it’s been a little over a week since submission.
Please let me know if there’s anything further I should address. Appreciate your time!

@lassoan
Copy link
Contributor

lassoan commented Jun 2, 2025

I would be OK with getting this extension added to the extensions index as tier 1, but before doing that we should make sure that the name is good (because later it is much more complicated to change the name). As far as I can tell, the extension is not for generating label names. Instead, it helps with generating and managing color tables (set of preconfigured segments the user can choose from). If we want to be a bit more generic then we could say it helps creating segmentation templates. Could you think of names that better reflect what the extension does (and aspires to do)?

@esheo-skia
Copy link
Author

I would be OK with getting this extension added to the extensions index as tier 1, but before doing that we should make sure that the name is good (because later it is much more complicated to change the name). As far as I can tell, the extension is not for generating label names. Instead, it helps with generating and managing color tables (set of preconfigured segments the user can choose from). If we want to be a bit more generic then we could say it helps creating segmentation templates. Could you think of names that better reflect what the extension does (and aspires to do)?

Thank you for the thoughtful feedback!

Based on your suggestion, I'm considering renaming the extension to SegSetTemplater, since it more accurately reflects what the extension does (and aims to do in the future).

The tool helps users define, reuse, and apply groups of segments with preassigned names and colors — effectively acting as reusable templates for segmentation workflows. As it evolves, I’d also like to support import/export in CSV color table format and template sharing between users.

Does the name “SegSetTemplater” sound appropriate to you, or would you suggest an alternative?
Happy to update accordingly!

@esheo-skia
Copy link
Author

Hi @lassoan, just a gentle follow-up regarding the proposed name change to SegSetTemplater.

If the name looks good to you, I’ll go ahead and update the extension name and related files accordingly.

Thanks again for your time and guidance!

@lassoan
Copy link
Contributor

lassoan commented Jun 5, 2025

SegSetTemplater is much better, but not yet sufficiently self-explaining. The Set part I don't understand, probably we can skip. Something like SegmentationTemplates, SegmentationTemplateEditor, SegTemplateEditor, SegTemplateUtil etc. would be better.

@esheo-skia
Copy link
Author

SegSetTemplater is much better, but not yet sufficiently self-explaining. The Set part I don't understand, probably we can skip. Something like SegmentationTemplates, SegmentationTemplateEditor, SegTemplateEditor, SegTemplateUtil etc. would be better.

Thanks for the feedback, @lassoan!
I’ll proceed with the name change to SegTemplateEditor as suggested.
Will update the extension name and all related files accordingly.

@esheo-skia esheo-skia changed the title Add LabelNameGenerator extension metadata Add SegTemplateEditor extension metadata Jun 9, 2025
@esheo-skia
Copy link
Author

Hi @lassoan,

The extension has been fully renamed to SegTemplateEditor as discussed:

  • Repository name updated: Slicer-SegTemplateEditor
  • All folder and file names updated (e.g., SegTemplateEditor.s4ext, icons, screenshots)
  • All metadata and references revised (including .s4ext, README, JSON entry)

PR description, filenames, and repository structure are now fully aligned.

Thanks again for your feedback. Let me know if there's anything else I should adjust!

@jcfr jcfr changed the title Add SegTemplateEditor extension metadata Add SegTemplateEditor extension Jun 10, 2025
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.

4 participants