-
Notifications
You must be signed in to change notification settings - Fork 0
/
transcribe_upload_crf.py
40 lines (31 loc) · 1.21 KB
/
transcribe_upload_crf.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import xnat
import interface
import sys
import utils
colab = 'https://xnatcruk.icr.ac.uk/XNAT_ICR_COLLABORATIONS'
# going to need: /Applications/ITK-SNAP.app/Contents/bin/install_cmdl.sh my_directory - to be ran on bash to allow
with xnat.connect(server=colab) as connection:
user = connection._logged_in_user
print('Successfully connected to: ', connection._original_uri, ' as user: ', user)
phase = utils.query_phase()
project = connection.projects['MALIMAR_PHASE{}'.format(phase)]
print('Project: ', project.name)
sys.stdout.write('CRFs completed by: ')
name = input()
sys.stdout.write('Date Time Stamp (YYYYMMDD_hhmmss):')
dt = input()
while True:
sys.stdout.write('MR Session ID: ')
mr_id = input()
mr_session = project.experiments[mr_id]
utils.print_session_vars(mr_session)
Labels = interface.Labeler(mr_session)
Labels.open_crf_template()
if utils.query_yes_no('Disease Labelling Completed?'):
Labels.upload_crf(name=name, dt=dt)
mr_session.fields['disease_labelled'] = 'Yes'
mr_session.clearcache()
print('\n\n')
else:
print('\n\n')
continue