|
3 | 3 | import numpy as np |
4 | 4 | import matplotlib.pyplot as plt |
5 | 5 | from dataclasses import dataclass |
6 | | -from typing import List, Tuple, Dict, Any |
| 6 | +from typing import List, Tuple, Dict, Any, Literal |
7 | 7 | from pathlib import Path |
8 | 8 |
|
9 | 9 | from cheese3d.synchronize.aligners import (BaseAligner, |
|
19 | 19 | class SyncConfig: |
20 | 20 | pipeline: List[str] |
21 | 21 | led_threshold: float = 0.9 |
| 22 | + led_peak_algorithm: Literal["dynamic", "max"] = "dynamic" |
22 | 23 | max_regression_rmse: float = 1e-2 |
23 | 24 | ref_view: str = "bottomcenter" |
24 | 25 | ref_crop: str = "default" |
@@ -234,12 +235,14 @@ def synchronize_videos(pipeline_cfg: SyncConfig, |
234 | 235 | ref_reader = VideoSyncReader(source=ref_video, |
235 | 236 | sample_rate=fps, |
236 | 237 | threshold=pipeline_cfg.led_threshold, |
| 238 | + peak_algorithm=pipeline_cfg.led_peak_algorithm, |
237 | 239 | crop=ref_crop) |
238 | 240 | align_params = {"ref": (ref_video, 0, fps)} |
239 | 241 | for view, (video, crop) in videos.items(): |
240 | 242 | target_reader = VideoSyncReader(source=video, |
241 | 243 | sample_rate=fps, |
242 | 244 | threshold=pipeline_cfg.led_threshold, |
| 245 | + peak_algorithm=pipeline_cfg.led_peak_algorithm, |
243 | 246 | crop=crop) |
244 | 247 | pipeline = SyncPipeline.from_cfg(pipeline_cfg, ref_reader, target_reader) |
245 | 248 | target_path = pipeline.target.root_path() |
@@ -267,6 +270,7 @@ def synchronize_ephys(pipeline_cfg: SyncConfig, |
267 | 270 | video_reader = VideoSyncReader(source=ref_video, |
268 | 271 | sample_rate=fps, |
269 | 272 | threshold=pipeline_cfg.led_threshold, |
| 273 | + peak_algorithm=pipeline_cfg.led_peak_algorithm, |
270 | 274 | crop=ref_crop) |
271 | 275 | ephys_reader = get_ephys_reader(ephys_path, ephys_params) |
272 | 276 | pipeline = SyncPipeline.from_cfg(pipeline_cfg, video_reader, ephys_reader) |
|
0 commit comments