Skip to content

Commit

Permalink
fix half voxel shift ( DICOM )
Browse files Browse the repository at this point in the history
  • Loading branch information
bionoone committed Oct 26, 2022
1 parent 06476cb commit 397cb86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/RenderingEngine/Viewport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,11 @@ class Viewport implements IViewport {
const transformToOriginTx = vtkMatrixBuilder
.buildFromRadian()
.multiply(imageData.getIndexToWorld())
.translate(size[0] / 2, size[1] / 2, 0);
.translate((size[0] - 1) / 2.0, (size[1] - 1) / 2.0, 0);

const transformBackFromOriginTx = vtkMatrixBuilder
.buildFromRadian()
.translate(-size[0] / 2, -size[1] / 2, 0)
.translate(-(size[0] - 1) / 2.0, -(size[1] - 1) / 2.0, 0)
.multiply(imageData.getWorldToIndex());
if (flipH) {
this.flipHorizontal = flipHorizontal;
Expand Down

0 comments on commit 397cb86

Please sign in to comment.