From db86a5472d790198c1ebf86112417ac164d82c85 Mon Sep 17 00:00:00 2001 From: Martin Weigert Date: Thu, 4 Jul 2024 15:52:55 +0200 Subject: [PATCH] Expose max_distance in cli --- trackastra/cli.py | 8 ++++++++ trackastra/data/wrfeat.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/trackastra/cli.py b/trackastra/cli.py index 7d24cc5..ea2ad00 100644 --- a/trackastra/cli.py +++ b/trackastra/cli.py @@ -68,6 +68,13 @@ def cli(): " https://github.com/weigertlab/trackastra#installation." ), ) + p_track.add_argument( + "--max-distance", + type=float, + default=128, + help="Maximum distance for linking cells.", + ) + p_track.add_argument( "--device", choices=["cuda", "mps", "cpu", "automatic"], @@ -110,6 +117,7 @@ def _track_from_disk(args): args.imgs, args.masks, mode=args.mode, + max_distance=args.max_distance ) if args.output_ctc: diff --git a/trackastra/data/wrfeat.py b/trackastra/data/wrfeat.py index 43829e2..20b3b17 100644 --- a/trackastra/data/wrfeat.py +++ b/trackastra/data/wrfeat.py @@ -458,7 +458,7 @@ def get_features( imgs = _check_dimensions(imgs, ndim) logger.info(f"Extracting features from {len(detections)} detections") if n_workers > 0: - features = joblib.Parallel(n_jobs=n_workers, backend="multiprocessing")( + features = joblib.Parallel(n_jobs=n_workers)( joblib.delayed(WRFeatures.from_mask_img)( # New axis for time component mask=mask[np.newaxis, ...],