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

Writing 4D images with a single volume #63

Closed
nilgoyette opened this issue Feb 5, 2020 · 0 comments · Fixed by #64
Closed

Writing 4D images with a single volume #63

nilgoyette opened this issue Feb 5, 2020 · 0 comments · Fixed by #64

Comments

@nilgoyette
Copy link
Collaborator

This snippet currently produces a mangled image, as if the bytes are written in the wrong order.

let mut data = Array4::zeros((5, 5, 4, 3));
data.slice_mut(s![.., 2, 2, 0]).fill(1.0);
data.slice_mut(s![.., 3, 2, 0]).fill(1.1);
write_nifti("/tmp/test.nii.gz", &data.select(Axis(3), &[0]), None).unwrap();

Changing the indices to &[0, 1] works well. This tells me that writing a 4D image with a single volume is broken. I had no success fixing it yet but I'm working on it.

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.

1 participant