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.

inconsistency of LoadImage

See original GitHub issue

I have a nrrd file, of shape 256*256*42

when i run

from monai.transforms import LoadImage
img, metadata = LoadImage(reader='itkreader')(path)
print(metadata['spacing'])
print(metadata['spatial_shape'])

I got array([1.3671875 , 1.3671875 , 5.20000458]) and array([ 42, 256, 256])

yet if i run

import SimpleITK as sitk
img = sitk.ReadImage(path)
print(img.GetSpacing())
print(img.GetSize())

i got (1.3671875, 1.3671875, 5.200004577636718) and (256, 256, 42)

obviously, the values are inconsistency between metadata['spacing'] and metadata['spatial_shape']

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
wylicommented, Sep 6, 2021

I think this is fixed in #2613, and the fix will be released in v0.7.

0reactions
JianJulycommented, Sep 6, 2021

@Nic-Ma Another question is, how can i use Spacing in this case? I want to modify its spacing from (1.3671875, 1.3671875, 5.200004577636718)to (1, 1, 5)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Inconsistent behavior on loading images using AsyncTask
What the application does is very simple. It loads two RSS feeds and on each RSS feed, it contains two items with a...
Read more >
Re: error: load: ../some image directory/..: inconsistent number of colu
09:07 -0700, skrev shoker_17: > Does it means that loadimage() supports only certain image formats? Yes, loadimage only supports octave's own image format....
Read more >
originalWidth and originalHeight values not the same over all ...
Hi @loekup,. Automatic image orientation support is inconsistent even between modern browsers, see e.g. this test page. After discussion on ...
Read more >
loadimage - Trellix Product Documentation
Loads a Sensor image file from the configured TFTP/SCP server. Syntax: loadimage WORD. loadimage tftp WORD. loadimage scp WORD. where WORD stands for ......
Read more >
Text Blitter Load Image Colors Inconsistent
When I load an image into a Text Blitter object in my game, the colors are slightly off from the bitmap file the...
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