-
-
Notifications
You must be signed in to change notification settings - Fork 401
feat(ColorMaps): Add grayscale sigmoid colormap based on DICOM standard #3365
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
feat(ColorMaps): Add grayscale sigmoid colormap based on DICOM standard #3365
Conversation
18b448d to
aed71ec
Compare
|
cc: @finetjul please also review |
7a19880 to
12d5c65
Compare
Add a non-linear sigmoid grayscale colormap as an alternative to linear grayscale. This mapping is described in the DICOM standard in section C.11.2.1.3.1 SIGMOID Function and equation C.11-1. We use a normalized window_width of [-1, 1] and window_center = 0. The colormap is generated using a 16-point sampling of this function.
12d5c65 to
879938b
Compare
879938b to
4dde193
Compare
|
@finetjul |
finetjul
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
🎉 This PR is included in version 34.16.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Context
Add a non-linear sigmoid grayscale colormap as an alternative to linear grayscale. This mapping is described in the DICOM standard in section C.11.2.1.3.1 SIGMOID Function and equation C.11-1. We use a normalized window_width of [-1, 1] and window_center = 0. The colormap is generated using a 16-point sampling of this function.
See: https://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_c.11.2.html
## There are two ways to access the sigmoid function:1. Developer can use the newly added sigmoid presets that already are generated on the sigmoid curve, or2. Use the
ScalarMappingModeproperty onvtkColorTransferFunctionto adapt any color map to sigmoid mapping. thevtkColorTransferFunctionprovides twoScalarMappingModes.LINEARcontinues to be the default value and behavior, andSIGMOIDallows to switch the scalar to color mapping to the sigmoid function. Additionally, you can control the growth rate factor usingsetSigmoidGrowthRate()which is usually a negative number and equal to-4according to the DICOM standard.Results
A comparison of linear vs sigmoid grayscale using the ImageViewer example.
The sampled 16-point sigmoid function plotted through matplotlib:

Changes
PR and Code Checklist
npm run reformatto have correctly formatted codeTesting