Running fs2hcp - edickie/ciftify GitHub Wiki

Running fs2hcp User guide

will convert any freeserfer output directory into an HCP (cifti space) output directory

Usage:
fs2hcp --FSpath=${SUBJECTS_DIR} --HCPpath=${HCP_DATA} --subject=<subid>`

Arguments:
  $SUBJECTS_DIR      The freesurfer subjects directory (usually set to the ${SUBJECTS_DIR} environment variable)
  $HCP_DATA          The hcp data directory (usually set to the ${HCP_DATA} environment variable)
  subid              The subject id to convert

fs2hcp outputs

fs2hcp will result in an hcp folder structure of almost 200 files. The folder structure has two top levels

  • T1w: images and surfaces in "native" space
  • MNINonlinear: images and surfaces that have been transformed to the MNI template using FSL's fnirt

A bit fancier, running fs2hcp on a cluster using qbatch

#!/bin/bash

## set the site variable here
SITE='Utah'

#load the ciftify environment
module load gnu-parallel/20140622
module load /home/a/arisvoin/edickie/quarantine/modules/edickie_quarantine
module load freesurfer/5.3.0
module load FSL/5.0.9
module load Xlibraries ## this is now a prereq for connectome-workbench
module load connectome-workbench/1.1.1
module load hcp-pipelines/3.13.1
module load python/2.7.11-Anaconda2-2.5.0
module load qbatch

export PATH=${PATH}:${HOME}/code/ciftify/bin
export PYTHONPATH=${PYTHONPATH}:${HOME}/code/ciftify/
export HCP_SCENE_TEMPLATES=${HOME}/code/ciftify/data/scene_templates

## paths to the actual data
export SUBJECTS_DIR=${SCRATCH}/CORR/FSout/${SITE}
export HCP_DATA=${SCRATCH}/CORR/hcp/${SITE}

## get the subjects list from the NIIDIR
SUBJECTS=`cd ${SUBJECTS_DIR}; ls -1d 002????s?r?`

## add now the magicks happen...pipes the subject list to the fs2hcp command to qbatch...
mkdir -p $HCP_DATA
cd $HCP_DATA
parallel "echo fs2hcp --FSpath=$SUBJECTS_DIR --HCPpath=$HCP_DATA --subject={}" ::: $SUBJECTS | \
  qbatch --walltime 2:00:00 -c 4 -j 4 --ppj 8 -N fs2hcp${SITE} -
⚠️ **GitHub.com Fallback** ⚠️