Configure preproc-sess
You can preprocess multiple participants in a batch or individual participants, depending on how you invoke the preproc-sess command.
Create a subjectname file
The first thing you will need to do is create a file called subjectname
in the folders for each of the participants you will be preprocessing. This file contains only a single line, indicating the Freesurfer subjectid by which that subject is known. For example, for the subject whose data is in $SUBJECTS_DIR/FS_T1_501/, there should be a file called subjectname that contains just a single line:
FS_T1_501
If such a file does not exist, create it:
cd $SUBJECTS_DIR/FS_T1_501 echo FS_T1_501 > subjectname
Or, if you want to be fancy and not have to type out the name of the participant, you can use the output of the 'basename' linux command to generate the name of your directory, which should match your participant name:
cd $SUBJECTS_DIR/FS_T1_501 echo `basename "$PWD"` > subjectname
Using this method, the second command will always be the same for any participant.
Batch processing
Batch processing requires a sessid file containing the session names (i.e., the names of all the Freesurfer folders) for all your participants. The sessid file can be called anything you wish, and is simply a plain text file with one folder name on each line. For example:
chris_subjects.txt: FS_T1_501 FS_T2_501 FS_T1_505 FS_T2_505
When doing a batch, you call using the -sf switch:
preproc-sess -sf <sessidfile> -df <srchdirfile> [options]
e.g.,
preproc-sess -sf chris_subjects.txt -surface self lhrh -fwhm 6 -per-run -fsd bold
If the -df
switch isn't provided (it doesn't seem to be mandatory) then it uses a default directory (possibly $SUBJECTS_DIR, or possibly your current working directory) to start in.
Individuals
Preprocessing individuals works pretty much the same, except you do not require a sessid file. Instead, you provide it with the name of one of the session folders, and use the -s
switch, rather than the -sf
switch:
preproc-sess -per-run -fwhm 6 -surface self lhrh -fsd bold -s FS_T1_501
Output
-------------------------------------------------------------- preproc-sess logfile is log/preproc-sess.FS_T1_501.log -------------------------------------------------------------- $Id: preproc-sess,v 1.45.2.3 2013/01/22 22:09:10 greve Exp $ chris setenv FREESURFER_HOME /usr/local/freesurfer setenv SUBJECTS_DIR /home/chris/ubfs/cpmcnorg/openfmri/booth Linux wernickesarea 3.13.0-85-generic #129-Ubuntu SMP Thu Mar 17 20:50:15 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux /home/chris/ubfs/cpmcnorg/openfmri/booth /usr/local/freesurfer/fsfast/bin/preproc-sess -s FS_T1_501 -df ./ -surface self lhrh -fwhm 6 -per-run -fsd bold Fri Apr 15 12:41:05 EDT 2016 instem f mc 1 f fmcpr stc 0 fmcpr sm 0 mask 1 brain FS_T1_501 Template ----------------------------- mktemplate-sess -s FS_T1_501 -d /home/chris/ubfs/cpmcnorg/openfmri/booth -fsd bold -update Session: /home/chris/ubfs/cpmcnorg/openfmri/booth/FS_T1_501 ---------------- Fri Apr 15 12:41:05 EDT 2016 Detected input format at nii FS_T1_501 Update not needed Run: 005 ---------------- Fri Apr 15 12:41:06 EDT 2016 FS_T1_501 005 Update not needed Run: 006 ---------------- Fri Apr 15 12:41:06 EDT 2016 FS_T1_501 006 Update not needed Fri Apr 15 12:41:06 EDT 2016 mktemplate-sess completed FS_T1_501 Mask ------------------------ mkbrainmask-sess -maskstem brain -fsd bold -s FS_T1_501 -d /home/chris/ubfs/cpmcnorg/openfmri/booth -update ------------------------------------------------ /home/chris/ubfs/cpmcnorg/openfmri/booth/FS_T1_501 Fri Apr 15 12:41:06 EDT 2016 mkbrainmask -i template.nii.gz -o masks/brain.nii.gz -thresh 0.1 -ndil 1 -nerode 0 FSLMATHS fslmaths.fsl Scratch Dir is /tmp/mkbrainmask_3238 /home/chris/ubfs/cpmcnorg/openfmri/booth/FS_T1_501/bold mri_convert template.nii.gz /tmp/mkbrainmask_3238/in.nii mri_convert template.nii.gz /tmp/mkbrainmask_3238/in.nii $Id: mri_convert.c,v 1.179.2.7 2012/09/05 21:55:16 mreuter Exp $ reading from template.nii.gz... TR=2000.00, TE=0.00, TI=0.00, flip angle=0.00 i_ras = (-0.998676, 0.0474253, -0.019947) j_ras = (0.0460224, 0.996776, 0.0657189) k_ras = (-0.0229995, -0.0647138, 0.997639) writing to /tmp/mkbrainmask_3238/in.nii... # ---------- Using FSL's BET to Extract Brain------------------ # /home/chris/ubfs/cpmcnorg/openfmri/booth/FS_T1_501/bold bet.fsl /tmp/mkbrainmask_3238/in.nii /tmp/mkbrainmask_3238/brain -m -f 0.1 /usr/local/freesurfer/bin/bet.fsl: 1: /usr/local/freesurfer/bin/bet.fsl: /bin/remove_ext: not found /usr/local/freesurfer/bin/bet.fsl: 1: /usr/local/freesurfer/bin/bet.fsl: /bin/remove_ext: not found /usr/local/freesurfer/bin/bet.fsl: 1: /usr/local/freesurfer/bin/bet.fsl: /bin/imtest: not found /usr/local/freesurfer/bin/bet.fsl: 153: [: =: unexpected operator /usr/local/freesurfer/bin/bet.fsl: 231: /usr/local/freesurfer/bin/bet.fsl: /bin/bet2: not found mri_binarize --i /tmp/mkbrainmask_3238/brain_mask.nii --min .01 --o /tmp/mkbrainmask_3238/brain_mask.nii niiRead(): error opening file /tmp/mkbrainmask_3238/brain_mask.nii
$Id: mri_binarize.c,v 1.26.2.1 2011/04/08 15:40:50 greve Exp $ cwd /home/chris/ubfs/cpmcnorg/openfmri/booth/FS_T1_501/bold cmdline mri_binarize --i /tmp/mkbrainmask_3238/brain_mask.nii --min .01 --o /tmp/mkbrainmask_3238/brain_mask.nii sysname Linux hostname wernickesarea machine x86_64 user chris input /tmp/mkbrainmask_3238/brain_mask.nii frame 0 nErode3d 0 nErode2d 0 output /tmp/mkbrainmask_3238/brain_mask.nii Binarizing based on threshold min 0.01 max +infinity binval 1 binvalnot 0