Using qMRMLNodeAttributeTableWidget with qMRMLSegmentEditorWidget

Hello everyone! I am new to 3D Slicer.
I am currently creating a sample extension that allow user add additional information about the segmentation when using segment editor, but i got stuck. I dont know how to mapping the qMRMLNodeAttributeTableWidget with qMRMLSegmentEditorWidget. I will really appreaciate any help.

Sorry if my bad English make you confuse to understand. Have a nice day!

Operating system: Window 11
Slicer version: 5.2.2
Expected behavior: Can perform add/remove attribute name and value for the selected segmentation node from segment editor widget
Actual behavior: Failed to instantiate module

What you describe that you want to do seems quite unusual. To my understanding you want to change node attributes visually for the segment editor node. However, that’s kind of halfway between UI and programming, and would be very error-prone and would require continual lookup of attributes in the source code etc.

Can you please describe what you actually want to achieve from the user’s perspective?

Thank you for your support. I will provide detail what i want to achieve.
Assume that i am a radiologist using 3D slicer to annotate multiple segmentations like this.

However, i want to make more comment for each segmentation label i made by using the [qMRMLNodeAttributeTableWidget], giving some fixed attribute and add the value for them so whenever i re-open the file, i can review it or modify the attribute value i created before. Here is the [qMRMLNodeAttributeTableWidget]

My desired output is like this

Hope you will understand what i am trying to achieve.
Thank you.

Segments are not nodes, so this idea won’t work for individual segments. See this part of the documentation:

The segments do not have attributes, but they have “tags” that can be used for this purpose, see

But there is no table for the tags. Maybe you can look at this class as inspiration:

1 Like

Wonderful! I will check that out. By the way, is it possible to create separate tables like that for each segmentation label map like the sample image below?
P/s: The image is a sample and does not contain any confidential information.

I think you should use split islands and separate these into a segment each. In the default terminology you can specify the same type with left/right modifiers, so you can uniquely identify the structures.

1 Like