mlavik1 / UnityVolumeRendering

Volume rendering, implemented in Unity3D. Want to support the project? Donate a small sum to Save The Children(https://www.savethechildren.net/) or another charity, and send me a message, and I will be greatly motivated!
https://fosstodon.org/@unityvolrend
MIT License
458 stars 127 forks source link

Add volume normalisation toggle #256

Closed MichaelOvens closed 5 months ago

MichaelOvens commented 5 months ago

Re. https://github.com/mlavik1/UnityVolumeRendering/issues/201 and https://github.com/mlavik1/UnityVolumeRendering/issues/199

Adds a simple setting that can be toggled to control automatic normalisation of imported datasets. This setting has been placed in PlayerPrefs rather than EditorPrefs so it can be accessed outside the editor. This could potentially be expanded in the future to have overrides for different file types (ie DICOM, NRRD, etc). The setting will default to non-normalisation.

Additional minor changes:

MichaelOvens commented 5 months ago

The setting will currently default to non-normalisation, but we can flip it around to make it default to normalisation if preferred.

I think non-normalisation is clearer, the only danger is if there's some datasets that have erroneously large scales, but I suspect those will be fairly rare and easy to just re-import with the setting toggled.

mlavik1 commented 5 months ago

Thank you! This is definitely a good setting to have, and I agree that it makes sense to disable normalisaton by default. My main concern was the RAW datasets, but turns out that the dataset scale is (1,1,1) for those anyway, so they don't change :)

I'm away on holiday now, but I'll get back to the updated other issues/PR once I'm back (I saw you commented on one).

Again, I really appreciate all contributions I'm getting, and you've done a lot for this project so far :+1: