diff --git a/docs/source/conf.py b/docs/source/conf.py index c6481e1..59d4b20 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -22,7 +22,7 @@ author = 'LinkunGao' # The full version, including alpha/beta/rc tags -release = 'v1.15.21' +release = 'v1.15.22' # -- General configuration --------------------------------------------------- diff --git a/docs/source/release/release.md b/docs/source/release/release.md index c61bbea..2904ab6 100644 --- a/docs/source/release/release.md +++ b/docs/source/release/release.md @@ -1912,3 +1912,8 @@ throttle(callback: (event: MouseEvent) => void, wait: number): (event: MouseEven const urls = ["icon0/url", "icon1/url"]; nrrdTools.setPencilIconUrls(urls); ``` + +# Release v1.15.22 + +- add a getSphereData in nrrdTools draw function + - for this function we can get the sphere raduis and the sphere origin in mm. \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 7d1238f..3be26d2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "copper3d", - "version": "1.15.21", + "version": "1.15.22", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "copper3d", - "version": "1.15.21", + "version": "1.15.22", "license": "Apache-2.0", "dependencies": { "@types/dat.gui": "^0.7.9", diff --git a/package.json b/package.json index 374a962..35639bc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "copper3d", "description": "A 3d visualisation package base on threejs provides multiple scenes and Nrrd image load funtion.", - "version": "1.15.21", + "version": "1.15.22", "main": "dist/bundle.umd.js", "moudle": "dist/bundle.esm.js", "types": "dist/types/index.d.ts", diff --git a/src/Utils/nrrd_tool.ts b/src/Utils/nrrd_tool.ts index cf83da4..e7065ea 100644 --- a/src/Utils/nrrd_tool.ts +++ b/src/Utils/nrrd_tool.ts @@ -159,6 +159,10 @@ export class nrrd_tools { height: number, clearAllFlag: boolean ) => {}, + getSphere:( + sphereOrigin:number[], + sphereRadius:number + )=>{}, defaultPaintCursor: switchPencilIcon("dot"), drawStartPos: new THREE.Vector2(1, 1), }; @@ -1432,6 +1436,7 @@ export class nrrd_tools { if (!!opts) { this.nrrd_states.getMask = opts?.getMaskData as any; + this.nrrd_states.getSphere = opts?.getSphereData as any; } this.sceneIn = sceneIn; @@ -1850,7 +1855,9 @@ export class nrrd_tools { this.drawSphereOnEachViews(i, "z"); } } - + + !!this.nrrd_states.getSphere && this.nrrd_states.getSphere(this.nrrd_states.sphereOrigin.z, this.nrrd_states.sphereRadius) + this.drawingCanvas.removeEventListener( "wheel", this.drawingPrameters.handleSphereWheel, @@ -2204,10 +2211,6 @@ export class nrrd_tools { 1, Math.min(this.nrrd_states.sphereRadius, 50) ); - console.log( - this.nrrd_states.sphereOrigin[this.axis][0], - this.nrrd_states.sphereOrigin[this.axis][1] - ); // get mouse position const mouseX = this.nrrd_states.sphereOrigin[this.axis][0]; diff --git a/src/index.ts b/src/index.ts index 4a02fcc..c462c71 100644 --- a/src/index.ts +++ b/src/index.ts @@ -42,10 +42,10 @@ import { import "./css/style.css"; -export const REVISION = "v1.15.21"; +export const REVISION = "v1.15.22"; console.log( - "%cCopper3D Visualisation %cBeta:v1.15.21", + "%cCopper3D Visualisation %cBeta:v1.15.22", "padding: 3px;color:white; background:#023047", "padding: 3px;color:white; background:#f50a25" ); diff --git a/src/types/types.ts b/src/types/types.ts index 39c870b..98c00d2 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -91,6 +91,10 @@ interface nrrdDrawImageOptType { height: number, clearAllFlag?: boolean ) => void; + getSphereData?:( + sphereOrigin:number[], + sphereRadius:number + )=>void } // kiwrious