question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Need to transpose array obtained from itk instead of reversing of itk.size() in ITKReader

See original GitHub issue

Description

In ITKReader, itk.size(img) should not be reversed since it outputs correct size of an image. Instead, itk.array_view_from_image(img, keep_axes=False) provides the transposed array and such numpy array must be transposed because of the differences of storing the data in numpy and itk.

This PR is wrong: https://github.com/Project-MONAI/MONAI/pull/1045. See also https://github.com/InsightSoftwareConsortium/ITK/issues/2006

Expected behavior

  1. Need to remove the reverse for itk.size.
  2. Transpose array obtained from itk.array_view_from_image.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:20 (12 by maintainers)

github_iconTop GitHub Comments

3reactions
thewtexcommented, Dec 23, 2020

To follow-up, I made some progress on this, but I will come back to it after I return in the new year. Happy pre-2021!

1reaction
dzenanzcommented, May 25, 2021

I plan to work on this issue soon - in case somebody is already working on it or planned to.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Source code for monai.data.image_reader
This function must return two objects, the first is a numpy array of image data, the second is a dictionary of metadata. Args:...
Read more >
TRANSPOSE - L3HarrisGeospatial.com
The TRANSPOSE function returns the transpose of Array. If an optional permutation vector is provided, the dimensions of Array are rearranged as well....
Read more >
Transpose 3-D MRI image axis to different image view
The issue is that you're using the pixel spacing from the original image. You need to transpose the pixel spacings the same way...
Read more >
TRANSPOSE function - Microsoft Support
How to use the TRANSPOSE function in Excel to switch or rotate cells. ... you don't want that, you can type a formula...
Read more >
Why does ITK Snap automatically transpose my scans?
I was thinking that maybe the nifti files have some parameters that make ITK to transpose them. However, I opened a file in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found