Skip to content

Direction array different with image-io round trip  #1011

Closed
@PaulHax

Description

@PaulHax

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions