Skip to content

Commit

Permalink
Merge pull request #309 from LinkunGao/feat/v2.1.3
Browse files Browse the repository at this point in the history
Feat/v2.1.3
  • Loading branch information
LinkunGao authored Dec 10, 2024
2 parents a417163 + 427585e commit 9330b54
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "copper3d",
"description": "A 3d visualisation package base on threejs provides multiple scenes and Nrrd image load funtion.",
"version": "2.1.2",
"version": "2.1.3",
"main": "dist/bundle.umd.js",
"moudle": "dist/bundle.esm.js",
"types": "dist/types/index.d.ts",
Expand Down
8 changes: 4 additions & 4 deletions src/Utils/segmentation/DrawToolCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,7 @@ export class DrawToolCore extends CommToolsData {
},
y: {
x: (val: number) => Math.ceil((val / nrrd_y_mm) * dimensions[1]),
z: (val: number) => Math.ceil((val / nrrd_z_mm) * dimensions[2]),
z: (val: number) => Math.ceil((1- val / nrrd_z_mm) * dimensions[2]),
},
z: {
x: (val: number) => Math.ceil((val / nrrd_x_mm) * dimensions[0]),
Expand All @@ -1359,7 +1359,7 @@ export class DrawToolCore extends CommToolsData {
x: (sliceIndex: number) =>
Math.ceil((sliceIndex / dimensions[2]) * nrrd_z_mm),
y: (sliceIndex: number) =>
Math.ceil((sliceIndex / dimensions[2]) * nrrd_z_mm),
Math.ceil((1 - sliceIndex / dimensions[2]) * nrrd_z_mm),
},
};

Expand All @@ -1375,7 +1375,7 @@ export class DrawToolCore extends CommToolsData {
currentIndex = convertIndex[from][to](cursorNumX);
oldIndex = currentIndex * ratios.x;
convertCursorNumY = convertCursor[from][to](currentSliceIndex);
convertCursorNumX = cursorNumY;
convertCursorNumX = dimensions[2] * ratios.z - cursorNumY;
} else if (from === "z" && to === "y") {
currentIndex = convertIndex[from][to](cursorNumY);
oldIndex = currentIndex * ratios[to];
Expand All @@ -1385,7 +1385,7 @@ export class DrawToolCore extends CommToolsData {
currentIndex = convertIndex[from][to](cursorNumY);
oldIndex = currentIndex * ratios[to];
convertCursorNumX = convertCursor[from][to](currentSliceIndex);
convertCursorNumY = cursorNumX;
convertCursorNumY = dimensions[2] * ratios.z - cursorNumX;
} else if (from === "x" && to === "z") {
currentIndex = convertIndex[from][to](cursorNumX);
oldIndex = currentIndex * ratios[to];
Expand Down
6 changes: 6 additions & 0 deletions src/Utils/segmentation/NrrdTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,12 @@ export class NrrdTools extends DrawToolCore {
0,
-this.nrrd_states.changedHeight
);
}else if (this.protectedData.axis === "y") {
this.protectedData.ctxes.displayCtx?.scale(1, -1);
this.protectedData.ctxes.displayCtx?.translate(
0,
-this.nrrd_states.changedHeight
);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ import { IPaintImage, ICommXYZ } from "./Utils/segmentation/coreTools/coreType";

import "./css/style.css";

export const REVISION = "v2.1.2";
export const REVISION = "v2.1.3";

console.log(
"%cCopper3D Visualisation %cBeta:v2.1.2",
"%cCopper3D Visualisation %cBeta:v2.1.3",
"padding: 3px;color:white; background:#023047",
"padding: 3px;color:white; background:#f50a25"
);
Expand Down

0 comments on commit 9330b54

Please sign in to comment.