rordenlab / MRIcroGL

v1.2 GLSL volume rendering. Able to view NIfTI, DICOM, MGH, MHD, NRRD, AFNI format images.
https://www.nitrc.org/plugins/mwiki/index.php/mricrogl:MainPage
Other
197 stars 31 forks source link

add new option to not modulate alpha by voxel value? #21

Closed hanayik closed 3 years ago

hanayik commented 3 years ago

MRIcroGL version: 1.2.20200707e Cocoa x86-64

@neurolabusc , some regions with low integer values in atlases rendered in 3D mode appear more transparent than high integer label regions.

For example, an atlas image with integer labels ranging from 1-140 (background == 0) will render regions with low values (1,2,3...) as more transparent.

Would it be possible to add a toggle setting in preferences to disable alpha modulation by voxel intensity?

No rush on this. Just submitting the issue as a possible enhancement for the future.

FSLeyes has recently added this feature in the master branch (not released), and it can be useful to toggle that switch when viewing some images.

I would be happy to help implement this. It would take some time to get up to speed with the MRIcroGL build system and code base.

https://git.fmrib.ox.ac.uk/fsl/fsleyes/fsleyes/-/blob/master/assets/gl/gl21/glvolume_3d_frag.glsl#L404

https://github.com/rordenlab/MRIcroGL12/blob/70d20ec1f1fb913e7efe5861e8d9dbb6ac77f52b/Resources/shader/Default.glsl#L51

atlas shown in screenshots:

https://git.fmrib.ox.ac.uk/open-science/UK_biobank_pipeline_v_1/-/raw/master/templates/GMatlas/GMatlas.nii.gz?inline=false

example MRIcroGL screenshot:

Screenshot 2021-03-03 at 17 48 00

FSLeyes with intensity modulation

Screenshot 2021-03-03 at 17 58 36

FSLeyes WITHOUT intensity modulation

Screenshot 2021-03-03 at 17 59 05
neurolabusc commented 3 years ago

@hanayik this is an issue with FSL not MRIcroGL. The NIfTI header does not correctly specify the intent_code as NIFTI_INTENT_LABEL. If this is set, the image will be displayed correctly with MRIcroGL. Please fix upstream.

atlas

hanayik commented 3 years ago

Nice, that's an easy solution! Thanks @neurolabusc!