Skip to content

Commit 738b6f1

Browse files
committed
Fix selected voxel coordinates
1 parent 671a525 commit 738b6f1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

website/nifti-viewer/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ function handleVoxelClick(currentVoxel) {
8989
const [nx, ny, nz, nt] = dims;
9090
let [voxelX, voxelY, voxelZ] = currentVoxel;
9191

92-
voxelX = Math.min(Math.max(Math.round(voxelX), 1), nx) - 1;
93-
voxelY = Math.min(Math.max(ny - Math.round(voxelY), 1), ny) - 1;
94-
voxelZ = Math.min(Math.max(nz - Math.round(voxelZ), 1), nz) - 1;
92+
voxelX = Math.min(Math.max(Math.round(voxelX), 1), nx);
93+
voxelY = Math.min(Math.max(ny - Math.round(voxelY), 1), ny);
94+
voxelZ = Math.min(Math.max(nz - Math.round(voxelZ), 1), nz);
9595

9696
const voxelValues = getVoxelValuesAcrossTime(voxelX, voxelY, voxelZ, nx, ny, nz, nt);
9797
updateVoxelCoordinatesDisplay(voxelX + 1, voxelY + 1, voxelZ + 1);

0 commit comments

Comments
 (0)