aimed_xnat
A package to utilize the xnat for managing ai lifecycle in medical applications.
This package in general provides these features.
core: the main module where xnat session and data queries can be done.
Usage
cd python-package
python setup.py install
SIMPLE EXAMPLES
needs some project on central at least
from aimed_xnat.core.sess import XNATSession
from aimed_xnat.data.explorer import XNATExplorer
from aimed_xnat.data.uploader import XNATUploader
xnat = XNATSession(server="https://central.xnat.org",
user='user',
password='pass')
# we have an example file to upload
filename = 'new_upload.txt'
# create explorer and uploader instances that we ll need
explorer = XNATExplorer(xnat=xnat)
uploader = XNATUploader(xnat=xnat)
# upload using the uploader class
uploader.upload(filepath=filename, level='scan', resource_type='TXT',
proj_id='123456898', subj_id='CENTRAL04_S01706', exp_id='CENTRAL04_E03123',
scan_id='2')
# see if it was uploaded using the explorer
print(explorer.get_scan(proj_id='123456898', subj_id='CENTRAL04_S01706',
exp_id='CENTRAL04_E03123', scan_id='2').resource('TXT').files().get())