|
32 | 32 |
|
33 | 33 | prefix_based = true; |
34 | 34 |
|
35 | | - add_deformation_field = false; |
36 | | - deformation_field = 'TODO: add deformation field'; |
37 | | - |
38 | | - % TODO? grab all the anat suffixes from BIDS schema? |
39 | | - covered_suffixes = {'T1w', ... |
40 | | - 'T2w', ... |
41 | | - 'PDw', ... |
42 | | - 'T2starw', ... |
43 | | - 'inplaneT1', ... |
44 | | - 'inplaneT2', ... |
45 | | - 'PD', ... |
46 | | - 'PDT2', ... |
47 | | - 'T2star', ... |
48 | | - 'FLASH', ... |
49 | | - 'T1map', ... |
50 | | - 'T2map', ... |
51 | | - 'T2starmap', ... |
52 | | - 'R1map', ... |
53 | | - 'R2map', ... |
54 | | - 'R2starmap', ... |
55 | | - 'PDmap', ... |
56 | | - 'UNIT1'}; |
| 35 | + deformation_field_needed = false; |
57 | 36 |
|
58 | 37 | args = inputParser; |
59 | 38 |
|
|
118 | 97 |
|
119 | 98 | bf.prefix = bf.prefix(2:end); |
120 | 99 |
|
121 | | - add_deformation_field = true; |
| 100 | + deformation_field_needed = true; |
122 | 101 |
|
123 | 102 | elseif bids.internal.starts_with(bf.prefix, 'w') |
124 | 103 |
|
125 | 104 | bf.prefix = bf.prefix(2:end); |
126 | | - add_deformation_field = true; |
| 105 | + deformation_field_needed = true; |
127 | 106 |
|
128 | 107 | elseif bids.internal.starts_with(bf.prefix, 'rp_a') |
129 | 108 |
|
|
153 | 132 |
|
154 | 133 | sources{1, 1} = fullfile(bf.bids_path, new_filename); |
155 | 134 |
|
156 | | - if add_deformation_field |
| 135 | + sources = add_deformation_field(sources, bf, map, verbose, deformation_field_needed); |
| 136 | + |
| 137 | +end |
| 138 | + |
| 139 | +function sources = add_deformation_field(sources, bf, map, verbose, deformation_field_needed) |
| 140 | + |
| 141 | + deformation_field = 'TODO: add deformation field'; |
| 142 | + |
| 143 | + % TODO? grab all the anat suffixes from BIDS schema? |
| 144 | + covered_suffixes = {'T1w', ... |
| 145 | + 'T2w', ... |
| 146 | + 'PDw', ... |
| 147 | + 'T2starw', ... |
| 148 | + 'inplaneT1', ... |
| 149 | + 'inplaneT2', ... |
| 150 | + 'PD', ... |
| 151 | + 'PDT2', ... |
| 152 | + 'T2star', ... |
| 153 | + 'FLASH', ... |
| 154 | + 'T1map', ... |
| 155 | + 'T2map', ... |
| 156 | + 'T2starmap', ... |
| 157 | + 'R1map', ... |
| 158 | + 'R2map', ... |
| 159 | + 'R2starmap', ... |
| 160 | + 'PDmap', ... |
| 161 | + 'UNIT1'}; |
| 162 | + |
| 163 | + if deformation_field_needed |
157 | 164 |
|
158 | 165 | % for anatomical data we assume that |
159 | 166 | % the deformation field comes from the anatomical file itself |
|
173 | 180 | sources{2, 1} = deformation_field; |
174 | 181 |
|
175 | 182 | end |
176 | | - |
177 | 183 | end |
0 commit comments