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

[Feature Request] Add support for overlapping segments #3496

Open
fedorov opened this issue Jun 26, 2023 · 26 comments
Open

[Feature Request] Add support for overlapping segments #3496

fedorov opened this issue Jun 26, 2023 · 26 comments
Labels
Feature Request IDC:priority Items that the Imaging Data Commons wants to help sponsor

Comments

@fedorov
Copy link
Member

fedorov commented Jun 26, 2023

What feature or change would you like to see made?

Overlapping DICOM SEG segments are currently no loaded with the error message indicating they are not supported in v3. Overlapping segments were supported in v2.

Why should we prioritize this feature?

IDC project is currently using v2, which is able to render overlapping segments. IDC contains data that contains overlapping segments, such as this one: https://viewer.imaging.datacommons.cancer.gov/viewer/1.3.6.1.4.1.32722.99.99.62087908186665265759322018723889952421. Unless this feature is implemented, this would be a regression if IDC switches to v3.

@fedorov fedorov added the IDC:candidate Possible feature requests for discussion, and if we agree, they can be relabeled IDC:priority label Jun 26, 2023
@igoroctaviano
Copy link
Contributor

@sedghi @rodrigobasilio2022 will discuss a solution to this issue.
A stack viewport is being implemented and might address this issue.

@james-hanks
Copy link

@sedghi link stack segmentation ticket (if we have one)

@fedorov
Copy link
Member Author

fedorov commented Aug 25, 2023

Per @rodrigobasilio2022 (if I understand correctly), this is blocked by cornerstonejs/cornerstone3D#679.

@rodrigobasilio2022
Copy link
Collaborator

Yes, the steps are:

@igoroctaviano
Copy link
Contributor

Related to #3581

@james-hanks
Copy link

On hold because related fix will be published through industry partner project Q1 2024

@fedorov
Copy link
Member Author

fedorov commented Dec 14, 2023

@james-hanks @igoroctaviano I observe that overlapping segments that are from different segmentations do work. Is this expected - that overlapping segments from different segmentations work, but from the same segmentation do not?

https://viewer.imaging.datacommons.cancer.gov/v3/viewer/?StudyInstanceUIDs=1.3.6.1.4.1.14519.5.2.1.6279.6001.191425307197546732281885591780

2023-12-14_11-41-55

@fedorov
Copy link
Member Author

fedorov commented Dec 14, 2023

overlapping segments from different segmentations work, but from the same segmentation do not

Yes, I confirmed the above. Interesting. The examples below can be used to demonstrate this (if you have little kids, you can ask them to play the game of "find differences" - it should be fun!):

image

image

I do have to point out that I find it very disturbing that you show incorrect segmentation overlay by cropping overlap areas, and do not give any warning to the user about this. Segmentations are shown as if everything is normal. This is really bad, IMHO. I hope no one is looking at any overlapping segments that are used for patient care using v3!

@sedghi
Copy link
Member

sedghi commented Dec 19, 2023

Yes, if there are separate segmentations they will work fine.

I find it very disturbing that you show incorrect segmentation overlay by cropping overlap areas, and do not give any warning to the user about this. Segmentations are shown as if everything is normal. This is really bad, IMHO. I hope no one is looking at any overlapping segments that are used for patient care using v3!

I thought we show a warning, but tried it now and we don't, hmmmm I will look into this, but I guess your comment is about overlapping segments in one segmentation right?

@fedorov
Copy link
Member Author

fedorov commented Dec 19, 2023

your comment is about overlapping segments in one segmentation right?

Correct. I think it makes sense to warn users about lack of support of overlapping segments. Ideally, it would only show up when overlapping segments are detected. I tested, and did not see any such warnings.

@sedghi
Copy link
Member

sedghi commented Dec 19, 2023

I'm pretty sure I had that warning, not sure how it is not showing up. I will fix it in the next PR

@fedorov
Copy link
Member Author

fedorov commented Aug 6, 2024

Just discovered this today (on OHIF demo viewer) that there is still no support for overlapping segments AND there is no any kind of warning that what you see is not what you have CORRECTION: the warning does show up, but it is obscured by the research software warning popup that is in front!. In this particular case, the result is very confusing.

https://viewer.ohif.org/viewer?StudyInstanceUIDs=1.3.6.1.4.1.14519.5.2.1.3671.4754.298665348758363466150039312520

image

This is how it should look in reality (shown in v2): https://viewer.imaging.datacommons.cancer.gov/viewer/1.3.6.1.4.1.14519.5.2.1.3671.4754.298665348758363466150039312520

image

@fedorov
Copy link
Member Author

fedorov commented Aug 6, 2024

On hold because related fix will be published through industry partner project Q1 2024

