Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/v2.1.3 #309

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading