Viewers icon indicating copy to clipboard operation
Viewers copied to clipboard

[Feature Request] Display the label for the segment at the mouse location

Open fedorov opened this issue 1 year ago • 24 comments

What feature or change would you like to see made?

It would be helpful to be able to show the name of the segment at the pixel location pointed by the mouse in a tooltip, or in some "probe" area of the interface.

Why should we prioritize this feature?

Once the number of segments reaches couple of dozens (and it can easily be ~100 with the modern AI segmentation tools), it is quite difficult to know what is the label for a given segmentation in the viewer.

Especially for someone who does not know anatomy well - like me (and at least some AI segmentation tools developers, I dare say)! :-D

fedorov avatar Dec 12 '24 23:12 fedorov

@dan-rukas @sedghi we are thinking we would need design developed/approved first here? Can you let us know? We would be interested to prioritize work on this, and I think this would be a very useful feature outside of IDC.

fedorov avatar Mar 27 '25 17:03 fedorov

@fedorov I'm just waiting for a green light to start working on this one.

pedrokohler avatar Apr 04 '25 14:04 pedrokohler

I deployed using this recipe we have been using in IDC https://github.com/ImagingDataCommons/idc-viewers-sandbox-gha-testing/blob/main/.github/workflows/deploy-ohif-v3-upstream-with-add-ons.yml, and I do not see this feature. Do I need to anything special to be able to use it?

fedorov avatar Jul 09 '25 18:07 fedorov

@fedorov you have to activate it on the segmentation panel here:

Image

(this is a screenshot from the version deployed by you)

pedrokohler avatar Jul 09 '25 18:07 pedrokohler

Ok, I found it in my deploy. So now I have the following questions:

  1. Why is it in the Segmentation mode? This is a feature most valuable for the basic viewer, when we need static review of existing segmentations.
  2. I still cannot make it to work, even though it is enabled, see demo here: https://app.screencast.com/QqWys9ShkGRxK
  3. Is this setting exposed via the config file, so it can be enabled by default on deploy?

fedorov avatar Jul 09 '25 18:07 fedorov

  1. Why is it in the Segmentation mode? This is a feature most valuable for the basic viewer, when we need static review of existing segmentations.

I've also added it to the basic viewer (longitudinal mode). It should be available on the same menu. Please let me know if it is not.

  1. I still cannot make it to work, even though it is enabled, see demo here: https://app.screencast.com/QqWys9ShkGRxK

That is weird. Did you get any errors in the console?

  1. Is this setting exposed via the config file, so it can be enabled by default on deploy?

No. I'll add that for you.

pedrokohler avatar Jul 09 '25 20:07 pedrokohler

@fedorov can you share the url of the study you were looking at in the video?

pedrokohler avatar Jul 09 '25 20:07 pedrokohler

@pedrokohler I do not see it in the basic viewer - but it might be that it is just well-hidden! :-D

Here's the URL (not sure if you would be able to open it, but you can fetch the study in question from IDC with pip install idc-index && idc download 1.2.840.113654.2.55.175589378701871887335124424440855375150): https://viewers-sandbox-gha-testing.web.app/viewer?StudyInstanceUIDs=1.2.840.113654.2.55.175589378701871887335124424440855375150

Image

Indeed, there is an error in the console ("Segmentation mode" only)!

Image

fedorov avatar Jul 09 '25 20:07 fedorov

@fedorov I see. It's because you didn't click the load button up there. I'll see that it also works in this condition.

I'll also take a look at why it's not showing in the basic viewer.

pedrokohler avatar Jul 09 '25 20:07 pedrokohler

Oh right the LOAD button! Am I the only one who is confused by it? Anyway, I think we are auto-loading it in IDC, so hopefully our users won't need to worry about it.

The use of the color assigned to the segment for the label annotation is witty, but it may not be very helpful, as some colors can blend with the image. Did you consider using bright yellow, or something like that, to make that label consistently prominent?

Image

fedorov avatar Jul 09 '25 20:07 fedorov

It was initially yellow, but Alireza requested it to be changed to the color of the segmentation.

I'll also add a new PR to cornerstone allow this to be configurable. This way everyone is happy.

pedrokohler avatar Jul 09 '25 20:07 pedrokohler

but Alireza requested it to be changed to the color of the segmentation

@sedghi what are your thoughts about the result of that below?

Image

fedorov avatar Jul 09 '25 20:07 fedorov

I have seen that in other viewers to be the same color of the segment, maybe we need to drop a shadow behind it. or if it already have a shadow we increase it

sedghi avatar Jul 09 '25 21:07 sedghi

@fedorov feel free to comment here https://github.com/OHIF/Viewers/issues/5190

sedghi avatar Jul 09 '25 21:07 sedghi

It took me some time to find this - this feature was added as a new tool.

Image

While testing this, I discovered that 1) the tool can be enabled even if there is no SEG in the view (I don't know if this is expected behavior); 2) if it is enabled without a SEG, it will trigger error popup and the following errors in the console.

Image

fedorov avatar Sep 03 '25 16:09 fedorov

yeah weird, it should check if there is a SEG, it is easy, we can add a new evaluator to check if SEG exists

sedghi avatar Sep 18 '25 23:09 sedghi

but seems like this is working in viewer-dev as you liked it?

Image

sedghi avatar Sep 18 '25 23:09 sedghi

any update on this?

sedghi avatar Oct 16 '25 21:10 sedghi

Not really.... It is a complicated mess, unfortunately, due to the variety of factors:

  1. IDC production (as well as all other tiers) OHIF cannot display RTSTRUCT, due to https://github.com/ImagingDataCommons/ViewersV3/issues/95, so I cannot test it with that
  2. the above should be fixed now, but @igoroctaviano has not yet upgraded our fork
  3. he has not upgraded our fork, because we are still hopeful we can get fixes for #5082 in - I have zero idea where that is at the moment, and who is working on it, if any
  4. we do have a sandbox instance we can test easily against IDC content here https://viewers-sandbox-gha-testing.web.app/, and I have just updated it with the latest master, but for some reason I do not see that tool there at all...

Not quite sure if I can do anything about this, I can't debug this, so I plan to wait until IDC fork is updated by Igor, and will then test in IDC dev tier.

fedorov avatar Oct 17 '25 14:10 fedorov

@sedghi now that we updated to 3.11.1, I tested it, and it is not working reliably. Sometime it shows the label (e.g., for this StudyInstanceUID 1.2.840.113654.2.55.10251457513072085864761297205518907029 in IDC), on some other occasions it does not show anything and I see the errors below (for this study 1.3.6.1.4.1.32722.99.99.173744694849724904145228624619597754035).

Image

Once we update the viewer in prod tier, I will add links.

fedorov avatar Nov 24 '25 15:11 fedorov

Sure let's take a look once deployed

sedghi avatar Nov 24 '25 15:11 sedghi

Works here: https://viewer.imaging.datacommons.cancer.gov/v3/viewer/?StudyInstanceUIDs=1.2.840.113654.2.55.192012426995727721871016249335309434385&SeriesInstanceUIDs=1.2.840.113654.2.55.305538394446738410906709753576946604022,1.2.276.0.7230010.3.1.3.313263360.15787.1706310178.804490

Doesn't work here: https://viewer.imaging.datacommons.cancer.gov/v3/viewer/?StudyInstanceUIDs=1.3.6.1.4.1.32722.99.99.173744694849724904145228624619597754035 (segmentation series "Segmentation"). I think the issue here might be that it does not contain recommended color in DICOM. But it should not break the code - the color is used in OHIF.

fedorov avatar Nov 24 '25 23:11 fedorov

In addition, after testing this feature, I would like to mention it again that I do not think the current choice of using the same color for the text annotation as the color of the segment is useful. I do not see how using segment color for the annotation helps in any scenarios, but it most definitely makes the text difficult to read under some conditions. I would strongly prefer using the same prominent bright color for this annotation, same color no matter what is the color of the segment.

fedorov avatar Nov 25 '25 19:11 fedorov

Also, I think it is a bug that the annotation does not disappear if I scroll and the cursor is no longer at the same label as it was at the start of the scroll.

Image

fedorov avatar Nov 25 '25 19:11 fedorov