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

Applying colormap on color images (like ultrasounds) #562

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Bolkonski
Copy link

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
Copy link

@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

For RGBA images, it calculates the grayscale pixel value using the luminosity method.
@Bolkonski
Copy link
Author

Bolkonski commented Nov 12, 2021

@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.

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

Successfully merging this pull request may close these issues.

2 participants