-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from tinevez/main
I/O utilities to facilitate TrackMate interoperability Co-Authored-By: Jean-Yves Tinevez <[email protected]>
- Loading branch information
Showing
6 changed files
with
128 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,35 @@ | ||
from shell import shell | ||
import os | ||
from pathlib import Path | ||
|
||
from test_data import example_dataset | ||
|
||
|
||
def test_cli_parser(): | ||
result = shell("trackastra") | ||
assert result.code == 0 | ||
result = os.system("trackastra") | ||
assert result == 0 | ||
|
||
|
||
def test_cli_tracking(): | ||
def test_cli_tracking_from_folder(): | ||
example_dataset() | ||
result = shell( | ||
"trackastra track -i test_data/img -m test_data/TRA --model-pretrained general_2d" # noqa: RUF100 | ||
) | ||
assert result.code == 0 | ||
cmd = "trackastra track -i test_data/img -m test_data/TRA --output-ctc test_data/tracked --output-edge-table test_data/tracked.csv --model-pretrained general_2d" # noqa: RUF100 | ||
print(cmd) | ||
result = os.system(cmd) | ||
assert Path("test_data/tracked").exists() | ||
assert Path("test_data/tracked.csv").exists() | ||
assert result == 0 | ||
|
||
|
||
def test_cli_tracking_from_file(): | ||
root = Path(__file__).parent.parent / "trackastra" / "data" / "resources" | ||
print(root) | ||
assert root.exists() | ||
output_ctc = Path("test_data") / "tracked_bacteria" | ||
output_edge_table = Path("test_data") / "tracked_bacteria.csv" | ||
|
||
cmd = f"trackastra track -i {root / 'trpL_150310-11_img.tif'} -m {root / 'trpL_150310-11_mask.tif'} --output-ctc {output_ctc} --output-edge-table {output_edge_table} --model-pretrained general_2d" # noqa: RUF100 | ||
print(cmd) | ||
result = os.system(cmd) | ||
|
||
assert output_ctc.exists() | ||
assert output_edge_table.exists() | ||
assert result == 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters