Skip to content

Commit 4c7cec8

Browse files
committed
commented out read_array code that is causing error due to types
1 parent 08d2287 commit 4c7cec8

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

related-packages/fileformats-extras/fileformats/extras/medimage_mrtrix3/image.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
from fileformats.medimage import MedicalImage, Nifti1
1111
from fileformats.medimage_mrtrix3 import ImageFormat
1212

13-
if sys.version_info >= (3, 9):
14-
from typing import TypeAlias
15-
else:
16-
from typing_extensions import TypeAlias
13+
# if sys.version_info >= (3, 9):
14+
# from typing import TypeAlias
15+
# else:
16+
# from typing_extensions import TypeAlias
1717

1818

19-
DataArrayType: TypeAlias = (
20-
"numpy.typing.NDArray[ty.Union[np.floating[ty.Any], np.integer[ty.Any]]]"
21-
)
19+
# DataArrayType: TypeAlias = (
20+
# "numpy.typing.NDArray[ty.Union[np.floating[ty.Any], np.integer[ty.Any]]]"
21+
# )
2222

2323

2424
@extra_implementation(FileSet.generate_sample_data)
@@ -32,12 +32,12 @@ def generate_mrtrix_sample_data(
3232
return mif.fspaths
3333

3434

35-
@extra_implementation(MedicalImage.read_array)
36-
def mrtrix_read_array(mif: ImageFormat) -> DataArrayType:
37-
raise NotImplementedError(
38-
"Need to work out how to use the metadata to read the array in the correct order"
39-
)
40-
data = mif.read_contents(offset=mif.data_offset)
41-
array = np.asarray(data)
42-
data_array = array.reshape(mif.dims)
43-
return data_array
35+
# @extra_implementation(MedicalImage.read_array)
36+
# def mrtrix_read_array(mif: ImageFormat) -> DataArrayType:
37+
# raise NotImplementedError(
38+
# "Need to work out how to use the metadata to read the array in the correct order"
39+
# )
40+
# data = mif.read_contents(offset=mif.data_offset)
41+
# array = np.asarray(data)
42+
# data_array = array.reshape(mif.dims)
43+
# return data_array

0 commit comments

Comments
 (0)