Attention: Confluence is not suitable for the storage of highly confidential data. Please ensure that any data classified as Highly Protected is stored using a more secure platform.
If you have any questions, please refer to the University's data classification guide or contact ict.askcyber@sydney.edu.au
Organising MRI data for your study
Frontier MRI data is saved in XNAT with subject IDs (unique 5-7 digits numbers) and session IDs (unique 4 digit numbers preceded by “FTD”). When you download data from XNAT it will have these identifiers. When carrying out a study it can be helpful to instead use a unique study ID, especially if you are carrying out a longitudinal study.
The easiest way to create your study IDs is to assign a number to each subject in your cohort and then create the ID made up of the group (eg CTR for control), underscore, the number you assigned (eg 001), underscore, followed by the timepoint (eg MR1 for the first timepoint. So the study ID for this example subject would be CTR_001_MR1.
If you are doing this in Excel you can create a separate column for each part of the ID and then join them with a formula like: =B2&"_"&C2&"_MR"&D2 where column B is the group, C is the number you assigned, and D is the visit number.
To download your files from XNAT, you can use a script like the following:
Once you have downloaded your scans from XNAT. You can use the below method to rename all your folders easily. You want to do this before preprocessing, as all subsequent files and folders will be created with the same ID.
Move to the folder with your files in it, eg:
cd /scratch/projectname/DATA
From your cohort spreadsheet, copy the column with the current sessions IDs (the FTD numbers)
On the command line create a list with the pasted in IDs, eg:
list='FTDXXXX
FTDXXXX
FTDXXXX'
Then create a txt file containing the new IDs (copy and paste them in the same way) Make sure they remain in the same order as the other list of IDs.
vi newIDs.txt
Press insert to go into insert mode on the vim editor and paste in the IDs. Press Esc to leave insert mode and then enter :wq! to save the file.
Now copy the following code and press enter (make sure you’re still in the correct directory with all the folders and the txt file):
for oldID in $list; do
IFS= read -r newID || break
echo mv --no-clobber -- "$oldID" "$newID"
done < newIDs.txt
check that the old and new IDs are matching up correctly and then delete “echo” from the code and enter it again.
You can then remove the newIDs.txt file as it’s no longer needed.