Viewers icon indicating copy to clipboard operation
Viewers copied to clipboard

[Bug] RTStruct not visible or loaded as annotations in certain cases

Open dxlin opened this issue 6 months ago • 1 comments

Describe the Bug

  1. When rtstruct is loaded on referenced display set after loading on an unreferenced display set, segmentations load but are not visible.
Image
  1. When rtstruct is loaded with duplicate display sets (i.e. same display set but on multiple view ports), the segments show up on the duplicate view ports as annotations/measurements. Potentially intended behaviour.
Image

Steps to Reproduce

Invisible Segments:

  1. https://viewer-dev.ohif.org/segmentation?StudyInstanceUIDs=1.2.840.113619.2.290.3.3767434740.226.1600859119.501
  2. Viewport 1 -> use overlay menu to load rtstruct (loads and visible)
  3. Viewport 3 -> use overlay menu to load rtstruct (loads but not visible)

Extra Annotations:

  1. https://viewer-dev.ohif.org/segmentation?StudyInstanceUIDs=1.2.840.113619.2.290.3.3767434740.226.1600859119.501
  2. Set viewport 1 (optionally 2 and 4) to AC192
  3. Viewport 3 -> use overlay menu to load rtstruct (loads and visible, but also visible as annotations on other viewports)

Test for above in playwright (but screenshots not valid): https://github.com/dxlin/Viewers/commit/0e2b9d29923bd37560b7685e2cf116cfbcfd7fa7

The current behavior

Invisible Segments: rtstruct is invisible in referenced display set

Extra annotations: loaded rtstructs show up on duplicate viewports as annotation/measurements

The expected behavior

Invisible Segments: rtstruct should be visible in referenced display set

Extra annotations: loaded rtstructs should probably show up as segments or not at all on duplicate viewports

System Information

System: OS: Windows 11 10.0.26100 CPU: (16) x64 Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz Memory: 5.20 GB / 15.72 GB Binaries: Node: 22.16.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.22 - C:\Users\dx\AppData\Roaming\npm\yarn.CMD npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD Browsers: Chrome: 141.0.7390.67 Edge: Chromium (140.0.3485.54)

dxlin avatar Oct 15 '25 07:10 dxlin

@dxlin , I tried this on the latest viewer 3.12.0 beta.95 and I believe it has been addressed. Would you be so kind as to test it yourself and let me know if there are still issues? Thanks.

jbocce avatar Dec 03 '25 13:12 jbocce

Hi @jbocce, the segmentations appearing as annotations does appear to be resolved and each viewport is now acting independently as is expected behaviour; however, I am still seeing the segmentation not being visible (but still showing up on the side panel) in certain loading sequences.

I ran the below tests:

// >>>>> Test Summaries // 1. Load RTStruct on referenced DS (works)

// 2. Load RTStruct on referenced DS then unreferenced DS (works) // 3. Load RTStruct on unreferenced DS then referenced DS (breaks, on panel but not visible)

// 4. On referenced DS (FoR1) load FoR1, then FoR2 (works) // 5. On referenced DS (FoR1) load FoR2, then FoR1 (breaks - measurement outline)

// 6. Load RTStruct on referenced DS, then on unreferenced DS with same FoR (works) // 7. Load RTStruct on referenced DS, then on unreferenced DS with diff FoR (breaks, on panel but not visible)

// 8. Load RTFoR1 on viewport 0, delete (from menu) -> RTFoR1 missing from overlay dropdown of viewport 0

// 9. Load RTstruct on unreferenced DS, then on referenced DS // Load Seg on referenced DS -> runtime error

// 10. Duplicate referenced DS (FoR1) // Load RTFoR1 on unreferenced DS, Load RTFor2 on referenced DS // Load RTFor1 on duplicated referenced DS, referenced DS overlay multiple, duplicate nothing visible // <<<<<<< Test Summaries

I have tests 1-8 in playwright test format (along with the .png of the results) in the branch below: https://github.com/dxlin/Viewers/tree/test/RTStructReferencedDIsplaySetLoad

Note that I've also integrated below to load the RTStructs: https://github.com/dxlin/Viewers/tree/fix/rtStructInlineBinaryContour https://github.com/OHIF/Viewers/pull/5611

For convenience, below is result of test 3 Image

test 5 Image

test8 can also be repeated:

  1. https://viewer-dev.ohif.org/segmentation?StudyInstanceUIDs=1.2.840.113619.2.290.3.3767434740.226.1600859119.501
  2. overlay segmentation 'Contours on PET' on viewport 2 (should be AC192)
  3. Right panel -> expand menu to left of segmentations combobox -> delete
  4. The segmentation is no longer available

dxlin avatar Dec 15 '25 04:12 dxlin