mlavik1/UnityVolumeRendering

Calculate volume size

Closed this issue · 3 comments

Hello, I was wondering if it's possible to calculate the imported volume size. Any help will be appreciated.

You mean the physical size of the dataset? For DICOM and NRRD that should already be taken care of (at least for SimpleITK), however when spawning a dataset the VolumeRenderedObject is scaled down to make sure all datasets have approximately the same visual size. You can disable that by commenting out this line of code.
Alternatively you can set the scale of the "VolumeRenderedObject" (GameObject) to 1,1,1 after import.

More detailed explanation:
For DICOM the scale is calculated like this, and is applied to the volume containerhere

This reminds me: I should probably add a setting to disable this automatic normalisation of the scale..

Thanks for your quick response :) I commented the maxscale line and it shows volume object to 1, 1, 1
The scale parameter (vector3) helps a lot with calculating volume size. Thank you!

Glad to hear that helped!
Have a great day :)