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/v1.15.22 #264

Merged
merged 2 commits into from
Oct 2, 2023
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
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = 'LinkunGao'

# The full version, including alpha/beta/rc tags
release = 'v1.15.21'
release = 'v1.15.22'


# -- General configuration ---------------------------------------------------
Expand Down
5 changes: 5 additions & 0 deletions docs/source/release/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
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": "1.15.21",
"version": "1.15.22",
"main": "dist/bundle.umd.js",
"moudle": "dist/bundle.esm.js",
"types": "dist/types/index.d.ts",
Expand Down
13 changes: 8 additions & 5 deletions src/Utils/nrrd_tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
};
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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];
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
);
Expand Down
4 changes: 4 additions & 0 deletions src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ interface nrrdDrawImageOptType {
height: number,
clearAllFlag?: boolean
) => void;
getSphereData?:(
sphereOrigin:number[],
sphereRadius:number
)=>void
}

// kiwrious
Expand Down