diff --git a/nibabel/parrec.py b/nibabel/parrec.py index 1dfa998394..1c7e50ea52 100644 --- a/nibabel/parrec.py +++ b/nibabel/parrec.py @@ -897,11 +897,11 @@ def _calc_zooms(self): zooms[:2] = self._get_unique_image_prop('pixel spacing') slice_thickness = self._get_unique_image_prop('slice thickness') zooms[2] = slice_thickness + slice_gap - # If 4D dynamic scan, convert time from milliseconds to seconds + # If 4D dynamic scan, save repetition time in miliseconds if len(zooms) > 3 and self.general_info['dyn_scan']: if len(self.general_info['repetition_time']) > 1: warnings.warn("multiple TRs found in .PAR file") - zooms[3] = self.general_info['repetition_time'][0] / 1000. + zooms[3] = self.general_info['repetition_time'][0] return zooms def get_affine(self, origin='scanner'): diff --git a/nibabel/tests/test_parrec.py b/nibabel/tests/test_parrec.py index 917bc417c6..1b7f199cd5 100644 --- a/nibabel/tests/test_parrec.py +++ b/nibabel/tests/test_parrec.py @@ -144,7 +144,7 @@ # We disagree with Philips about the right affine, for the moment, so # use our own affine as determined from a previous load in nibabel affine=AN_OLD_AFFINE, - zooms=(3.75, 3.75, 8.0, 2.0), + zooms=(3.75, 3.75, 8.0, 2000.0), data_summary=dict( min=0.0, max=2299.4110643863678, @@ -179,7 +179,7 @@ def test_header(): hdr = PARRECHeader(HDR_INFO, HDR_DEFS) assert_equal(hdr.get_data_shape(), (64, 64, 9, 3)) assert_equal(hdr.get_data_dtype(), np.dtype('