For the record, it is way past Q1 2024, and this issue is still unresolved.

@github-project-automation github-project-automation bot moved this to Priority in IDC Aug 28, 2024
@fedorov
Copy link
Member Author

fedorov commented Sep 15, 2024

Is there any update on the timeline for resolving this issue?

This missing feature is one of the biggest obstacles for us in IDC to switching to v3 as the primary viewer and deprecating v2.

@sedghi
Copy link
Member

sedghi commented Sep 17, 2024

@fedorov Currently, this isn't possible. However, we have just layed the groundwork for the solution in Cornerstone3D 2.0. Once that's complete, the effort required will likely be much less.

cornerstonejs/cornerstone3D#1400

@fedorov
Copy link
Member Author

fedorov commented Oct 8, 2024

What is very confusing is that it is apparently possible to display overlapping segments that come from different segmentations, but not if overlapping segments are in the same segmentation....

Example: https://viewer.imaging.datacommons.cancer.gov/v3/viewer/?StudyInstanceUIDs=1.2.840.113654.2.55.38309775581218325422753197576029670247

2024-10-08_16-22-57

@igoroctaviano
Copy link
Contributor

What is very confusing is that it is apparently possible to display overlapping segments that come from different segmentations, but not if overlapping segments are in the same segmentation....

Example: https://viewer.imaging.datacommons.cancer.gov/v3/viewer/?StudyInstanceUIDs=1.2.840.113654.2.55.38309775581218325422753197576029670247

2024-10-08_16-22-57 2024-10-08_16-22-57

I think every segmentation has its independent volume in CS3D so segments withing an SEG share the same volume which is the source the problem. @sedghi correct me if I'm wrong.

@sedghi
Copy link
Member

sedghi commented Oct 8, 2024

@fedorov Yes, we can render two segmentations that have different segments that overlap, but overlapping segments as part of one segmentation is not supported. I mean, you can right now detect that they're overlapping segments and create two or three non-overlapping segmentations and then render them all. I guess that would suffice for you to migrate to version 3, until i fix the overlapping segments inside one segmentation and letting brush to perform on them

@fedorov
Copy link
Member Author

fedorov commented Oct 8, 2024

you can right now detect that they're overlapping segments and create two or three non-overlapping segmentations and then render them all

It's even easier than this - there's an attribute that can be used to indicate whether segments overlap: https://dicom.innolitics.com/ciods/segmentation/segmentation-image/00620013.

In the general case, one would need to double-check, but in IDC we can potentially curate our segmentations to make sure this attribute is accurate for our data.

I guess the question is what is the timeline you think for your original approach? This will help me decide if we should invest into adding the workarounds within the current implementation (and by doing this save on the ongoing effort maintaining v2), or wait for the proper solution.

@sedghi
Copy link
Member

sedghi commented Oct 8, 2024

Unfortunately, I don't think it will happen anytime soon. If it's easy, I can demonstrate how to manage two segmentations for rendering purposes. so we can upgrade IDC to v3.

The hard part is to figure out how to have the minimum number of segmentations such that within each, there are no overlapping segments.

@igoroctaviano

@fedorov
Copy link
Member Author

fedorov commented Oct 8, 2024

This is very helpful. Thank you for your advice and transparency on this! We will discuss with Igor to plan the next steps.

@fedorov
Copy link
Member Author

fedorov commented Oct 10, 2024

I mean, you can right now detect that they're overlapping segments and create two or three non-overlapping segmentations and then render them all.

@sedghi would you welcome such a workaround in v3, or would they need to go into IDC fork?

@sedghi
Copy link
Member

sedghi commented Oct 10, 2024

It is welcomed indeed

@pedrokohler pedrokohler self-assigned this Oct 18, 2024
@fedorov
Copy link
Member Author

fedorov commented Oct 22, 2024

As of today, per @pedrokohler, we need to wait for the release of cornerstone3d 2.0, which should be released tomorrow or on Thursday to start working.

@fedorov
Copy link
Member Author

fedorov commented Nov 7, 2024

Now that #4347 is merged, this can proceed.

@pedrokohler
Copy link
Collaborator

@fedorov FYI the first step for a solution has just been merged here cornerstonejs/cornerstone3D#1692

We still have a final step to take and allow the overlapping segs. This work should be done in the next days (maybe couple of weeks, because of the holidays)

@fedorov fedorov added IDC:priority Items that the Imaging Data Commons wants to help sponsor and removed IDC:candidate Possible feature requests for discussion, and if we agree, they can be relabeled IDC:priority labels Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request IDC:priority Items that the Imaging Data Commons wants to help sponsor
Projects
Status: Priority
Development

No branches or pull requests

7 participants