Skip to content

Commit

Permalink
use motile >= 0.3 and update solver
Browse files Browse the repository at this point in the history
  • Loading branch information
AnniekStok committed Sep 12, 2024
1 parent e1f53d4 commit 87d3b22
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ install_requires =
magicgui
qtpy
scikit-image
motile < 0.3
motile >= 0.3
motile_toolbox >=0.2.5
pydantic
tifffile[all]
Expand Down
14 changes: 7 additions & 7 deletions src/motile_plugin/backend/solve.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ def construct_solver(
solver = Solver(
TrackGraph(cand_graph, frame_attribute=NodeAttr.TIME.value)
)
solver.add_constraints(MaxChildren(solver_params.max_children))
solver.add_constraints(MaxParents(1))
solver.add_constraint(MaxChildren(solver_params.max_children))
solver.add_constraint(MaxParents(1))

# Using EdgeDistance instead of EdgeSelection for the constant cost because
# the attribute is not optional for EdgeSelection (yet)
if solver_params.edge_selection_cost is not None:
solver.add_costs(
solver.add_cost(
EdgeDistance(
weight=0,
position_attribute=NodeAttr.POS.value,
Expand All @@ -104,20 +104,20 @@ def construct_solver(
name="edge_const",
)
if solver_params.appear_cost is not None:
solver.add_costs(Appear(solver_params.appear_cost))
solver.add_cost(Appear(solver_params.appear_cost))
if solver_params.division_cost is not None:
solver.add_costs(Split(constant=solver_params.division_cost))
solver.add_cost(Split(constant=solver_params.division_cost))

if solver_params.distance_cost is not None:
solver.add_costs(
solver.add_cost(
EdgeDistance(
position_attribute=NodeAttr.POS.value,
weight=solver_params.distance_cost,
),
name="distance",
)
if solver_params.iou_cost is not None:
solver.add_costs(
solver.add_cost(
EdgeSelection(
weight=solver_params.iou_cost,
attribute=EdgeAttr.IOU.value,
Expand Down

0 comments on commit 87d3b22

Please sign in to comment.