Skip to content

ciftify_recon_all Usage

edickie edited this page Aug 30, 2017 · 2 revisions

ciftify_recon_all will convert any freesurfer recon-all output folder into an HCP style folder structure.

This is adapted from sections of Human Connectome Projects Minimal Processing Pipeline described in this article and available in this github repo.

The Minimal Processing Pipeline scripts require that a minimum number of HCP standard acquisitions (i.e. T1w, High Resolution T2w, etc) are present. ciftify_recon_all has been adapted from these scripts to convert ANY freesurfer output into an HCP like folder structure. It also output less intermediate (unnecessary) files in the process and does standard logging to an ciftify_recon_all.log file.

Usage:
  ciftify_recon_all [options] <Subject>

Arguments:
    <Subject>               The Subject ID in the HCP data folder

Options:
  --hcp-data-dir PATH         Path to the HCP_DATA directory (overides the HCP_DATA environment variable)
  --fs-subjects-dir PATH      Path to the freesurfer SUBJECTS_DIR directory (overides the SUBJECTS_DIR environment variable)
  --resample-LowRestoNative   Resample the 32k Meshes to Native Space (creates additional output files)
  -v,--verbose                Verbose logging
  --debug                     Debug logging 
  -h,--help                   Print help

Required Inputs

Three arguments are required for ciftify_recon_all to run:

  • The freesurfer SUBJECTS_DIR is the top directory structure holding all freesurfer outputs for a sample. It can be defined either by setting the $SUBJECTS_DIR environment variable or using optional --fs-subjects-dir argument
  • The HCP_DATA directory is top directory holding the HCP outputs. It can be defined either by setting the $HCP_DATA environment variable or using the optional --hcp-data-dir argument
  • The subject id of the participant to process. I needs to match the folder name for that subject within the freesurfer SUBJECTS_DIR.

Usage Examples

Run ciftify_recon_all after defining environment variables

export SUBJECTS_DIR=/path/to/freesurfer/outputs
export HCP_DATA=/path/for/hcp/outputs            ## will be created by fs2hcp if is does not exist
ciftify_recon_all Subject001

Running the same command without first defining environment variables

ciftify_recon_all --fs-subjects-dir /path/to/freesurfer/outputs --hcp-data-dir /path/for/hcp/outputs Subject001

The output directory structure

