From 255d220a5e8db83ae4cef85d5de23b08f9f1c04d Mon Sep 17 00:00:00 2001 From: Steve Damon Date: Thu, 29 Jun 2017 11:46:18 -0500 Subject: [PATCH] bug fix --- dax/XnatUtils.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dax/XnatUtils.py b/dax/XnatUtils.py index e696e5e8..8b6f12b9 100644 --- a/dax/XnatUtils.py +++ b/dax/XnatUtils.py @@ -853,10 +853,16 @@ def list_sessions(intf, projectid=None, subjectid=None): sess['last_modified'] = sess.get(last_modified_str, None) sess['last_updated'] = sess.get('%s/original' % sess_type, None) sess['age'] = sess.get('%s/age' % sess_type, None) - sess['handedness'] = subj_id2lab[sess['subject_ID']][0] - sess['gender'] = subj_id2lab[sess['subject_ID']][1] - sess['yob'] = subj_id2lab[sess['subject_ID']][2] - sess['dob'] = subj_id2lab[sess['subject_ID']][3] + try: + sess['handedness'] = subj_id2lab[sess['subject_ID']][0] + sess['gender'] = subj_id2lab[sess['subject_ID']][1] + sess['yob'] = subj_id2lab[sess['subject_ID']][2] + sess['dob'] = subj_id2lab[sess['subject_ID']][3] + except KeyError as KE: + sess['handedness'] = 'UNK' + sess['gender'] = 'UNK' + sess['yob'] = 'UNK' + sess['dob'] = 'UNK' # Add sessions of this type to full list full_sess_list.extend(sess_list)