Skip to content

ITKReader doesn't return numpy array #2899

@Nic-Ma

Description

@Nic-Ma

Describe the bug
Currently, we use the itk.array_view_from_image() to get data array:
https://github.com/Project-MONAI/MONAI/blob/dev/monai/data/image_reader.py#L316
But actually, it's not numpy array, so following logic which depends on numpy.ndarray type will fail.

loader = LoadImage()
img, meta = loader(dicom_path)
print(type(img))

Get the output:

<class 'itk.itkPyBufferPython.NDArrayITKBase'>

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions