@@ -18,22 +18,21 @@ def infotodict(seqinfo):
18
18
subindex: sub index within group
19
19
session: scan index for longitudinal acq
20
20
"""
21
- and_dicom = ('dicom' , 'nii.gz' )
21
+ # for this example, we want to include copies of the DICOMs just for our T1
22
+ # and functional scans
23
+ outdicom = ('dicom' , 'nii.gz' )
22
24
23
- t1 = create_key ('{session}/anat/sub-{subject}_T1w' , outtype = and_dicom )
24
- t2 = create_key ('{session}/anat/sub-{subject}_T2w' , outtype = and_dicom )
25
- fm_diff = create_key ('{session}/fmap/sub-{subject}_fieldmap-dwi' )
26
- dwi_ap = create_key ('{session}/dwi/sub-{subject}_dir-AP_dwi' , outtype = and_dicom )
27
- dwi_pa = create_key ('{session}/dwi/sub-{subject}_dir-PA_dwi' , outtype = and_dicom )
28
- fm_rest = create_key ('{session}/fmap/sub-{subject}_fieldmap-rest' )
29
- rs = create_key ('{session}/func/sub-{subject}_task-rest_run-{item:02d}_bold' , outtype = and_dicom )
30
- boldt1 = create_key ('{session}/func/sub-{subject}_task-bird1back_run-{item:02d}_bold' , outtype = and_dicom )
31
- boldt2 = create_key ('{session}/func/sub-{subject}_task-letter1back_run-{item:02d}_bold' , outtype = and_dicom )
32
- boldt3 = create_key ('{session}/func/sub-{subject}_task-letter2back_run-{item:02d}_bold' , outtype = and_dicom )
33
- nofb_task = create_key ('{session}/func/sub-{subject}_task-nofb_run-{item:02d}_bold' , outtype = and_dicom )
34
- fb_task = create_key ('{session}/func/sub-{subject}_task-fb_run-{item:02d}_bold' , outtype = and_dicom )
35
- info = {t1 : [], t2 :[], fm_diff :[], dwi_ap :[], dwi_pa :[], fm_rest :[], rs :[],
36
- boldt1 :[], boldt2 :[], boldt3 :[], nofb_task :[], fb_task :[]}
25
+ t1 = create_key ('{bids_subject_session_dir}/anat/{bids_subject_session_prefix}_T1w' , outtype = outdicom )
26
+ t2 = create_key ('{bids_subject_session_dir}/anat/{bids_subject_session_prefix}_T2w' )
27
+ dwi_ap = create_key ('{bids_subject_session_dir}/dwi/{bids_subject_session_prefix}_dir-AP_dwi' )
28
+ dwi_pa = create_key ('{bids_subject_session_dir}/dwi/{bids_subject_session_prefix}_dir-PA_dwi' )
29
+ rs = create_key ('{bids_subject_session_dir}/func/{bids_subject_session_prefix}_task-rest_run-{item:02d}_bold' , outtype = outdicom )
30
+ boldt1 = create_key ('{bids_subject_session_dir}/func/{bids_subject_session_prefix}_task-bird1back_run-{item:02d}_bold' , outtype = outdicom )
31
+ boldt2 = create_key ('{bids_subject_session_dir}/func/{bids_subject_session_prefix}_task-letter1back_run-{item:02d}_bold' , outtype = outdicom )
32
+ boldt3 = create_key ('{bids_subject_session_dir}/func/{bids_subject_session_prefix}_task-letter2back_run-{item:02d}_bold' , outtype = outdicom )
33
+
34
+ info = {t1 : [], t2 :[], dwi_ap :[], dwi_pa :[], rs :[],
35
+ boldt1 :[], boldt2 :[], boldt3 :[],}
37
36
last_run = len (seqinfo )
38
37
for s in seqinfo :
39
38
if (s .dim3 == 176 or s .dim3 == 352 ) and (s .dim4 == 1 ) and ('MEMPRAGE' in s .protocol_name ):
@@ -42,14 +41,10 @@ def infotodict(seqinfo):
42
41
info [t1 ] = [s .series_id ]
43
42
elif (s .dim3 == 176 or s .dim3 == 352 ) and (s .dim4 == 1 ) and ('T2_SPACE' in s .protocol_name ):
44
43
info [t2 ] = [s .series_id ]
45
- elif ('field_mapping_diffusion' in s .protocol_name ):
46
- info [fm_diff ].append ([s .series_id ])
47
44
elif (s .dim4 >= 70 ) and ('DIFFUSION_HighRes_AP' in s .protocol_name ):
48
45
info [dwi_ap ].append ([s .series_id ])
49
46
elif ('DIFFUSION_HighRes_PA' in s .protocol_name ):
50
47
info [dwi_pa ].append ([s .series_id ])
51
- elif ('field_mapping_resting' in s .protocol_name ):
52
- info [fm_rest ].append ([s .series_id ])
53
48
elif (s .dim4 == 144 ) and ('resting' in s .protocol_name ):
54
49
if not s .is_motion_corrected :
55
50
info [rs ].append ([(s .series_id )])
@@ -62,13 +57,4 @@ def infotodict(seqinfo):
62
57
elif (s .dim4 == 227 or s .dim4 == 454 ) and ('transfer2' in s .protocol_name ):
63
58
if not s .is_motion_corrected :
64
59
info [boldt3 ].append ([s .series_id ])
65
- elif (('run1' in s .protocol_name ) or ('run6' in s .protocol_name )) and (s .dim4 == 159 ):
66
- if not s .is_motion_corrected :
67
- info [nofb_task ].append ([s .series_id ])
68
- elif (('run2' in s .protocol_name ) or ('run3' in s .protocol_name ) or ('run4' in s .protocol_name )
69
- or ('run5' in s .protocol_name )) and (s .dim4 == 159 ):
70
- if not s .is_motion_corrected :
71
- info [fb_task ].append ([s .series_id ])
72
- else :
73
- pass
74
60
return info
0 commit comments