Skip to content

Commit

Permalink
Merge pull request #287 from LinkunGao/feat/v2.0.1
Browse files Browse the repository at this point in the history
Feat/v2.0.1
  • Loading branch information
LinkunGao authored Nov 4, 2023
2 parents d4ab09f + ac0eb7d commit 005faf5
Show file tree
Hide file tree
Showing 10 changed files with 251 additions and 121 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/algolia.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

# The full version, including alpha/beta/rc tags

release = 'v1.15.23'
release = 'v2.0.1'



Expand Down
8 changes: 8 additions & 0 deletions docs/source/release/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -1921,3 +1921,11 @@ throttle(callback: (event: MouseEvent) => void, wait: number): (event: MouseEven
## Release v1.15.23

- fixed the cursor not center issue.

## Release v2.0.1

Huge update:

- apidocs
- segmentation functions
- bug fix
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.0.0",
"version": "2.0.1",
"main": "dist/bundle.umd.js",
"moudle": "dist/bundle.esm.js",
"types": "dist/types/index.d.ts",
Expand Down
10 changes: 5 additions & 5 deletions src/Utils/segmentation/DragOperator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export class DragOperator {
gui_states: IGUIStates,
protectedData: IProtected,
drawingPrameters: IDrawingEvents,

setSyncsliceNum: () => void,
setIsDrawFalse: (target: number) => void,
flipDisplayImageByAxis: () => void,
Expand Down Expand Up @@ -96,10 +97,11 @@ export class DragOperator {
};
}

drag(opts?: IDragOpts) {
console.log(this.protectedData);
console.log(this.protectedData.mainPreSlices);
setShowDragNumberDiv(sliceIndexContainer: HTMLDivElement) {
this.showDragNumberDiv = sliceIndexContainer;
}

drag(opts?: IDragOpts) {
this.dragPrameters.h = this.container.offsetHeight;

this.sensitiveArray.reverse();
Expand Down Expand Up @@ -138,8 +140,6 @@ export class DragOperator {
);
}

console.log("move", this.dragPrameters.move);

this.updateIndex(this.dragPrameters.move);
opts?.getSliceNum &&
opts.getSliceNum(
Expand Down
25 changes: 22 additions & 3 deletions src/Utils/segmentation/NrrdTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export class NrrdTools extends DrawToolCore {

private initState: boolean = true;
private preTimer: any;
private guiParameterSettings: any;

constructor(container: HTMLDivElement) {
super(container);
Expand Down Expand Up @@ -88,6 +89,10 @@ export class NrrdTools extends DrawToolCore {
}
}

setDisplaySliceIndexPanel(panel: HTMLDivElement) {
this.dragOperator.setShowDragNumberDiv(panel);
}

/**
* Set up GUI for drawing panel
* @param gui GUI
Expand All @@ -111,6 +116,7 @@ export class NrrdTools extends DrawToolCore {
clearPaint: this.clearPaint,
clearStoreImages: this.clearStoreImages,
updateSlicesContrast: this.updateSlicesContrast,
setMainAreaSize: this.setMainAreaSize,
resetPaintAreaUIPosition: this.resetPaintAreaUIPosition,
resizePaintArea: this.resizePaintArea,
repraintCurrentContrastSlice: this.repraintCurrentContrastSlice,
Expand All @@ -122,7 +128,14 @@ export class NrrdTools extends DrawToolCore {
filterDrawedImage: this.filterDrawedImage,
setEmptyCanvasSize: this.setEmptyCanvasSize,
};
setupGui(guiOptions);
this.guiParameterSettings = setupGui(guiOptions);
}

getGuiSettings() {
return {
guiState: this.gui_states,
guiSetting: this.guiParameterSettings,
};
}

/**
Expand Down Expand Up @@ -716,7 +729,7 @@ export class NrrdTools extends DrawToolCore {
}

setMainAreaSize(factor: number) {
this.nrrd_states.sizeFoctor += factor;
this.nrrd_states.sizeFoctor = factor;

if (this.nrrd_states.sizeFoctor >= 8) {
this.nrrd_states.sizeFoctor = 8;
Expand All @@ -725,7 +738,7 @@ export class NrrdTools extends DrawToolCore {
}
this.resizePaintArea(this.nrrd_states.sizeFoctor);
this.resetPaintAreaUIPosition();
this.setIsDrawFalse(1000);
// this.setIsDrawFalse(1000);
}

getContainer() {
Expand Down Expand Up @@ -965,6 +978,11 @@ export class NrrdTools extends DrawToolCore {
this.protectedData.canvases.displayCanvas.style.top =
this.protectedData.canvases.drawingCanvas.style.top = t + "px";
} else {
this.protectedData.canvases.displayCanvas.style.left =
this.protectedData.canvases.drawingCanvas.style.left = "";
this.protectedData.canvases.displayCanvas.style.top =
this.protectedData.canvases.drawingCanvas.style.top = "";

this.protectedData.mainAreaContainer.style.justifyContent = "center";
this.protectedData.mainAreaContainer.style.alignItems = "center";
}
Expand Down Expand Up @@ -1016,6 +1034,7 @@ export class NrrdTools extends DrawToolCore {
/**
* clear canvas
*/

this.protectedData.canvases.originCanvas.width =
this.protectedData.canvases.originCanvas.width;
this.protectedData.canvases.displayCanvas.width =
Expand Down
Loading

0 comments on commit 005faf5

Please sign in to comment.