From ad9ca85eedc47c9d3444cf36859569c529886bde Mon Sep 17 00:00:00 2001 From: Paul Elliott Date: Wed, 6 Dec 2023 14:53:56 -0500 Subject: [PATCH] fix(write-image): avoid transposing direction matrix Fixes #1011 --- packages/image-io/write-image.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/image-io/write-image.cxx b/packages/image-io/write-image.cxx index 2de92abe7..8975ea130 100644 --- a/packages/image-io/write-image.cxx +++ b/packages/image-io/write-image.cxx @@ -117,7 +117,7 @@ int writeImage(itk::wasm::InputImageIO & inputImageIO, itk::wasm::OutputTextStre { for (unsigned int dd = 0; dd < dimension; ++dd) { - direction[dd] = directionContainer->GetElement(dim*dimension + dd); + direction[dd] = directionContainer->GetElement(dim + dimension*dd); } imageIO->SetDirection(dim, direction); imageIO->SetOrigin(dim, inputImageIOBase->GetOrigin(dim));