From 4c7cec8c82d79ed7ad8d2308f2205d36c05edfd8 Mon Sep 17 00:00:00 2001 From: Tom Close Date: Tue, 10 Sep 2024 16:33:28 +1000 Subject: [PATCH] commented out read_array code that is causing error due to types --- .../extras/medimage_mrtrix3/image.py | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) 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 d6d29c8..a3ecd21 100644 --- a/related-packages/fileformats-extras/fileformats/extras/medimage_mrtrix3/image.py +++ b/related-packages/fileformats-extras/fileformats/extras/medimage_mrtrix3/image.py @@ -10,15 +10,15 @@ from fileformats.medimage import MedicalImage, Nifti1 from fileformats.medimage_mrtrix3 import ImageFormat -if sys.version_info >= (3, 9): - from typing import TypeAlias -else: - from typing_extensions import TypeAlias +# if sys.version_info >= (3, 9): +# from typing import TypeAlias +# else: +# from typing_extensions import TypeAlias -DataArrayType: TypeAlias = ( - "numpy.typing.NDArray[ty.Union[np.floating[ty.Any], np.integer[ty.Any]]]" -) +# DataArrayType: TypeAlias = ( +# "numpy.typing.NDArray[ty.Union[np.floating[ty.Any], np.integer[ty.Any]]]" +# ) @extra_implementation(FileSet.generate_sample_data) @@ -32,12 +32,12 @@ def generate_mrtrix_sample_data( return mif.fspaths -@extra_implementation(MedicalImage.read_array) -def mrtrix_read_array(mif: ImageFormat) -> DataArrayType: - raise NotImplementedError( - "Need to work out how to use the metadata to read the array in the correct order" - ) - data = mif.read_contents(offset=mif.data_offset) - array = np.asarray(data) - data_array = array.reshape(mif.dims) - return data_array +# @extra_implementation(MedicalImage.read_array) +# def mrtrix_read_array(mif: ImageFormat) -> DataArrayType: +# raise NotImplementedError( +# "Need to work out how to use the metadata to read the array in the correct order" +# ) +# data = mif.read_contents(offset=mif.data_offset) +# array = np.asarray(data) +# data_array = array.reshape(mif.dims) +# return data_array