Skip to content

[Feature] Full detector system integration with async acquisition hooks #5

@pskeshu

Description

@pskeshu

Description

Complete the integration between the detector system, pre/post-detection hooks, and the async acquisition pipeline via the sample state entity (embryos).

Current State

  • DetectionQueue processes volumes through detectors
  • Callback chain exists: volume → detection → state update
  • Sample state (embryos) stores detection results
  • Pre/post hooks not fully implemented

Requirements

1. Pre-Detection Hooks

  • Image preprocessing before detector runs
  • Configurable per detector
  • Examples: contrast enhancement, ROI extraction, temporal averaging

2. Post-Detection Hooks

  • Actions triggered after detection fires
  • Per-embryo state updates
  • Interval rule adjustments
  • Notification/logging

3. Sample State Connection

  • /embryos endpoint as central sample registry
  • Detection results → embryo semantic state
  • Acquisition parameters ← embryo requirements
  • Bidirectional: detections inform acquisition, acquisition feeds detection

4. Hook Configuration

  • Declarative hook definitions
  • Chain multiple hooks
  • Conditional execution

Technical Approach

  • Extend Detector class with pre/post hook lists
  • Create hook base class with execute(context) interface
  • Connect to EmbryoState.detection_results for state updates
  • Add semantic state fields to EmbryoState (developmental_stage, health_status)

Key Files

  • gently/agent/detector.py
  • gently/agent/detection_queue.py
  • gently/agent/state.py (EmbryoState)
  • gently/agent/timelapse_orchestrator.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    acquisitionAcquisition/timelapse relateddetectionDetector systemenhancementNew feature or requestpriority-highCritical for core functionality

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions