-
Notifications
You must be signed in to change notification settings - Fork 327
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
Planar freehand roi tool #89
Conversation
…clear criteria for the preview contour
…rag to draw transition.
…ol-resyncWithMain
…nt index for calculations
*/ | ||
export default function drawPolyline( | ||
svgDrawingHelper: any, | ||
toolName: string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm reviewing toolName
as argument in my PR (ArrowAnnotate), so if yours goes first, it is fine, otherwise, we should remove this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll make this change once your PR is merged.
topRight: Types.Point3; | ||
bottomLeft: Types.Point3; | ||
bottomRight: Types.Point3; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does PolyLine support textBox? I didn't see it in the demo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't yet as that isn't in scope for my client's piece of work at this moment. I believe. However its here because it inherits from Annotation, and it would be more painful to make it not inherit and be different from everything else for now. I'll add a comment, I think it will come in a future PR at some point.
packages/tools/src/utilities/math/polyline/getIntersectionWithPolyline.ts
Outdated
Show resolved
Hide resolved
packages/tools/src/tools/annotation/planarFreehandROITool/editLoopCommon.ts
Outdated
Show resolved
Hide resolved
packages/tools/src/tools/annotation/planarFreehandROITool/editLoopCommon.ts
Show resolved
Hide resolved
* Returns `true` if the point `p` can project onto point (`p1`, `p2`), and if | ||
* this projected point is less than `proximity` units away. | ||
*/ | ||
const pointCanProjectOnLine = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function name does not match its output, I expected a boolean output, but it is number | false
const p1 = previousPoint; | ||
const p2 = viewport.worldToCanvas(points[i]); | ||
|
||
const distance = pointCanProjectOnLine(canvasCoords, p1, p2, proximity); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
distance = pointCanProjectOnLine(
seems weird, since it is used later as a boolean check maybe do canProject
or just if (pointCanProject...)
const pStart = viewport.worldToCanvas(points[0]); | ||
const pEnd = viewport.worldToCanvas(points[points.length - 1]); | ||
|
||
const distance = pointCanProjectOnLine( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
packages/tools/src/tools/annotation/planarFreehandROITool/renderMethods.ts
Show resolved
Hide resolved
packages/tools/src/tools/annotation/planarFreehandROITool/renderMethods.ts
Show resolved
Hide resolved
packages/tools/src/tools/annotation/planarFreehandROITool/renderMethods.ts
Show resolved
Hide resolved
packages/tools/src/tools/annotation/planarFreehandROITool/renderMethods.ts
Show resolved
Hide resolved
packages/tools/src/tools/annotation/planarFreehandROITool/renderMethods.ts
Show resolved
Hide resolved
Looks like an awesome tool. Had couple of comments, please see them. More general comment:
2022-05-02.12-18-12.mp4 |
Hmmmm. For your last comment/video, I think this is more of an issue of our default color selection for Cornerstone3D. All Cornerstone3D annotations currently go to selected state after being drawn, which I think makes sense? We are using the same color for selected and highlighted, when they mean semantically different things, for all annotations. You can only grab and interact in the highlighted state, not the selected state 🤔 . Maybe our default on CS3D should have a different color/shared for selected, we don't demonstrate this well at all. |
Worked on some comment, still need to resolve more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
WIP Planar Freehand ROI Tool.
More features to come in a different PR.
Live example: https://626f9a9da152cf7e6d378757--cs3d-docs.netlify.app/live-examples/planarfreehandroitool
Deploy preview: https://626f9a9da152cf7e6d378757--cs3d-docs.netlify.app/