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 authors, 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.stats> [-f <data_file2.stats>] [-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.stats> specified, following the naming convention "<data_file>_concat.txt". Data files are expected in the structure SUBJECTS_DIR/<subject>/stats/<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.stats -f rh.hippoSfVolumes-T1.v21.stats -f lh.hippoSfVolumes-T1.v21.stats -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 2024-07-29 14:25:49 by JacksonNolan)