Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions Sources/Rendering/Core/ColorTransferFunction/ColorMaps.json
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,78 @@
"NanColor" : [ 1, 0, 0 ],
"RGBPoints" : [ 0, 0, 0, 0, 1, 1, 1, 1 ]
},
{
"ColorSpace" : "RGB",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@finetjul finetjul Nov 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add support for a "Nodes" key/value in addition to "RGBPoints".
See applyColorMap in ColorTransferFunction/index.js

"Name" : "Grayscale-DICOM-sigmoid",
"Notes": "This is a 16 point sample of a sigmoid grayscale colormap described in the DICOM standard. See equation C.11-1 in section C.11.2",
"NanColor" : [ 1, 0, 0 ],
"RGBPoints" : [
-1,
0.01798620996209156,
0.01798620996209156,
0.01798620996209156,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not 0 ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I am using the equation specified by the DICOM standard:
1 / (1 + e^(4x))
The multiplying factor of 4 could be increased to make the ends closer to 0 and 1 but they are asymptotic, so they only converge to those values. I think the purpose of the sigmoid is to increase the gradient at the center of the scalar range (window). And it is probably ok to sacrifice some color range at the ends.

-0.8666666666666667,
0.030275691986950463,
0.030275691986950463,
0.030275691986950463,
-0.7333333333333334,
0.05053016223541345,
0.05053016223541345,
0.05053016223541345,
-0.6,
0.08317269649392238,
0.08317269649392238,
0.08317269649392238,
-0.4666666666666667,
0.13392788832407365,
0.13392788832407365,
0.13392788832407365,
-0.33333333333333337,
0.2086085273260449,
0.2086085273260449,
0.2086085273260449,
-0.19999999999999996,
0.31002551887238755,
0.31002551887238755,
0.31002551887238755,
-0.06666666666666665,
0.4337256058045608,
0.4337256058045608,
0.4337256058045608,
0.06666666666666665,
0.5662743941954392,
0.5662743941954392,
0.5662743941954392,
0.19999999999999996,
0.6899744811276125,
0.6899744811276125,
0.6899744811276125,
0.33333333333333326,
0.791391472673955,
0.791391472673955,
0.791391472673955,
0.46666666666666656,
0.8660721116759263,
0.8660721116759263,
0.8660721116759263,
0.6000000000000001,
0.9168273035060777,
0.9168273035060777,
0.9168273035060777,
0.7333333333333334,
0.9494698377645865,
0.9494698377645865,
0.9494698377645865,
0.8666666666666667,
0.9697243080130495,
0.9697243080130495,
0.9697243080130495,
1,
0.9820137900379085,
0.9820137900379085,
0.9820137900379085
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not 1 ?

]
},
{
"ColorSpace" : "RGB",
"Name" : "BkRd",
Expand Down
Loading