Skip to content

Add LabelNameGenerator extension metadata #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 10 commits into
base: main
Choose a base branch
from

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: LabelNameGenerator.


Extension Overview

LabelNameGenerator 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-LabelNameGenerator
License: MIT
Category: Segmentation


Checklist for Tier 1 (All Completed)

  • Repository follows naming convention: Slicer-LabelNameGenerator
  • Extension has license: MIT
  • README, icon, and basic documentation provided
  • Extension metadata file (.s4ext) is complete
  • LabelNameGenerator.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.

- Removed non-schema fields (extension_id, author, description, etc.)
- Added $schema and tier
- Ensured metadata matches required structure for Tier 1 extension
@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.

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