There is some additional processing that needs to be carried out before you can do your longitudinal analysis (these steps are detailed on the FreeSurfer Wiki ) You should have already completed the CROSS steps (either with the FreeSurfer or FastSurfer scripts found here. Scripts and instructions for the BASE and LONG steps can be found on this page.
You will need to edit the scripts if your timepoints do not all end in “_MRX” (where X is the number for the timepoint, for example “Control_001_MR1”).
The script for the Base processing is below. You need to fill in the Project name at the top and on the line with export SUBJECTS_DIR, so that this variable reflects where your pre-processed subject folders are. When submitting the script you need to create a list of all the BASE IDs (ie Control_001) rather than the time point IDs (ie Control_001_MR1).
#PBS -P #PBS -N BASE_processing #PBS -l select=1:ncpus=2:ngpus=1:mem=32GB #PBS -q=main #PBS -l walltime=10:00:00 #PBS -q defaultQ module load python/3.6.5 module load openmpi-gcc/3.1.3 module load cuda/10.0.130 module load mrtrix3tissue/5.2.7 module load singularity/3.5.3 module load fsl/6.0.3 module load ants/2.3.2 module load mrtrix3/3.0.1 module load freesurfer/6.0.0 source $FREESURFER_HOME/SetUpFreeSurfer.sh export SUBJECTS_DIR=/scratch/ProjectPreprocessing # CODE FOR TERMINAL # list='XXX_XXX # XXX_XXX # XXX_XXX' # for i in $list ; do qsub -v base=$i FS_BASE_Processing.pbs; done cd $SUBJECTS_DIR time_points=$(find ${SUBJECTS_DIR} -iname "${base}_MR*") NumTPs=( $time_points ) if [[ ${#NumTPs[@]} = 2 ]] then recon-all -base $base -tp ${base}_MR1 -tp ${base}_MR2 -all -openmp 4 elif [[ ${#NumTPs[@]} = 3 ]] then recon-all -base $base -tp ${base}_MR1 -tp ${base}_MR2 -tp ${base}_MR3 -all -openmp 4 elif [[ ${#NumTPs[@]} = 4 ]] then recon-all -base $base -tp ${base}_MR1 -tp ${base}_MR2 -tp ${base}_MR3 -tp ${base}_MR4 -all -openmp 4 elif [[ ${#NumTPs[@]} = 5 ]] then recon-all -base $base -tp ${base}_MR1 -tp ${base}_MR2 -tp ${base}_MR3 -tp ${base}_MR4 -tp ${base}_MR5 -all -openmp 4 elif [[ ${#NumTPs[@]} = 6 ]] then recon-all -base $base -tp ${base}_MR1 -tp ${base}_MR2 -tp ${base}_MR3 -tp ${base}_MR4 -tp ${base}_MR5 -tp ${base}_MR6 -all -openmp 4 elif [[ ${#NumTPs[@]} = 7 ]] then recon-all -base $base -tp ${base}_MR1 -tp ${base}_MR2 -tp ${base}_MR3 -tp ${base}_MR4 -tp ${base}_MR5 -tp ${base}_MR6 -tp ${base}_MR7 -all -openmp 4 else # if there is only one timepoint echo 'there is either only one timepoint (no longitudinal data) or there are more than 8, please edit the script." fi
0 Comments