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(segmentStatsCalculator): for calculation of statistics #1881

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

sedghi
Copy link
Member

@sedghi sedghi commented Mar 7, 2025

Introducing Instantiable Calculators

Sometimes, a static calculator just isn't enough. For example, if you want to loop through all the labelmap data and calculate statistics for each segment, you'll need to use separate calculators for each one.

Segment Statistics Calculation:

  • Introduced SegmentStatsCalculator to manage statistics for multiple segments, supporting both individual and collective modes for more versatile statistics calculations.

sedghi added 4 commits March 4, 2025 11:40
…individual and collective modes

This commit introduces a more flexible approach to calculating segmentation statistics by:
- Adding a new SegmentStatsCalculator to manage segment-specific statistics
- Supporting both 'individual' and 'collective' computation modes
- Refactoring VolumetricCalculator and BasicStatsCalculator to support more dynamic statistical analysis
- Updating segmentation statistics worker to use the new calculation method
- Improving example code to demonstrate new statistics calculation features
Copy link

netlify bot commented Mar 7, 2025

Deploy Preview for cornerstone-3d-docs ready!

Name Link
🔨 Latest commit 0e21633
🔍 Latest deploy log https://app.netlify.com/sites/cornerstone-3d-docs/deploys/67ca7ca0449a2400080f4734
😎 Deploy Preview https://deploy-preview-1881--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.

@sedghi sedghi changed the title feat/multi getStats feat(segmentStatsCalculator): for calculation of statistics Mar 7, 2025
}
): NamedStatistics {
const { spacing } = options;
const volumeUnit = spacing ? 'mm³' : 'voxels³';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add methods to getCalibratedLengthUnitsAndScale to get the appropriate volume unit. Also, voxel is the unit, voxels^3 would be a 9 dimensional hyper cube.

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.

2 participants