Skip to content

Conversation

jadh4v
Copy link
Collaborator

@jadh4v jadh4v commented Jul 30, 2024

Add sliders and VolumeRepresentation property values for adjusting the data range applicable for the grayscale colormap.
This effectively has the resulting behavior of Window/Level adjustment.

I have verified that, in the fragment shader, the color transfer function is indeed applied after the raw voxel values are projected to the viewport. Therefore, using colorDataRange as a way to apply window/level adjustment for a MIP view is appropriate.

pet-ct-WL.mp4

@jadh4v jadh4v marked this pull request as draft July 30, 2024 03:51
@jadh4v jadh4v marked this pull request as ready for review August 1, 2024 15:16
@jadh4v
Copy link
Collaborator Author

jadh4v commented Aug 1, 2024

@floryst @jun-sironamedical Please review.

@jun-sironamedical
Copy link
Contributor

@jadh4v looks good to me, seems pretty straight forward. Might have questions when I try to implement though, but this PR looks good.

@@ -349,6 +354,20 @@ function Example(props) {
setValue={setColorPreset}
style={{ top: '10px', left: '405px' }}
/>
<Slider
label='PET Level'
max={34611}
Copy link

Choose a reason for hiding this comment

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

Are these max constants based on the underlying data's range?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. Ideally, this should be set to max scalar range. Or some heuristic value based on it.

@floryst
Copy link
Contributor

floryst commented Aug 5, 2024

LGTM after Daniel's comment is addressed!

@floryst floryst merged commit 0633dbc into Kitware:beta Sep 17, 2024
@jourdain
Copy link
Collaborator

🎉 This PR is included in version 2.0.0-beta.18 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jourdain
Copy link
Collaborator

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

5 participants