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

VolumeViewport setProperties #62

Closed
sedghi opened this issue Apr 1, 2022 · 2 comments
Closed

VolumeViewport setProperties #62

sedghi opened this issue Apr 1, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@sedghi
Copy link
Member

sedghi commented Apr 1, 2022

Similar to StackViewports which can .setProperties, Volume Viewport should too

currently for stack viewports

viewport.setProperties({ voiRange: ctVoiRange });

But for volume viewports

// Get the volume actor from the viewport
const actor = viewport.getActor(volumeId);

// Set the mapping range of the actor to a range to highlight bones
actor.volumeActor
  .getProperty()
  .getRGBTransferFunction(0)
  .setMappingRange(-1500, 2500);

viewport.render();
@sedghi sedghi added the enhancement New feature or request label Apr 1, 2022
@sedghi sedghi changed the title Volume sets properties VolumeViewport setProperties Apr 1, 2022
@ahlaughland
Copy link

@sedghi I found that this will update the Volume properties without using the VTK functions:

const { lower, upper } = csUtils.windowLevel.toLowHighRange(
    windowWidthNum,
    windowLevelNum
);

viewport.setProperties({ voiRange: { upper, lower }, volumeActor }, referenceId);
                  
viewport.render();

@sedghi
Copy link
Member Author

sedghi commented Jul 25, 2023

Correct this was an old issue

@sedghi sedghi closed this as completed Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants