Last active
April 9, 2019 09:52
-
-
Save Remi-Gau/6d179e8b59ab9c985369cba2f7282e94 to your computer and use it in GitHub Desktop.
bash script to create a dummy BIDS data set to test the MP2RAGE JSON file naming
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# small bash script to create a dummy BIDS data set to test the MP2RAGE JSON file naming | |
# defines where the BIDS data set will be created | |
StartDir=`pwd` # relative to starting directory | |
echo $StartDir/../../../BIDS/7t_mp2rage/ | |
StartDir=$StartDir/../../../BIDS/7t_mp2rage/ | |
mkdir $StartDir | |
SubList='01 02 03 04 05 06 07 08 09 10 11 12' # subject list | |
SesList='01 02' # session list | |
for Subject in $SubList # loop through subjects | |
do | |
mkdir $StartDir/sub-$Subject # create folder for subject | |
for Ses in $SesList # loop through sessions | |
do | |
# create folder for each session and functional and fmap | |
mkdir $StartDir/sub-$Subject/ses-$Ses | |
mkdir $StartDir/sub-$Subject/ses-$Ses/fmap | |
mkdir $StartDir/sub-$Subject/ses-$Ses/func | |
# only creates folder for anat and empty mp2rage files for session 1 | |
if [ $Ses = 01 ] | |
then | |
mkdir $StartDir/sub-$Subject/ses-$Ses/anat | |
touch $StartDir/sub-$Subject/ses-$Ses/anat/sub-$Subject\_ses-$Ses\_inv-1_part-mag_MPRAGE.nii.gz | |
touch $StartDir/sub-$Subject/ses-$Ses/anat/sub-$Subject\_ses-$Ses\_inv-1_part-phase_MPRAGE.nii.gz | |
touch $StartDir/sub-$Subject/ses-$Ses/anat/sub-$Subject\_ses-$Ses\_inv-2_part-mag_MPRAGE.nii.gz | |
touch $StartDir/sub-$Subject/ses-$Ses/anat/sub-$Subject\_ses-$Ses\_inv-2_part-phase_MPRAGE.nii.gz | |
touch $StartDir/sub-$Subject/ses-$Ses/anat/sub-$Subject\_ses-$Ses\_T1w.nii.gz | |
touch $StartDir/sub-$Subject/ses-$Ses/anat/sub-$Subject\_ses-$Ses\_Tmap.nii.gz | |
fi | |
done | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment