Talairach alignment evaluation

Hi all,

I,m trying to align my anatomical data to the TT_N27+tlrc template,
but the gyrus and sulcus are not aligned very well so I tried different ways such as auto_warp.py and @auto_tlrc,
I wonder if there is a commend or something else in AFNI could help me to evaluate the results of Talairach alignment?

Best regards,
Sue

I wrote the @snapshot_volreg script to provide images to look at for this purpose. In your case, you would provide the (hopefully) aligned subject anatomy as one input dataset, and the template (TT_N27) as the other. See the output of "@snapshot_volreg -help"or https://afni.nimh.nih.gov/pub/dist/doc/program_help/@snapshot_volreg.html

Hi Bob,

Thanks a lot for your advice and it seems to be a suitable method for me.
But it requires the netpbm11 software, which is difficult to install on my ubuntu 16.04 system:(, I’ll keep trying.
I wonder if the script @AddEdge can also reach my goal?

Best regards,
Sue

Hi, Sue-

If you have a pretty new version of AFNI, there is actually a program (in beta testing) that wraps around some of the AFNI functionality for driving “afni” itself, making and saving images, called @chauffer_afni. Attached is a script (below) that will take one volume as underlay and another as overlay, “edgify” the latter, and save montages of images. I find it useful for judging alignment. It takes 4 required arguments, which are (in this order):

  • underlay volume (3D)
  • overlay volume (3D)
  • directory location of output
  • prefix of output images (simple prefix-- no path part).

So, you could use it, for example, as:


tcsh -e fat_tort_qc_viewer_3d_edgey.tcsh TT_N27+tlrc mprage_aligned.nii.gz . check_align

(note the use of the ‘.’ as the 3rd input: that means, put the output in “this” directory in this case)

–pt


#!/bin/tcsh -e

#######################################################################
# Simple imager for 3D volume, ulay with an edge-ified olay.  Makes a
# montage of multiple slices from single volume, in each of the axi,
# sag and cor planes.
#
# v1.0
# 31 July 2017
# by PA Taylor, NIMH/NIH.
#
# Example usage:
#   
#   # Make an image with prefix "t1w_u_et2w in the same directory as
#   # the t1w and t2w NIFTI volumes of interest
#   tcsh -e fat_tort_qc_viewer_3d_edgey.tcsh \
#       t1w.nii                              \
#       t2w.nii                              \
#       .                                    \
#       t1w_u_et2w
#
#######################################################################

set ulay   = "$1"   # ULAY input volume, relative or full path
set olay   = "$2"   # OLAY input volume, relative or full path
set odir   = "$3"   # output dir, part or full path
set vpref1 = "$4"   # output prefix for naming, part or full path

if ( "$vpref1" == "" ) then
    echo "** ERROR: need four inputs:"
    echo "     input 3D vol (ulay)"
    echo "     input 3D vol (olay)"
    echo "     output dir"
    echo "     output pref"
    exit 1
endif

# --------------------------------------------------------------------

# Make temp working dir
set tmp_code = `3dnewid -fun11`    # should be essentially unique hash
set wdir  = "$odir/__WDIR_${tmp_code}"
set DO_CLEAN = 1

if ( ! -e $wdir ) then
    echo "\n++ Making temporary wdir: '$wdir'\n"
    \mkdir $wdir
endif

# ------------------ make edgey vol ----------------
    echo "\n++ Making edge vol.\n"
set fin  = $olay
set fout = "$wdir/tmp_olay_edge.nii.gz"
3dedge3                         \
    -overwrite                  \
    -prefix $fout               \
    -input  $fin

echo "++ OK, going to making image."

# ----------------- view stuff -----------------
@chauffeur_afni \
    -ulay "$ulay"                     \
    -ulay_range "2%" "98%"            \
    -olay "$fout"                     \
    -func_range_perc 50               \
    -pbar_posonly                     \
    -cbar "red_monochrome"            \
    -opacity 6                        \
    -prefix $vpref1                   \
    -outdir "$odir"                   \
    -montx 5 -monty 3                 \
    -set_xhairs OFF                   \
    -label_mode 1 -label_size 3       \
    -do_clean 

# clean, by default
if ( "$DO_CLEAN" == "1" ) then
    echo "\n++ Cleaning working directory!\n"
    \rm -rf $wdir
else
    echo "\n++ NOT removing working directory '$wdir'.\n"
endif

echo "++ Made image of input file:"
echo "       $ulay under (edge-ified) $olay"
echo "++ Images stored: $odir/$vpref1"

exit 0


Hi Sue,

I was able to use @snapshot_volreg on Ubuntu 16
after installing packages netpbm and xvfb.

  • rick

Hi AFNI friends,

Thank you sooooo much for your help!!!:slight_smile:
My problem has been solved now, I couldn’t run the script @snapshot_volreg and @chauffeur_afni because of the missing of xvfb package rather than netpbm package.
Thank you again.

Best regards,
Sue