Skip to content

QA EPI10 FUNCTIONAL Quality Assurance Module

chadtj edited this page Apr 19, 2016 · 7 revisions

Purpose is to run when scans are checked in XNAT and produce meanrelrms, tsnr2, spikerate.

Can be run manually if for some reason XNAT does not run it automatically.

SCRIPT MUST BE RUN ON XNAT! If you need a file to store your xnat credentials (~/.xnat-localhost.cfg) please see the Create XNAT Login Configuration File for scripting link on the right.

To Run (an example):

ssh username@xnat.uphs.upenn.edu


/import/monstrum/xnat/pipeline/catalog/bbl/resource/download_sessions_by_date_and_process_epi.py -configfile ~/.xnat-localhost.cfg -project EONS3_810336 -session 010036 -download 1 -daysago 9999 -process 1 -matched 1 -out /import/monstrum/tmp/epi10  -configname epi10 -minreps 23 -dummy 0

Variables to update from above are:

Change EONS3_810336 to your Project ID ( the text following Project ID: when you login to the XNAT page under the projects section)

Change 010036 to the scanid you want to QA. Everything else can remain the same.

To get all QA EPI10 values (and XNAT metadata) from a project into a CSV, the following script(s) can be used:

    /import/speedy/scripts/bin/pyxnat_epi_csv.py -configfile $configfile -project $i -outcsv /import/monstrum/tmp/$i/images/xnat_QA.csv -csvtype 'qa'


    /import/speedy/scripts/bin/pyxnat_epi_csv.py -configfile $configfile -project $i -outcsv /import/monstrum/tmp/$i/images/xnat_sess.csv -csvtype 'sess'

Replace $configfile above with the path to your .xnat.cfg (or .xnat-localhost.cfg if running from xnat.uphs.upenn.edu)

Replace $i with the PROJECT ID ( the text following Project ID: when you login to the XNAT page under the projects section) and/or enter your own custom path after the -outcsv

To Put this data into REDCap, the following scripts can be used or adapted from to take the resulting CSVs and put them into XNAT, assuming the variable names from the CSVs match fields in the REDCap Project

/import/speedy/scripts/bin/xnat2redcap_v2.py -configfile $configfile -bblemail $bblemail -api_key1 $api_key -incsv /import/monstrum/tmp/$i/images/xnat_QA.csv -overwrite 1

Replace $configfile above with the path to your .xnat.cfg (or .xnat-localhost.cfg if running from xnat.uphs.upenn.edu)

Replace $i with the PROJECT ID ( the text following Project ID: when you login to the XNAT page under the projects section) and/or enter your own custom path after the -incsv

Replace $api_key with your REDCap API Key

Replace $bblemail with your email address to send you a message in the case of an error (Useful if scripted)

Clone this wiki locally