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

Direction array different with image-io round trip #1011

Closed
PaulHax opened this issue Dec 3, 2023 · 1 comment · Fixed by #1017
Closed

Direction array different with image-io round trip #1011

PaulHax opened this issue Dec 3, 2023 · 1 comment · Fixed by #1017

Comments

@PaulHax
Copy link
Collaborator

PaulHax commented Dec 3, 2023

While using the @itk-wasm/image-io typescript "demo webpage" the direction array of an input image is different than the output image.

Steps

  1. Using an image with non-trivial direction array.
  2. On image-io test webpage modified to console.log(image.direction), run readImage, note direction array.
  3. On writeImage, upload image, serializedImage set to out.nii, "Run".
  4. With readImage, load out.nii, note direction array. Expect array to be similar to input image direction.

With this image:
labelmap-nii.zip

Input direction array is
"0": 1, "1": -1.9901096072372604e-10, "2": 4.9618989722737154e-11, "3": 2.0510340648094427e-10, "4": 0.9702957283983676, "5": -0.24192188394878414, "6": 1.3830191008187543e-17, "7": 0.2419218870873018, "8": 0.970295729180888

After writing to .nii or .nrrd, readImage gives direction array
"0": 1, "1": 2.051034067230632e-10, "2": 1.3704920054353578e-17, "3": -1.9901096048879907e-10, "4": 0.9702957283983676, "5": 0.24192188394878414, "6": 4.9618989472755004e-11, "7": -0.2419218870873018, "8": 0.970295729180888

Indexes 5 and 7 are negated.

github-actions bot pushed a commit that referenced this issue Dec 6, 2023
# [1.0.0-b.158](itk-wasm-v1.0.0-b.157...itk-wasm-v1.0.0-b.158) (2023-12-06)

### Bug Fixes

* **write-image:** avoid transposing direction matrix ([ad9ca85](ad9ca85)), closes [#1011](#1011)

### Features

* **image-io:** export extensionToImageIo in index ([b9fffea](b9fffea))
Copy link

github-actions bot commented Dec 6, 2023

🎉 This issue has been resolved in version 1.0.0-b.158 🎉

The release is available on:

Your semantic-release bot 📦🚀

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