10
10
from fileformats .medimage import MedicalImage , Nifti1
11
11
from fileformats .medimage_mrtrix3 import ImageFormat
12
12
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
17
17
18
18
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
+ # )
22
22
23
23
24
24
@extra_implementation (FileSet .generate_sample_data )
@@ -32,12 +32,12 @@ def generate_mrtrix_sample_data(
32
32
return mif .fspaths
33
33
34
34
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