Skip to content
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

[Bug] Cant get actual segments list for segmentation #1691

Open
dima99112 opened this issue Dec 10, 2024 · 9 comments
Open

[Bug] Cant get actual segments list for segmentation #1691

dima99112 opened this issue Dec 10, 2024 · 9 comments

Comments

@dima99112
Copy link

Describe the Bug

In your example you have one segmentation with two segments with different colors.
But in cornerstoneTools.segmentation.state.getSegmentations()[0].segments i see only one segment. some in other in my cases with many segments

Снимок экрана 2024-12-10 в 10 38 00

Steps to Reproduce

  1. open example https://www.cornerstonejs.org/live-examples/labelmapsegmentspecificconfiguration
  2. see in console cornerstoneTools.segmentation.state.getSegmentations()[0].segments

The current behavior

cornerstoneTools.segmentation.state.getSegmentations()[0].segments take only one segments

The expected behavior

expected - cornerstoneTools.segmentation.state.getSegmentations()[0].segments take two (many) segments

OS

macos 14.6.1

Node version

18.20.2

Browser

Chrome 131.0.6778.69

@dima99112
Copy link
Author

@sedghi @jlopes90

hello! can u help us?

@dima99112
Copy link
Author

dima99112 commented Dec 10, 2024

some at https://www.cornerstonejs.org/live-examples/segmentationvolume example after click "load seg"

Снимок экрана 2024-12-10 в 11 17 09

u can see many segments with differect colors at dicoms, but i get one segment with name "Segment 1"

@napest
Copy link

napest commented Dec 10, 2024

+1 for this issue
while in OHIF the same study and file is imported fine:
https://viewer.ohif.org/segmentation?StudyInstanceUIDs=1.3.6.1.4.1.14519.5.2.1.256467663913010332776401703474716742458
image

Copy link
Member

sedghi commented Dec 10, 2024

I think we should have them synced yes

@napest
Copy link

napest commented Dec 10, 2024

I think we should have them synced yes

It would be a life-saver for us, thank you!

@sedghi sedghi self-assigned this Dec 11, 2024
@napest
Copy link

napest commented Jan 9, 2025

Hi @sedghi!
Could you please tell us when should we await an update for this feature? It is a blocker for our project as we can't get the list of segments any other way :(

@sedghi
Copy link
Member

sedghi commented Jan 21, 2025

So I looked into this, and I've kind of changed my mind - a segment is basically a construct, and its state should be kept at a higher level than cornerstone3D. What I mean is, a segmentation can have a segment even if it's empty, and that's okay. It's up to the consuming applications to create and hold that state, and then use it as they see fit by calling utilities inside cornerstone3D. The applications are in charge of managing the segment state, and they can use cornerstone3D's tools to do that.

@sedghi sedghi removed their assignment Jan 21, 2025
@napest
Copy link

napest commented Jan 21, 2025

The applications are in charge of managing the segment state, and they can use cornerstone3D's tools to do that.

@sedghi Sorry I don't quite get it. What we have here is DICOM SEG with many segments, and it's imported with cornerstone3D adapter in your example. We have found only one way to get the information on the segments in API - with cornerstoneTools.segmentation.state.getSegmentations()[0].segments and it works incorrectly and shows only one segment instead of 13. If there is another way please suggest it

@dima99112
Copy link
Author

+1 this issue

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

No branches or pull requests

3 participants