-
Notifications
You must be signed in to change notification settings - Fork 4
Xnat PreArchive Session Fix
When uploading large sets of images to the prearchive, I came across a scenario where all images sessions from the same patient were assigned the same session_ID; however XNAT requires this to be unique, which means doing a batch archive would not work. To get around this, we have written a script that will scan the prearchive looking for sessions with the same session_ID and will attempt to rename them by calling them PATIENT-ID_SCAN_DATE In most cases, this should deambiguate the sessions and allow them to be added to the prearchive in batch
##Pre-requisites
sudo apt-get install python-sqlalchemy
sudo apt-get install python-psycopg2
sudo apt-get install python-lxml
it's possible/likely this is not mandatory, but figuring out the firewall/password/credential issues is not something I've put high on my list of things to do
CONFIG FOR YOUR XNAT Server:
engine = sa.create_engine('postgresql://xnat:xnat@localhost/xnat', echo=vv)
replace xnat:xnat with your userid/pass for your postgres database---
this could be modified to allow entry from nonlocalhost as well depending on your firewall settings