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

Added statistics calculator for Annotation Tools #723

Merged
merged 10 commits into from
Aug 30, 2023

Conversation

Celian-abd
Copy link
Contributor

Context

Refactored the stats calculation code for Annotation Tools and added a way to create and initialize new calculator with custom statistics.

Changes

  • Added new class BasicStatsCalculator, which has the default stats such as max, mean , stdDev.. used by the annotation tools instead of using callbacks.
  • Made RectangleROITool statistics calculation match the other tools. (Using pointInShapeCallback instead of 3 'for')

Testing

stackAnnotationTools example.

Checklist

PR

  • [] My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

Public Documentation Updates

  • [] The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • [] "OS:
  • [] "Node version:
  • [] "Browser:

@netlify
Copy link

netlify bot commented Aug 3, 2023

Deploy Preview for cornerstone-3d-docs ready!

Name Link
🔨 Latest commit de44348
🔍 Latest deploy log https://app.netlify.com/sites/cornerstone-3d-docs/deploys/64ef4c8ef959320008e8cd61
😎 Deploy Preview https://deploy-preview-723--cornerstone-3d-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Celian-abd Celian-abd marked this pull request as ready for review August 25, 2023 13:52
@Celian-abd
Copy link
Contributor Author

@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 setToolConfiguration method.

I've created a new example aswell (stackAnnotationToolsSpecificConfiguration)

Copy link
Member

@sedghi sedghi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see my comments

Copy link
Member

@sedghi sedghi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see my comments

@Celian-abd Celian-abd requested a review from sedghi August 29, 2023 13:56
Copy link
Member

@sedghi sedghi left a 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.

@Celian-abd Celian-abd requested a review from sedghi August 30, 2023 13:02
addTool: {
(
toolName: string,
toolConfiguration?: Record<any, any> & { statsCalculator?: Calculator }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be ToolConfiguration

Copy link
Contributor Author

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,
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, no worries

Copy link
Member

@sedghi sedghi left a 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

@Celian-abd Celian-abd requested a review from sedghi August 30, 2023 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants