I would write it like this:

Subjlist=“YOUR LIST OF SUBJECT IDS SEPARATED BY SPACES"
StudyFolder=“YOUR_STUDYFOLDER_THAT_CONTAINS_SUBJECT_FOLDERS_HERE”

for Subject in ${Subjlist} ; do #Loop over subject IDs
  DIR=`pwd` #Save the current directory
  cd ${StudyFolder}/${Subject}/T1w/Diffusion #cd into diffusion directory
  dtifit -k data.nii.gz -o data_dtifit -m nodif_brain_mask.nii.gz -r bvecs -b bvals --gradnonlin=grad_dev.nii.gz #Run DTIFIT
  cd ${DIR} #Go back to current directory
done

Peace,

Matt.

From: <Chiu>, "Bryan (PHTH)" <bryan.c...@ubc.ca>
Date: Monday, May 4, 2015 at 3:31 PM
To: "hcp-users@humanconnectome.org" <hcp-users@humanconnectome.org>
Subject: [HCP-Users] Help with dtifit on participants

Hi,

I am trying to run dtifit on the HCP data through FSL, using the following bash script:

for dir in /mnt/win/HCP/*;

    do

        (cd $dir/T1w/Diffusion && dtifit -k data -o data_dtifit -m nodif_brain_mask -r bvecs -b bvals);

    done


Except it won't run to completion; it will instead hang indefinitely after completing the first participant and the NAS I am connected to appears to hang on this connection. I have done some troubleshooting on this but I am completely stumped. This is my first attempt at bash scripting and FSLDTI.


Any help would be appreciated,

_______________________________________

Bryan Chiu
Undergraduate Research Assistant
Aging, Mobility, and Cognitive Neuroscience Lab
Djavad Mowafaghian Centre for Brain Health
Department of Physical Therapy
Faculty of Medicine
University of British Columbia

_______________________________________________
HCP-Users mailing list
HCP-Users@humanconnectome.org
http://lists.humanconnectome.org/mailman/listinfo/hcp-users

 


The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.

_______________________________________________
HCP-Users mailing list
HCP-Users@humanconnectome.org
http://lists.humanconnectome.org/mailman/listinfo/hcp-users

Reply via email to