|
148 | 148 | 'Technique': ('tech',),
|
149 | 149 | 'Scan resolution (x, y)': ('scan_resolution', int, (2,)),
|
150 | 150 | 'Scan mode': ('scan_mode',),
|
151 |
| - 'Repetition time [ms]': ('repetition_time', float), |
| 151 | + 'Repetition time [ms]': ('repetition_time', float, None), |
152 | 152 | 'FOV (ap,fh,rl) [mm]': ('fov', float, (3,)),
|
153 | 153 | 'Water Fat shift [pixels]': ('water_fat_shift', float),
|
154 | 154 | 'Angulation midslice(ap,fh,rl)[degr]': ('angulation', float, (3,)),
|
@@ -295,7 +295,9 @@ def _process_gen_dict(gen_dict):
|
295 | 295 | elif len(props) == 3:
|
296 | 296 | # array with dtype and shape
|
297 | 297 | value = np.fromstring(value, props[1], sep=' ')
|
298 |
| - value.shape = props[2] |
| 298 | + # if shape is None, allow arbitrary length |
| 299 | + if props[2] is not None: |
| 300 | + value.shape = props[2] |
299 | 301 | general_info[props[0]] = value
|
300 | 302 | return general_info
|
301 | 303 |
|
@@ -842,7 +844,9 @@ def _calc_zooms(self):
|
842 | 844 | zooms[2] = slice_thickness + slice_gap
|
843 | 845 | # If 4D dynamic scan, convert time from milliseconds to seconds
|
844 | 846 | if len(zooms) > 3 and self.general_info['dyn_scan']:
|
845 |
| - zooms[3] = self.general_info['repetition_time'] / 1000. |
| 847 | + if len(self.general_info['repetition_time']) > 1: |
| 848 | + warnings.warn("multiple TRs found in .PAR file") |
| 849 | + zooms[3] = self.general_info['repetition_time'][0] / 1000. |
846 | 850 | return zooms
|
847 | 851 |
|
848 | 852 | def get_affine(self, origin='scanner'):
|
|
0 commit comments