-
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
Added statistics calculator for Annotation Tools #723
Conversation
✅ Deploy Preview for cornerstone-3d-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@sedghi Hey, I've been working on annotation tools and I added the feature to custom the text shown by the tool. So we can add custom text and also custom statistics calculator by the tool configuration. So now we can set our custom text and calculator when adding the tool into the toolgroup with it's configuration or also by I've created a new example aswell (stackAnnotationToolsSpecificConfiguration) |
packages/tools/src/utilities/math/basic/BasicStatsCalculator.ts
Outdated
Show resolved
Hide resolved
packages/tools/src/utilities/math/basic/BasicStatsCalculator.ts
Outdated
Show resolved
Hide resolved
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.
see my comments
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.
see my comments
packages/tools/src/utilities/math/basic/BasicStatsCalculator.ts
Outdated
Show resolved
Hide resolved
packages/tools/src/utilities/math/basic/BasicStatsCalculator.ts
Outdated
Show resolved
Hide resolved
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.
getting there, I really like this PR.
addTool: { | ||
( | ||
toolName: string, | ||
toolConfiguration?: Record<any, any> & { statsCalculator?: Calculator } |
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.
This should be ToolConfiguration
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.
Oh true , I forgot about it. I'll update it now
imageData, | ||
(pointLPS, pointIJK) => pointInEllipse(ellipseObj, pointLPS), | ||
stdCalculator, | ||
this.configuration.statsCalculator.run, |
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.
ok, I guess my bad, .run
reads too werid, let's have your callback back. Sorry about that
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.
Sure, no worries
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.
one last review comments, thanks
Context
Refactored the stats calculation code for Annotation Tools and added a way to create and initialize new calculator with custom statistics.
Changes
Testing
stackAnnotationTools example.
Checklist
PR
semantic-release format and guidelines.
Code
[] My code has been well-documented (function documentation, inline comments,
etc.)
[] I have run the
yarn build:update-api
to update the API documentation, and havecommitted the changes to this PR. (Read more here https://www.cornerstonejs.org/docs/contribute/update-api)
Public Documentation Updates
additions or removals.
Tested Environment