Script to concatenate volumetric measurements from subregion segmentation modules

Authors: Jackson Nolan and Juan Eugenio Iglesias
E-mail: JNOLAN5 [at] mgh.harvard.edu and jiglesiasgonzalez [at] mgh.harvard.edu

Rather than directly contacting the authosr, please post your questions on this module to the FreeSurfer mailing list at freesurfer [at] nmr.mgh.harvard.edu

1. Motivation and General Description

Our modules to segment ThalamicNuclei, BrainstemSubstructures, HippocampalSubfieldsAndNucleiOfAmygdala, LongitudinalHippocampalSubfields, SubregionSegmentation writes the volumes of every ROI (in mm3) to each subject's mri directory. While each of these modules came with its own tool to merge all the volumes from all subjects into a single spreadsheet, we have consolidated them all into a single, more flexible tool: ConcatenateSubregionsResults.

2. Usage

ConcatenateSubregionsResults.sh -f <data_file.txt> [-f <data_file2.txt>] [-o <out_dir>] [-s SUBJECTS_DIR]

Concatenates stats from the files specified with the -f flag, for all subjects found in the SUBJECTS_DIR into a single file. A file will be generated for each <data_file.txt> specified, following the naming convention "<data_file>_concat.txt". Data files are expected in the structure SUBJECTS_DIR/<subject>/mri/<data_file.txt> Output files will be created in the SUBJECTS_DIR by default but can be redirected with the -o flag. If the -s flag is not passed, the FreeSurfer 'SUBJECTS_DIR' env var will be used.

Example:

ConcatenateSubregionsResults.sh -f brainstemSsVolumes.v12.txt -f rh.hippoSfVolumes-T1.v21.txt -f lh.hippoSfVolumes-T1.v21.txt -s $PWD

The above command will concatenate the stats for all subjects in the current working directory, for the specified files. The script will output 3 files in the current working directory:

ConcatenateSubregionsResults (last edited 2023-11-20 13:15:16 by JuanIglesias)