Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I am getting NRRDError: 'Size of the data does not equal to the product of all dimensions' #100

Closed
kishanbala opened this issue Nov 6, 2019 · 6 comments · Fixed by #101

Comments

@kishanbala
Copy link

I am trying to read data from an NRRD file. The nrrd.read_header() works fine. But when I give nrrd.read() or nrrd.read_data(), I get the above mentioned error. There are no duplicate fields in the header. Kindly help.

@addisonElliott
Copy link
Collaborator

Are you able to post the offending NRRD file?

Let's say the size of your data in the header says it is 10x3x6. The product of this means we should have 180 values. This error will be thrown if anything more than or less than 180 values are read.

@kishanbala
Copy link
Author

Are you able to post the offending NRRD file?

Let's say the size of your data in the header says it is 10x3x6. The product of this means we should have 180 values. This error will be thrown if anything more than or less than 180 values are read.

The size of the file is [ 2 2362 1945 450]

@addisonElliott
Copy link
Collaborator

Okay, it looks like this file is pretty big. My first guess is that Python is upset because the amount of RAM necessary is > 4GB. If you can, try to shrink the exact file down and attempt it again at < 4 GB. If that works, then my theory is correct.

I'm not exactly sure what the fix is yet. What version of Python are you using?

@kishanbala
Copy link
Author

Okay, it looks like this file is pretty big. My first guess is that Python is upset because the amount of RAM necessary is > 4GB. If you can, try to shrink the exact file down and attempt it again at < 4 GB. If that works, then my theory is correct.

I'm not exactly sure what the fix is yet. What version of Python are you using?

Using Python 3.7. yeah its big and my laptop ram is 8GB. I just wanted to try to read this data in my own laptop before working in the lab. And if possible, could you please let me know how can I shrink the file ?

@addisonElliott
Copy link
Collaborator

Okay, just wanted to make sure you were using a newer version of Python.

There's probably many ways to do it, but the first that comes to mind is to use 3D Slicer to load the file and shrink it. I can't remember what the option is to shrink it, but it's there somewhere.

@kishanbala
Copy link
Author

Ok .. thanks a ton!!! Will keep u posted if any updates. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants