Uploading BRIK data via REST


This documentation relates to a use case from the Laureate Institute at the University of Tulsa. The use case was used in the 'REST' presentation at the 2010 XNAT Workshop.

Background: The Laureate Institute uses a real-time server to generate BRIK reconstructions of their data. This data is placed in a folder on the real-time server. The site would like to upload this BRIK data into their XNAT (in tandem to their DICOM data) so that it can be managed and maintained.

Details. The output of the real-time server is a directory which contains a large amount of files. Most of the files include a scan number in the file name. As it turns out, not all of the data in the folder is BRIK data. It also contains some additional resources which are used to capture ECG data and respitory tracking data (Resp). These files should be uploaded into separate resources (BRIK, ECG, Resp, and DICOM).

brik-folder.png

Implementation: We wrote a bash script to upload the data. It uses the file name conventions to associate the files with the proper scans and specific resource types (BRIK vs Resp vs ECG). In practice, the DICOM will be uploaded separately (just before this script runs) via the DICOM Browser's command line interface. But, just to be safe, the script will attempt to pre-create the subject, session, and scan leves (this will have no impact if they already exist).

Assumptions:
  • Data is MR data
  • Files without scan_X in the name can be ignored.
  • Files correspond to a single scan (thus they can be uploaded as scan resources rather than reconstructions).
  • PROJECT, SUBJECT, EXPT_LABEL can be passed in as parameters (otherwise they might need to be parsed from the files)


Example Implementation:

./load-brik-data.sh TEST_PROJECT TEST_SUBJECT TEST_MR /data/test/brik_example/TEST1