cornerstone icon indicating copy to clipboard operation
cornerstone copied to clipboard

ColorMapping Example not working anymore

Open paul-asvb opened this issue 5 years ago • 4 comments

https://rawgit.com/cornerstonejs/cornerstone/master/example/falseColorMapping/index.html doesnt work anymore. Image is loading but after selecting a colormap the image goes blank. Screenshot from 2019-10-02 12-25-17 Screenshot from 2019-10-02 12-25-27

paul-asvb avatar Oct 02 '19 10:10 paul-asvb

@dannyrb I have submitted a propose for this issue in #412, let me know if you think I do it differently ❤️

mateusfreira avatar Oct 03 '19 12:10 mateusfreira

Thanks, @mateusfreira! I've merged your fix. I'll likely need to generate a new dist and cut a release for the demo to start working, but the source is aligned.

Thank you for taking the time to PR a fix! ^_^

dannyrb avatar Oct 03 '19 12:10 dannyrb

Hi in the file internal/drawImageSync.js if an image is already rendered the if statement if (!render) { if (enabledElement.viewport.colormap && enabledElement.viewport.colormap !== '' && enabledElement.image.labelmap === true) { render = renderLabelMapImage; } will never be executed even if you set the colormap to true .

As a temporary workaround I added the following statement to get over the issue

if(enabledElement.viewport.colormap &&enabledElement.viewport.colormap !== '') render = false;

its a bad and crude fix but it works.

sastradhar avatar Feb 24 '20 19:02 sastradhar

It seems same now. it displays black color when I change colormap.

browser: chrome os: window10

qkreltms avatar Mar 18 '21 07:03 qkreltms