Read further if:
- you develop or run image processing locally in bash;
- you want to use XNAT as data source and/or remote archive;
- you want to automate processing of multiple XNAT sessions and want to report your results in spreadsheets.
- you want to focus on local script development and minimize programming effort to interact with XNAT.
Use case: compute BET whole brain volume for all MPRAGE scans in an MRI project in XNAT and save statistics in a spreadsheet.
1. Write a bash script that computes brain volume on a DICOM brain (assuming FSL v4+ is on the path).
2. Create a spreadsheet listing all scans that you want to process. In many cases, you'll have such spreadsheet; if not, you can start with the one created using the one generated by XNAT:
Now, modify the spreadsheet so that column names don't contain spaces, empty and irrelevant cells are removed, and change column "Scans" to "T1", with scan numbers that we want to process per each session. If any fields have trailing zeroes, you'll need to modify the csv outside of Excel to add them.
3. Now we are ready to adapt the brain_volume.sh to process all sessions from test.csv.
4. Test the batch processing.
We will run the developed script on a single session to see if it works. For that, uncomment break statement in the end of the cycle over all sessions. Now we are ready to run the script: