aparcstats2table

Introduction

This script will generate text/ascii tables of freesurfer parcellation stats data, ?h.aparc.stats. This can then be easily imported into a spreadsheet and/or stats program.

Usage

Converts a cortical stats file created by recon-all and or mris_anatomical_stats (eg, ?h.aparc.stats) into a table in which each line is a subject and each column is a parcellation. By default, the values are the area of the parcellation in mm2. The first row is a list of the parcellation names. The first column is the subject name. If the measure is thickness then the last column is the mean cortical thickness.

The subjects list can be specified on either of two ways:

  1. Specify each subject after a -s flag
    • -s subject1 -s subject2 ... --hemi lh
  2. Specify all subjects after --subjects flag. --subjects does not have
    • to be the last argument. Eg:
      • --subject subject1 subject2 ... --hemi lh

By default, it looks for the ?h.aparc.stats file based on the Killiany/Desikan parcellation atlas. This can be changed with '--parc parcellation' where parcellation is the parcellation to use. An alternative is aparc.a2005s which was developed by Christophe Destrieux. If this file is not found, it will exit with an error unless --skip in which case it skips this subject and moves on to the next.

By default, the area (mm2) of each parcellation is reported. This can be changed with '--meas measure', where measure can be area, volume (ie, volume of gray matter), thickness, thicknessstd, or meancurv. thicknessstd is the standard dev of thickness across space.

Sample Command line

aparcstats2table --subjects bert ernie fred margaret --hemi rh --meas thickness --tablefile aparc_stats.txt

This will combine the rh.aparc.stats files for the subjects bert, ernie, fred, and margaret to generate one table, aparc_stats.txt, that will report the thickness of all the structures labeled in rh.aparc.annot. The resulting file can be imported into any spreadsheet program.

If you'd rather get your information from the alternate parcellation, ?h.aparc.a2005s.annot, you can specify this on your command line with  --parc aparc.a2005s. Also, if you'd like something other than thickness you can specify this with --meas and specify area, volume, or meancurv.

 aparcstats2table --hemi lh --subjects 004 008 --parc aparc.a2005s --meas meancurv --tablefile lh.a2005s.meancurv.txt

lh.a2005s.meancurv.txt will have 3 rows: (1) 'header' with the name of each structure, (2) mean curvature for each structure for subject