XNAT data syncing
Scan data in XNAT can be mirrored using a local XNAT or copied using the REST API.
One way to use the API is using either python xnat or xnatpy library.
For rsync from MRRC MR Data Filesystem (gyrus) or comparable scripts:.
fw download using Flywheel
- An example using
import xnatfrom MC is on github. - Alternatively, a script to mirror the dcmtk storescp DICOM listener file and path pattern written to
scan_data/can be found on https://github.com/NPACore/xnat-hpc/tree/main/misc/xnat_sync_raw.py.# write authentication information echo '{"server": "https://xnat.mrrc.upmc.edu", "user": "MYUSER", "password": "MYPASSWORD"}' > mrrc-xnat.cfg # using 'uv' from https://docs.astral.sh/uv/ PROJCODE=WPC-1234 RAWROOT=/tmp/sync/test DRYRUN=1 \ uv run --script https://raw.githubusercontent.com/NPACore/xnat-hpc/refs/heads/main/misc/xnat_sync_raw.py