0025362s1r1
├── ciftify_recon_all.log
├── MNINonLinear
│   ├── 0025362s1r1.164k_fs_LR.wb.spec
│   ├── 0025362s1r1.aparc.164k_fs_LR.dlabel.nii
│   ├── 0025362s1r1.aparc.a2009s.164k_fs_LR.dlabel.nii
│   ├── 0025362s1r1.aparc.DKTatlas.164k_fs_LR.dlabel.nii
│   ├── 0025362s1r1.ArealDistortion_FS.164k_fs_LR.dscalar.nii
│   ├── 0025362s1r1.BA_exvivo.164k_fs_LR.dlabel.nii
│   ├── 0025362s1r1.curvature.164k_fs_LR.dscalar.nii
│   ├── 0025362s1r1.L.atlasroi.164k_fs_LR.shape.gii -> ../../zz_templates/L.atlasroi.164k_fs_LR.shape.gii
│   ├── 0025362s1r1.L.flat.164k_fs_LR.surf.gii -> ../../zz_templates/colin.cerebral.L.flat.164k_fs_LR.surf.gii
│   ├── 0025362s1r1.L.inflated.164k_fs_LR.surf.gii
│   ├── 0025362s1r1.L.midthickness.164k_fs_LR.surf.gii
│   ├── 0025362s1r1.L.pial.164k_fs_LR.surf.gii
│   ├── 0025362s1r1.L.sphere.164k_fs_LR.surf.gii -> ../../zz_templates/fsaverage.L_LR.spherical_std.164k_fs_LR.surf.gii
│   ├── 0025362s1r1.L.very_inflated.164k_fs_LR.surf.gii
│   ├── 0025362s1r1.L.white.164k_fs_LR.surf.gii
│   ├── 0025362s1r1.R.atlasroi.164k_fs_LR.shape.gii -> ../../zz_templates/R.atlasroi.164k_fs_LR.shape.gii
│   ├── 0025362s1r1.R.flat.164k_fs_LR.surf.gii -> ../../zz_templates/colin.cerebral.R.flat.164k_fs_LR.surf.gii
│   ├── 0025362s1r1.R.inflated.164k_fs_LR.surf.gii
│   ├── 0025362s1r1.R.midthickness.164k_fs_LR.surf.gii
│   ├── 0025362s1r1.R.pial.164k_fs_LR.surf.gii
│   ├── 0025362s1r1.R.sphere.164k_fs_LR.surf.gii -> ../../zz_templates/fsaverage.R_LR.spherical_std.164k_fs_LR.surf.gii
│   ├── 0025362s1r1.R.very_inflated.164k_fs_LR.surf.gii
│   ├── 0025362s1r1.R.white.164k_fs_LR.surf.gii
│   ├── 0025362s1r1.sulc.164k_fs_LR.dscalar.nii
│   ├── 0025362s1r1.thickness.164k_fs_LR.dscalar.nii
│   ├── aparc.a2009s+aseg.nii.gz
│   ├── aparc+aseg.nii.gz
│   ├── brainmask_fs.nii.gz
│   ├── fsaverage_LR32k
│   │   ├── 0025362s1r1.32k_fs_LR.wb.spec
│   │   ├── 0025362s1r1.aparc.32k_fs_LR.dlabel.nii
│   │   ├── 0025362s1r1.aparc.a2009s.32k_fs_LR.dlabel.nii
│   │   ├── 0025362s1r1.aparc.DKTatlas.32k_fs_LR.dlabel.nii
│   │   ├── 0025362s1r1.ArealDistortion_FS.32k_fs_LR.dscalar.nii
│   │   ├── 0025362s1r1.BA_exvivo.32k_fs_LR.dlabel.nii
│   │   ├── 0025362s1r1.curvature.32k_fs_LR.dscalar.nii
│   │   ├── 0025362s1r1.L.atlasroi.32k_fs_LR.shape.gii -> ../../../zz_templates/L.atlasroi.32k_fs_LR.shape.gii
│   │   ├── 0025362s1r1.L.flat.32k_fs_LR.surf.gii -> ../../../zz_templates/colin.cerebral.L.flat.32k_fs_LR.surf.gii
│   │   ├── 0025362s1r1.L.inflated.32k_fs_LR.surf.gii
│   │   ├── 0025362s1r1.L.midthickness.32k_fs_LR.surf.gii
│   │   ├── 0025362s1r1.L.pial.32k_fs_LR.surf.gii
│   │   ├── 0025362s1r1.L.sphere.32k_fs_LR.surf.gii -> ../../../zz_templates/L.sphere.32k_fs_LR.surf.gii
│   │   ├── 0025362s1r1.L.very_inflated.32k_fs_LR.surf.gii
│   │   ├── 0025362s1r1.L.white.32k_fs_LR.surf.gii
│   │   ├── 0025362s1r1.R.atlasroi.32k_fs_LR.shape.gii -> ../../../zz_templates/R.atlasroi.32k_fs_LR.shape.gii
│   │   ├── 0025362s1r1.R.flat.32k_fs_LR.surf.gii -> ../../../zz_templates/colin.cerebral.R.flat.32k_fs_LR.surf.gii
│   │   ├── 0025362s1r1.R.inflated.32k_fs_LR.surf.gii
│   │   ├── 0025362s1r1.R.midthickness.32k_fs_LR.surf.gii
│   │   ├── 0025362s1r1.R.pial.32k_fs_LR.surf.gii
│   │   ├── 0025362s1r1.R.sphere.32k_fs_LR.surf.gii -> ../../../zz_templates/R.sphere.32k_fs_LR.surf.gii
│   │   ├── 0025362s1r1.R.very_inflated.32k_fs_LR.surf.gii
│   │   ├── 0025362s1r1.R.white.32k_fs_LR.surf.gii
│   │   ├── 0025362s1r1.sulc.32k_fs_LR.dscalar.nii
│   │   └── 0025362s1r1.thickness.32k_fs_LR.dscalar.nii
│   ├── Native
│   │   ├── 0025362s1r1.aparc.a2009s.native.dlabel.nii
│   │   ├── 0025362s1r1.aparc.DKTatlas.native.dlabel.nii
│   │   ├── 0025362s1r1.aparc.native.dlabel.nii
│   │   ├── 0025362s1r1.ArealDistortion_FS.native.dscalar.nii
│   │   ├── 0025362s1r1.BA_exvivo.native.dlabel.nii
│   │   ├── 0025362s1r1.curvature.native.dscalar.nii
│   │   ├── 0025362s1r1.L.inflated.native.surf.gii
│   │   ├── 0025362s1r1.L.midthickness.native.surf.gii
│   │   ├── 0025362s1r1.L.pial.native.surf.gii
│   │   ├── 0025362s1r1.L.roi.native.shape.gii
│   │   ├── 0025362s1r1.L.sphere.native.surf.gii
│   │   ├── 0025362s1r1.L.sphere.reg.native.surf.gii
│   │   ├── 0025362s1r1.L.sphere.reg.reg_LR.native.surf.gii
│   │   ├── 0025362s1r1.L.very_inflated.native.surf.gii
│   │   ├── 0025362s1r1.L.white.native.surf.gii
│   │   ├── 0025362s1r1.native.wb.spec
│   │   ├── 0025362s1r1.R.inflated.native.surf.gii
│   │   ├── 0025362s1r1.R.midthickness.native.surf.gii
│   │   ├── 0025362s1r1.R.pial.native.surf.gii
│   │   ├── 0025362s1r1.R.roi.native.shape.gii
│   │   ├── 0025362s1r1.R.sphere.native.surf.gii
│   │   ├── 0025362s1r1.R.sphere.reg.native.surf.gii
│   │   ├── 0025362s1r1.R.sphere.reg.reg_LR.native.surf.gii
│   │   ├── 0025362s1r1.R.very_inflated.native.surf.gii
│   │   ├── 0025362s1r1.R.white.native.surf.gii
│   │   ├── 0025362s1r1.sulc.native.dscalar.nii
│   │   └── 0025362s1r1.thickness.native.dscalar.nii
│   ├── Results
│   ├── ROIs
│   │   ├── Atlas_ROIs.2.nii.gz -> ../../../zz_templates/Atlas_ROIs.2.nii.gz
│   │   └── ROIs.2.nii.gz
│   ├── T1w.nii.gz
│   ├── wmparc.nii.gz
│   └── xfms
│       ├── NonlinearReg_fromlinear.log
│       ├── Standard2T1w_warp_noaffine.nii.gz
│       ├── T1w2StandardLinear.mat
│       └── T1w2Standard_warp_noaffine.nii.gz
└── T1w
    ├── aparc.a2009s+aseg.nii.gz
    ├── aparc+aseg.nii.gz
    ├── brainmask_fs.nii.gz
    ├── Native
    │   ├── 0025362s1r1.L.inflated.native.surf.gii
    │   ├── 0025362s1r1.L.midthickness.native.surf.gii
    │   ├── 0025362s1r1.L.pial.native.surf.gii
    │   ├── 0025362s1r1.L.very_inflated.native.surf.gii
    │   ├── 0025362s1r1.L.white.native.surf.gii
    │   ├── 0025362s1r1.native.wb.spec
    │   ├── 0025362s1r1.R.inflated.native.surf.gii
    │   ├── 0025362s1r1.R.midthickness.native.surf.gii
    │   ├── 0025362s1r1.R.pial.native.surf.gii
    │   ├── 0025362s1r1.R.very_inflated.native.surf.gii
    │   └── 0025362s1r1.R.white.native.surf.gii
    ├── T1w_brain.nii.gz
    ├── T1w.nii.gz
    └── wmparc.nii.gz

8 directories, 106 files
Clone this wiki locally