Skip to content

Commit 9756fe8

Browse files
authored
Merge pull request #196 from LinkunGao/release/v1.13.29
Release/v1.13.29
2 parents e985794 + 1850fd2 commit 9756fe8

File tree

6 files changed

+35
-28
lines changed

6 files changed

+35
-28
lines changed

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
author = 'LinkunGao'
2323

2424
# The full version, including alpha/beta/rc tags
25-
release = 'v1.13.28'
25+
release = 'v1.13.29'
2626

2727

2828
# -- General configuration ---------------------------------------------------

docs/source/release/release.md

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

15211521
- update getMask() type
1522+
1523+
## Release v1.13.29
1524+
1525+
- fixed the load mask function bug.
1526+
- if load a empty mask accidentally, there is no bugs any more!

package-lock.json

Lines changed: 1 addition & 1 deletion
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.13.28",
4+
"version": "1.13.29",
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: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -305,34 +305,36 @@ export class nrrd_tools {
305305
}
306306

307307
setMasksData(masksData: exportPaintImageType[], loadingBar?: loadingBarType) {
308-
this.nrrd_states.loadMaskJson = true;
309-
if (loadingBar) {
310-
let { loadingContainer, progress } = loadingBar;
311-
loadingContainer.style.display = "flex";
312-
progress.innerText = "Loading masks data......";
313-
}
314-
315-
this.setEmptyCanvasSize();
308+
if (!!masksData) {
309+
this.nrrd_states.loadMaskJson = true;
310+
if (loadingBar) {
311+
let { loadingContainer, progress } = loadingBar;
312+
loadingContainer.style.display = "flex";
313+
progress.innerText = "Loading masks data......";
314+
}
316315

317-
masksData.forEach((mask, index) => {
318-
let imageData = this.emptyCtx.createImageData(
319-
this.nrrd_states.nrrd_x_centimeter,
320-
this.nrrd_states.nrrd_y_centimeter
321-
);
322316
this.setEmptyCanvasSize();
323317

324-
for (let j = 0; j < mask.data.length; j++) {
325-
imageData.data[j] = mask.data[j];
326-
}
318+
masksData.forEach((mask, index) => {
319+
let imageData = this.emptyCtx.createImageData(
320+
this.nrrd_states.nrrd_x_centimeter,
321+
this.nrrd_states.nrrd_y_centimeter
322+
);
323+
this.setEmptyCanvasSize();
327324

328-
this.emptyCtx.putImageData(imageData, 0, 0);
325+
for (let j = 0; j < mask.data.length; j++) {
326+
imageData.data[j] = mask.data[j];
327+
}
329328

330-
this.storeAllImages(index);
331-
});
332-
this.nrrd_states.loadMaskJson = false;
333-
this.gui_states.resetZoom();
334-
if (loadingBar) {
335-
loadingBar.loadingContainer.style.display = "none";
329+
this.emptyCtx.putImageData(imageData, 0, 0);
330+
331+
this.storeAllImages(index);
332+
});
333+
this.nrrd_states.loadMaskJson = false;
334+
this.gui_states.resetZoom();
335+
if (loadingBar) {
336+
loadingBar.loadingContainer.style.display = "none";
337+
}
336338
}
337339
}
338340

src/index.ts

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

3737
import "./css/style.css";
3838

39-
export const REVISION = "v1.13.28";
39+
export const REVISION = "v1.13.29";
4040

4141
console.log(
42-
"%cCopper3D Visualisation %cBeta:v1.13.28",
42+
"%cCopper3D Visualisation %cBeta:v1.13.29",
4343
"padding: 3px;color:white; background:#023047",
4444
"padding: 3px;color:white; background:#f50a25"
4545
);

0 commit comments

Comments
 (0)