open-discussion > Improving visualization of clusters in MRIcroGL - Finding corresponding AFNI colormap "Reds_and_blues_Inv" in MRIcroGL?
Showing 1-3 of 3 posts
Display:
Results per page:
Jul 10, 2024  04:07 PM | benedetta cecconi
Improving visualization of clusters in MRIcroGL - Finding corresponding AFNI colormap "Reds_and_blues_Inv" in MRIcroGL?

Hello,


I have completed an analysis in Afni, where my clusters are clearly rendered in their GUI with distinct red and blue colors (colormap "Reds_and_Blues_Inv") - see the attached picture "precuneus":



However, when I plot these clusters in MRIcroGL to have nicer definition/view etc, I can't find a suitable colormap or method to enhance the colors effectively and show the clusters nicely. Clusters look grainy/blurred and the final image is either elegant nor clear, even if this mosaic view would be very nice to visualize our results: 

 


To generate the above image, I used this script in MRIcroGL:


import gl


# Reset default settings and set the background color
gl.resetdefaults()
gl.backcolor(255, 255, 255)


# Load the background image
#gl.loadimage(‘mni152’)  


# Load the overlay containing all clusters
gl.overlayload("/Users/benedetta/3dlmer/results/Model_ROI_gm_SoundsSilence_240709/Clus_allsounds_cc_dc_100+orig.HEAD")


# Set the min and max for the overlay, with the specified range
gl.minmax(1, -1.515, 1.515)


# Set the color map to "blue2red"
gl.colorname(1, "blue2red")


# Set the color bar position
gl.colorbarposition(0)


# Configure the mosaic display for axial, coronal, and sagittal views
gl.mosaic("A R 0 C R 0 S R 0; A R -0 C R -0 S R -0")


I tried adding options "gl.overlayfuzziness" or "gl.overlaydepthpeel" but then it switched to the render view, dropping the mosaic one I need...I also tried to smooth the data in Afni but didn't get the expected results (clusters became way bigger and chunkier)...

Can someone give me some advice on how to improve the visualization of these results? I attach here, in case needed, the Afni HEAD/BRIK files that I'm trying to plot..

Any suggestion would be really appreciated :)

Thanks a lot in advance 

Jul 10, 2024  04:07 PM | Chris Rorden
RE: Improving visualization of clusters in MRIcroGL - Finding corresponding AFNI colormap "Reds_and_blues_Inv" in MRIcroGL?

I would suggest you look at the documentation


  https://www.nitrc.org/plugins/mwiki/inde...


First of all, it really helps visualization if you load an unthresholded image as an overlay, and subsequently apply a thresholding value (the minmax range). When you threshold an image, you artificially set all non-significant voxels to be zero, and since the data is smooth the surviving clusters are surrounded by neighbors of zeros instead of near-threshold values. This causes artificially dark interpolation.


The other option is to use nearest neighbor interpolation, which will cause jagged images:


gl.overlayloadsmooth(0)


The scripting/templates/jagged menu item illustrates this issue.


 

Jul 11, 2024  04:07 AM | benedetta cecconi
RE: Improving visualization of clusters in MRIcroGL - Finding corresponding AFNI colormap "Reds_and_blues_Inv" in MRIcroGL?

That's very helpful! thank you for your reply :)


It indeed improved visualization to not use thresholded maps.


Thank you,