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

Overlay tool shows overlays at incorrect coordinates #902

Open
bingwing opened this issue Mar 12, 2019 · 15 comments
Open

Overlay tool shows overlays at incorrect coordinates #902

bingwing opened this issue Mar 12, 2019 · 15 comments
Assignees

Comments

@bingwing
Copy link

hi, guys, @swederik @medihack @simonmd @jpambrun , thanks for the excellent work.

When i use the cornerstone in cornerstoneWADOImageLoader, there a few dicoms file shown black.
image

image

image
image

the core js code in the html:

cornerstoneWADOImageLoader.external.cornerstone = cornerstone;
var dicomelement = document.getElementById("dicomImage");

function loadAndViewImage(dicombase64data, arealocation) {
    var element = document.getElementById(arealocation);

    try {
        cornerstone.loadImage(dicombase64data).then(
            function(image) {
                var viewport = cornerstone.getDefaultViewportForImage(
                    element,
                    image
                );
                console.log(viewport)
                cornerstone.displayImage(element, image, viewport);
                if (loaded === false) {
                    cornerstoneTools.mouseInput.enable(dicomelement);
                    cornerstoneTools.mouseWheelInput.enable(dicomelement);
                    cornerstoneTools.pan.activate(dicomelement, 2); // pan is the default tool for middle mouse button
                    loaded = true;
                }
            },
            function(err) {
                alert(err);
            }
        );
    } catch (err) {
        alert(err);
    }
}

cornerstone.enable(dicomelement);

Dicom files special, or i miss something?

Hope you can reply this thread, thank you very much!

@swederik
Copy link
Member

It looks like that may be pixel data stored in Overlay tags: See http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.9.2.html

There is an open PR on Cornerstone Tools to support this:

#860

If those images truly contain PHI (I see something that looks like a patient name), please remove it. You can black it out with paint and upload it again.

@bingwing
Copy link
Author

Thanks, already black the PHI i think and upload again, what do we call the chart looks like in the first pic.
And how can i show it correctly? do we have demos deal with this? looked up all the issues and didn't find any similar one.

@georggrab
Copy link

georggrab commented Mar 13, 2019

I've seen this before. Can you delete MinPixelValue and MaxPixelValue tags from your dicom file and try again?
Alternatively, turning off strict mode in the WADO image loader config

@jpambrun
Copy link
Collaborator

@swederik assessment is correct. The first sample is likely a black image with a G6000 overlay. This is supported by the WL=1, WW=1 in the working viewer. In addition, the beige color overlay would otherwise be impossible on the grayscale MONOCHROME2 MR.

@bingwing
Copy link
Author

Thanks, but i'm very new with dicom, is there a demo code or any reference could help me to solve this? @dannyrb @swederik @jpambrun

@bingwing
Copy link
Author

I can see there provide overlayPlaneModule to parse overlay data.But the overlaydisplayTool seems to be have pending for a while here already. @dannyrb @swederik @kofifus @jpambrun , i was stucked deeply, is there any one could give me some advances? Thanks !

@kofifus
Copy link
Contributor

kofifus commented Mar 18, 2019

I don't know why the overly tool is not merged, as far as I know there are no pending issues with it .. @dannyrb ?

@dannyrb
Copy link
Member

dannyrb commented Mar 20, 2019

@kofifus, I need to update that PR to not publish as a scoped package, and then it will be good for merge.

@bingwing
Copy link
Author

Thanks! Very happy to hear this !!
BTW, will it take long to do the merge , or where can i find a demo example code to experience in advance? @kofifus @dannyrb

@bingwing
Copy link
Author

@kofifus @dannyrb
Hint a issue when test the overlay tool, seems the overlays not get the right location as below pic shown.

issue1

issue2

Repro steps:

  1. check out feature/overlay-tool and compile to get the .js package
  2. import overlay tool to my project with code as other tool did like this:
    cornerstoneTools.init({
    globalToolSyncEnabled: true
    });
    const OverlayTool = cornerstoneTools.OverlayTool;
    cornerstoneTools.addTool(OverlayTool);
    cornerstoneTools.setToolEnabled("Overlay", {});

Did i miss something, hope someone could reply this thread. Thank you very much!

@dannyrb
Copy link
Member

dannyrb commented Mar 20, 2019

@bingwing if you can provide a minimal reproduction (repo or codesanbox), or anonymized files for testing, I would be able to take a closer look.

@bingwing
Copy link
Author

bingwing commented Mar 20, 2019

@dannyrb @kofifus
Sorry i can't find any anonymized files for sharing now, but after fork your codesanbox and testing[only the dicom file changed!], it also shown incorrectly. Screenshot as below.

image

should be like this
image

Thanks !

@bingwing
Copy link
Author

bingwing commented Mar 21, 2019

@dannyrb @kofifus
Problem solved !!!

After debugging feature/overlay-tool, i wonder that, is the code in line 100 odd ?

The setTransform executed twice, after delete line 100, everything becomes good.

gitissue

Thank you for the excellent work again!
Bing

@dannyrb
Copy link
Member

dannyrb commented Mar 27, 2019

@bingwing, thanks for the update! I'll shift this over to the tools repository and mark it as a bug report. Hoping to find some time here soon to merge the overlay tool. If you were able to provide example DICOMs to build a test case, that would be helpful 👍

@dannyrb dannyrb changed the title Some dicom files shown black Overlay tool shows overlays at incorrect coordinates Mar 27, 2019
@dannyrb dannyrb transferred this issue from cornerstonejs/cornerstoneWADOImageLoader Mar 27, 2019
@dannyrb dannyrb self-assigned this Mar 27, 2019
@kofifus
Copy link
Contributor

kofifus commented Mar 27, 2019

@bingwing - pls see this to explain why the transform is set twice #780 (comment)

perhaps @jdnarvaez can help here ?

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

No branches or pull requests

6 participants