Skip to content

Commit

Permalink
Fix selected voxel coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmedBasem20 committed Oct 14, 2024
1 parent 671a525 commit 738b6f1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions website/nifti-viewer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ function handleVoxelClick(currentVoxel) {
const [nx, ny, nz, nt] = dims;
let [voxelX, voxelY, voxelZ] = currentVoxel;

voxelX = Math.min(Math.max(Math.round(voxelX), 1), nx) - 1;
voxelY = Math.min(Math.max(ny - Math.round(voxelY), 1), ny) - 1;
voxelZ = Math.min(Math.max(nz - Math.round(voxelZ), 1), nz) - 1;
voxelX = Math.min(Math.max(Math.round(voxelX), 1), nx);
voxelY = Math.min(Math.max(ny - Math.round(voxelY), 1), ny);
voxelZ = Math.min(Math.max(nz - Math.round(voxelZ), 1), nz);

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

0 comments on commit 738b6f1

Please sign in to comment.