-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
-
The docstring for
reverse_indexinginITKReaderis wrong.
MONAI/monai/data/image_reader.py
Lines 170 to 173 in abe2e31
reverse_indexing: whether to use a reversed spatial indexing convention for the returned data array. If ``False``, the spatial indexing follows the numpy convention; otherwise, the spatial indexing convention is reversed to be compatible with ITK. Default is ``False``. This option does not affect the metadata.
MONAI/monai/data/image_reader.py
Lines 368 to 372 in abe2e31
np_img = itk.array_view_from_image(img, keep_axes=False) if img.GetNumberOfComponentsPerPixel() == 1: # handling spatial images return np_img if self.reverse_indexing else np_img.T # handling multi-channel images return np_img if self.reverse_indexing else np.moveaxis(np_img.T, 0, -1)
https://github.com/InsightSoftwareConsortium/ITK/blob/f5aab1f68e53061264f4f6f3af5e0d49c5f7481d/Wrapping/Generators/Python/itk/support/extras.py#L351-L354 -
In
NrrdReader, even the header have been updated after_convert_f_to_c_order, it dosen't pass to the_get_affine, so the affine is still not updated.
MONAI/monai/data/image_reader.py
Lines 1324 to 1326 in abe2e31
if self.index_order == "C": header = self._convert_f_to_c_order(header) header[MetaKeys.ORIGINAL_AFFINE] = self._get_affine(i)
Metadata
Metadata
Assignees
Labels
No labels