cornerstonejs / cornerstone

JavaScript library to display interactive medical images including but not limited to DICOM
https://docs.cornerstonejs.org/
MIT License
2.04k stars 598 forks source link

Applying colormap on color images (like ultrasounds) #562

Open Bolkonski opened 2 years ago

Bolkonski commented 2 years ago

Hello First of all, I wanna thank the Cornerstone creators and team in general. For 3 years I've been using this libraries in my work. The documentation and forums also helped me a lot. There was only one issue I couldn't find an answer for. When applying colormaps to an image in color (mostly ultrasounds), the canvas shows a distorted image (see the attached picture). colormap us error Recently i made this update to de cornerstone.js file stored in my project assets's and fixed the problem for me. This pull request is my first ever. I have read the contributor guidelines and hope i am not violating any rules. Above all, i expect this to be useful. Any feedback in my pull request will be apreciated.

sen-trenser commented 2 years ago

@Bolkonski Is it safe to ignore other colors than the Red channel? If the acquired image has some green or blue colored region in original series, that might be considered as black when applying LUT ! Here is another existing PR for same issue. https://github.com/cornerstonejs/cornerstone/pull/545

Bolkonski commented 2 years ago

@Bolkonski Is it safe to ignore other colors than the Red channel? If the acquired image has some green or blue colored region in original series, that might be considered as black when applying LUT ! Here is another existing PR for same issue. #545

@sen-trenser absolutely true! I was so fixated with image distortion that i forgot to actually convert to grayscale. There is another commit using Luminosity Method. I read #545 and got some ideas, altho I didn't understand why relative luminance. Maybe I am missing something.