Skip to content

Commit 943a3e0

Browse files
authored
Merge pull request #144 from LinkunGao/release/v1.12.20
Release/v1.12.20
2 parents 1984aec + 2943467 commit 943a3e0

File tree

5 files changed

+24
-12
lines changed

5 files changed

+24
-12
lines changed

docs/source/release/release.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,3 +1160,8 @@ const resetMainAreaSize = (factor: number) => {
11601160
## Release v1.12.19
11611161

11621162
- set default cursor to dot in nrrd_tools.
1163+
1164+
## Release v1.12.20
1165+
1166+
- Modify the drag method logic in nrrd_tools.
1167+
- now when user enable the showContrast (nrrdTools.setShowInMainArea(true)), the last slice's index contrast image will disable the drag function.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "copper3d_visualisation",
33
"description": "A 3d visualisation package base on threejs provides multiple scenes and Nrrd image load funtion.",
4-
"version": "1.12.19",
4+
"version": "1.12.20",
55
"main": "dist/bundle.umd.js",
66
"moudle": "dist/bundle.esm.js",
77
"types": "dist/types/index.d.ts",

src/Utils/nrrd_tool.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export class nrrd_tools {
2121
paintImages: paintImagesType = { x: [], y: [], z: [] };
2222
// store all contrast slices, include x, y, z orientation
2323
private allSlicesArray: Array<nrrdSliceType> = [];
24+
// to store all display slices, only include one orientation (e.g, x,y,z) for all contrast slices.
2425
private displaySlices: Array<any> = [];
2526
// Designed for reload displaySlices Array
2627
private backUpDisplaySlices: Array<any> = [];
@@ -373,7 +374,6 @@ export class nrrd_tools {
373374

374375
this.axis = axis;
375376
this.resetDisplaySlicesStatus();
376-
console.log(this.mainPreSlice);
377377
}
378378

379379
addSkip(index: number) {
@@ -425,8 +425,8 @@ export class nrrd_tools {
425425
}
426426
}
427427

428-
setShowInMainArea(flag: boolean) {
429-
this.nrrd_states.showContrast = flag;
428+
setShowInMainArea(isShowContrast: boolean) {
429+
this.nrrd_states.showContrast = isShowContrast;
430430
this.nrrd_states.contrastNum = 0;
431431
if (this.mainPreSlice) {
432432
this.redrawMianPreOnDisplayCanvas();
@@ -802,11 +802,18 @@ export class nrrd_tools {
802802
contrastModifyNum = move % this.displaySlices.length;
803803
this.nrrd_states.contrastNum += contrastModifyNum;
804804
if (move > 0) {
805-
sliceModifyNum = Math.floor(move / this.displaySlices.length);
805+
if (
806+
this.mainPreSlice.index / this.nrrd_states.RSARatio <
807+
this.nrrd_states.maxIndex
808+
) {
809+
sliceModifyNum = Math.floor(move / this.displaySlices.length);
806810

807-
if (this.nrrd_states.contrastNum > this.displaySlices.length - 1) {
808-
sliceModifyNum += 1;
809-
this.nrrd_states.contrastNum -= this.displaySlices.length;
811+
if (this.nrrd_states.contrastNum > this.displaySlices.length - 1) {
812+
sliceModifyNum += 1;
813+
this.nrrd_states.contrastNum -= this.displaySlices.length;
814+
}
815+
} else {
816+
sliceModifyNum = 0;
810817
}
811818
} else {
812819
sliceModifyNum = Math.ceil(move / this.displaySlices.length);

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ import {
3333

3434
import "./css/style.css";
3535

36-
export const REVISION = "v1.12.19";
36+
export const REVISION = "v1.12.20";
3737

3838
console.log(
39-
"%cCopper3D Visualisation %cBeta:v1.12.19",
39+
"%cCopper3D Visualisation %cBeta:v1.12.20",
4040
"padding: 3px;color:white; background:#023047",
4141
"padding: 3px;color:white; background:#f50a25"
4242
);

0 commit comments

Comments
 (0)