Klaus 65 extend jpp table feature column code #39
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add Bout Statistics Feature
This PR adds bout statistics functionality to JABS-postprocess, enabling users to calculate and include aggregate bout-level metrics in behavior tables. This includes bout counts, duration statistics, and timing information.
Changes Made
New Method:
BoutTable.add_bout_statistics()in src/jabs_postprocess/utils/project_utils.pyCLI Integration
--add-statisticsflag to generate-tables commandadd-bout-statisticsfor post-processing existing tablesTesting
BoutTable.add_bout_statistics()method.New Statistics Added
All commands add these columns to bout tables:
total_bout_count: Number of behavior bouts per animalavg_bout_duration: Average bout duration per animalbout_duration_std: Standard deviation of bout durationsbout_duration_var: Variance of bout durationslatency_to_first_bout: Frame number of first behavior boutUsage Examples
During table generation:
Post-processing existing tables:
Backward Compatibility
This feature is fully backward compatible: