diff --git a/src/io/readWriteImage.ts b/src/io/readWriteImage.ts index 41132c70..09a48dc5 100644 --- a/src/io/readWriteImage.ts +++ b/src/io/readWriteImage.ts @@ -23,17 +23,6 @@ export const writeImage = async (format: string, image: vtkImageData) => { // copyImage so writeImage does not detach live data when passing to worker const itkImage = copyImage(vtkITKHelper.convertVtkToItkImage(image)); - // Transpose the direction matrix to fix bug in @itk-wasm/image-io.writeImage - // Remove when @itk-wasm/image-io version is above 0.5.0 https://github.com/InsightSoftwareConsortium/itk-wasm/commit/ad9ca85eedc47c9d3444cf36859569c529886bde - const oldDirection = [...itkImage.direction]; - const { dimension } = itkImage.imageType; - for (let idx = 0; idx < dimension; ++idx) { - for (let idy = 0; idy < dimension; ++idy) { - itkImage.direction[idx + idy * dimension] = - oldDirection[idy + idx * dimension]; - } - } - const result = await writeImageItk(itkImage, `image.${format}`, { webWorker: getWorker(), });