Maps with just contour

AFNI version info (afni -ver): 24.0
Hellp, how are you?
I'm trying to create maps using afni and suma that will have one statistical maps in them and on top of it just the contour of another map. Im a bit lost. how can i do it?
Thank you,
Michal

Hi, Michal-

Just so I can picture it, is the contour supposed to be something like an ROI boundary from a separate dataset? Or is the contour something related to the statistical map itself.

--pt

Hi Paul,
I want to load one statstical map and then put the borders of another on top of it. and control the color and thickness of the contour.
Thank you,

There are a few ways to do this - some easier than others.

  1. Create a new composite dataset with an edge built in using 3dDepthMap
# resample to anatomical resolution if desired
3dresample -prefix Clust_mask_rs.nii.gz -master anat+orig. \
    -inset Clust_mask+orig. -rmode NN -overwrite
# compute edge by depth, change rimify parameter to larger depth
# for thicker edges
3dDepthMap -zeros_are_zero -prefix clust_depth.nii.gz \
    -rimify 1.0 -overwrite -input Clust_mask_rs.nii.gz
# resample statistical dataset (could just do single subbrick instead)
3dresample -prefix func_slim_rs.nii.gz -master anat+orig. -inset func_slim+orig.
# compute composite dataset of original clusters with rimified edges
# set the rim to a specific value - here 4.0, 
# but you may use a value at the maximum or negative
3dcalc -a func_slim_rs.nii.gz'[1]' -b clust_depth.nii.gz -c Clust_mask_rs.nii.gz \
   -expr 'a*not(b)*step(c)+step(b)*4.00' -prefix clust_rim_stat_rs2.nii.gz

Display with any colorbar, but this one is the amber_redtop for a distinct color. Set the range to match the value used for the rim (4.00 in this case).

  1. Compute IsoSurface and use surface contours
    Save clusters with clusterize plugin or 3dClusterize command.
IsoSurface -input Clust_mask+orig. -isorois+dsets -o Clust.gii
suma -onestate -i Clust*.gii -sv anat+orig

Talk between suma and afni with 't' key.
Control thickness and colors of contours with "Control Surface" menu.


  1. Add edges with B - box mode.
    No coding here, just click the B box in the overlay menu, but you can set the color through an environment variable. This doesn't work across two different datasets, but I'm including it here just to have a more complete list for others.
afni -DAFNI_FUNC_BOXED_COLOR=yellow

  1. Chauffeur afni to make composite images.
@chauffeur_afni                       \
        -olay  func_slim+orig'[3]'        \
        -ulay  Clust_mask+orig.           \
        -opacity 4                        \
      -edgy_ulay                        \
      -func_range 2.0  \
      -cbar    Reds_and_Blues_Inv  -prefix Clust_edge

aiv Clust_edge.axi.png

  1. Create temporary atlas using rimified edges, and use "Show Atlas Colors"
3dcalc -a clust_depth.nii.gz -b Clust_mask_rs.nii.gz \
    -expr 'step(a)*b' -prefix clust_rim_atlas.nii.gz
# create simple label file with labels like 
cat > templabels.txt
1 ROI1
2 ROI2
3 ROI3
...
Ctrl-C to exit
# create new session atlas (makes SessionAtlases.niml in current directory)
@Atlasize -lab_file templabels.txt 1 0 -dset clust_rim_atlas.nii.gz -atlas_name TEMPATLAS -atlas_type S

afni -DAFNI_ATLAS_COLORS=TEMPATLAS

You can combine the methods to show both contours from suma surface and any of the other kinds of edges too.