AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
July 23, 2020 05:18PM
I think you want two things really -
1. Show a localization cluster in gray and transparent
2. Show a statistic in color, differently transparent

The AFNI GUI is *mostly* limited to a single overlay dataset, but here are some workarounds.

1. Below threshold reduced opacity. At the top of the overlay bar, you can choose to show sub-threshold data with reduced opacity relative to the threshold and above data. That will allow showing the localization cluster as more transparent if you make a dataset that is a hybrid of your datasets.

set beta = func_slim+orig'[1]'
set tstat = func_slim+orig'[2]'
set localclust = quickmask+orig
set tstat_thr = 3.5
set newlocal_val = 0.5

3dcalc -a "$beta" -b "$tstat" -c "$localclust" \
-expr "a*step(b-${tstat_thr}) + \
not(step(b-${tstat_thr}))*step(c)*$newlocal_val" \
-prefix beta_n_clust.nii.gz -overwrite

In the AFNI GUI set the threshold just above the newlocal_val used above, and click on the button labeled 'A' above the Overlay color bar. You can also click 'B' for the box edges. You can experiment with the different color scales too by right-clicking on the color bar and selecting a new color scale. Also explore the paned color bars by clicking on the double asterisks below the color bar and try 20 color panes. Set the pane that corresponds to the values around 0.5 here to set a different color. This combination method is limited in that beta values at or below newlocal_val can't be shown. To get around that, you could add or multiply all the values to make the supra-threshold voxels higher, so a beta of 3 might show up as 4 just by adding 1.

2. Make the cluster an atlas. One of the few exceptions to not allowing for multiple overlays is that an atlas can be shown as another layer. You just have to convert your cluster ROI to an atlas and set an environment variable to tell AFNI to use that atlas. The datasets need to be marked as all being in a standard space too.

# make a simple label table to use for the atlas (here for two regions named act and deact where act=1, deact=2)
cat act_deact.txt
1 act
2 deact

# turn the mask dataset into an atlas
@Atlasize -dset act_deact+tlrc. -atlas_name act_deact -atlas_description "activation or deactivation" \
-atlas_type S -space MNI -lab_file act_deact.txt 1 0

# the act_deact dataset is a new "Session atlas"
whereami -show_atlases

++ act_deact TT_N27 act_deact+tlrc. activation or deactivation


# start afni GUI to show new Atlas colors
afni -DAFNI_ATLAS_COLORS=act_deact

In the AFNI GUI, right-click on any image viewer and select "Atlas colors". The region will

3. Simulate opacity in anatomical underlay (grayscale usually)
set anat = anat+orig
set graylev = `3dBrickStat -percentile 75 75 0 -non-zero $anat`
set opacity = 0.4444
3dresample -prefix lc_anat.nii.gz -master "$anat" -input $localclust -overwrite
3dcalc -a "$anat" -b lc_anat.nii.gz -expr "a*(1-$opacity)+step(b)*$opacity*${graylev[2]}" \
-prefix lc_anat.gray.nii.gz -overwrite

Now just make the anatomical-cluster hybrid dataset the underlay. The cluster mask will show up as a "translucent" region, and the overlay controls are the usual.
Subject Author Posted

Color transparency customization in viewer Attachments

rwaugh July 23, 2020 03:20PM

Re: Color transparency customization in viewer

ptaylor July 23, 2020 04:00PM

Re: Color transparency customization in viewer

rwaugh July 23, 2020 04:10PM

Re: Color transparency customization in viewer

ptaylor July 23, 2020 04:26PM

Re: Color transparency customization in viewer

rwaugh July 23, 2020 04:30PM

Re: Color transparency customization in viewer

ptaylor July 23, 2020 05:44PM

Re: Color transparency customization in viewer

Daniel Glen July 23, 2020 05:18PM

Re: Color transparency customization in viewer

rwaugh July 24, 2020 10:50AM