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

Rotatating vtk prop3d generated by cornerstone volume loader #620

Open
danielfournier-tech opened this issue Apr 6, 2023 · 0 comments
Open

Comments

@danielfournier-tech
Copy link

I have been trying to rotate a vtkVolume that has been generated by the cornerstone volume loader (@cornerstonejs\core\dist\esm\loaders\volumeLoader.js) doesn't work unless I modify the function:
function createInternalVTKRepresentation(volume) { const { dimensions, metadata, spacing, direction, origin } = volume; const { PhotometricInterpretation } = metadata; let numComponents = 1; if (PhotometricInterpretation === 'RGB') { numComponents = 3; } const imageData = vtkImageData.newInstance(); const dataArrayAttrs = { numberOfComponents: numComponents }; imageData.setDimensions(dimensions); imageData.setSpacing(spacing); imageData.setDirection(direction); imageData.setOrigin([0, 0, 0]); if (volume.isDynamicVolume()) { const scalarDataArrays = (volume).getScalarDataArrays(); addScalarDataArraysToImageData(imageData, scalarDataArrays, dataArrayAttrs); } else { const scalarData = volume.getScalarData(); addScalarDataToImageData(imageData, scalarData, dataArrayAttrs); } return imageData; }

Is there a way to create and utilize a custom volume loader with this change?

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

No branches or pull requests

1 participant