diff --git a/related-packages/fileformats-extras/fileformats/extras/medimage_mrtrix3/image.py b/related-packages/fileformats-extras/fileformats/extras/medimage_mrtrix3/image.py index 7ceaaa6..be543ee 100644 --- a/related-packages/fileformats-extras/fileformats/extras/medimage_mrtrix3/image.py +++ b/related-packages/fileformats-extras/fileformats/extras/medimage_mrtrix3/image.py @@ -13,7 +13,7 @@ def generate_mrtrix_sample_data( mif: ImageFormat, generator: SampleFileGenerator, -) -> ty.Iterable[Path]: +) -> ty.List[Path]: nifti = Nifti1(get_dummy_nifti(generator.dest_dir / "nifti.nii")) with mock.patch.dict(os.environ, {"MRTRIX_CLI_PARSE_ONLY": "0"}): mif = ImageFormat.convert(nifti) diff --git a/related-packages/fileformats-extras/fileformats/extras/medimage_mrtrix3/tracks.py b/related-packages/fileformats-extras/fileformats/extras/medimage_mrtrix3/tracks.py index b192dc3..2ef9f37 100644 --- a/related-packages/fileformats-extras/fileformats/extras/medimage_mrtrix3/tracks.py +++ b/related-packages/fileformats-extras/fileformats/extras/medimage_mrtrix3/tracks.py @@ -11,7 +11,7 @@ def generate_tracks_sample_data( tracks: Tracks, generator: SampleFileGenerator, -) -> ty.Iterable[Path]: +) -> ty.List[Path]: """Generate a tracks file with a single straight track of length 10""" fspath = generator.dest_dir / "tracks.tck" timestamp = str(time.time() * 1e9 + time.process_time_ns()) diff --git a/related-packages/fileformats/fileformats/medimage_mrtrix3/image.py b/related-packages/fileformats/fileformats/medimage_mrtrix3/image.py index e41f126..8d1638e 100644 --- a/related-packages/fileformats/fileformats/medimage_mrtrix3/image.py +++ b/related-packages/fileformats/fileformats/medimage_mrtrix3/image.py @@ -65,7 +65,9 @@ def data_fspath(self): @property def data_offset(self): - return int(self.metadata["file"].split()[1]) + fspath_and_offset = self.metadata["file"].split() + assert len(fspath_and_offset) <= 2 + return int(fspath_and_offset[1]) if len(fspath_and_offset) > 1 else 0 @property def vox_sizes(self):