Skip to content

Commit

Permalink
predictor and downscale
Browse files Browse the repository at this point in the history
  • Loading branch information
bgraedel committed Dec 15, 2023
1 parent ba17ac8 commit e0bd217
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/arcospx/_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ def track_events(
epsPrev: float = 0,
minClSz: int = 9,
nPrev: int = 1,
downscale=1,
use_predictor: bool = False,
dims: str = "TXY",
) -> FunctionWorker[LayerDataTuple]:
if arcos_worker is not None and arcos_worker.is_running:
Expand Down Expand Up @@ -127,14 +129,18 @@ def track_events_2() -> LayerDataTuple:
},
}

eps_adjusted = eps / downscale
epsPrev_adjusted = epsPrev / downscale if epsPrev else None
minClSz_adjusted = int(minClSz ** (1 / downscale))

Check warning on line 134 in src/arcospx/_widget.py

View check run for this annotation

Codecov / codecov/patch

src/arcospx/_widget.py#L132-L134

Added lines #L132 - L134 were not covered by tests

linker = Linker(
eps=eps,
epsPrev=epsPrev if epsPrev else None,
minClSz=minClSz,
eps=eps_adjusted,
epsPrev=epsPrev_adjusted,
minClSz=minClSz_adjusted,
nPrev=nPrev,
predictor=False,
predictor=use_predictor,
)
tracker = ImageTracker(linker)
tracker = ImageTracker(linker, downscale)

Check warning on line 143 in src/arcospx/_widget.py

View check run for this annotation

Codecov / codecov/patch

src/arcospx/_widget.py#L143

Added line #L143 was not covered by tests
# find indices of T in dims
img_tracked = np.zeros_like(selected_image, dtype=np.uint16)
for idx, timepoint in enumerate(tracker.track(selected_image, dims)):
Expand Down

0 comments on commit e0bd217

Please sign in to comment.