-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add export to trackmate format (#45)
- Loading branch information
Showing
10 changed files
with
340 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# REFACTOR: | ||
- merge multiple solver classes methods into constructor to make a single deeper function | ||
|
||
# TODO: | ||
- IMPORTANT: free nodes after each hierarchy insertation to database and measure performance. | ||
- IMPORTANT: refactor widget to use a tab per option (segment, link, track) | ||
- add warning when DB already contains data. | ||
- create homepage/docs. | ||
- document config | ||
- document database | ||
- option to lock segmentations from hypothesis viz widget | ||
|
||
# NOTES: | ||
- heuristic optimizer: | ||
- add monte-carlo (probabilist) moves into local search function | ||
- local search by removing a node and trying to add its overlapping nodes | ||
|
||
- slurm: | ||
- segment: 1hr 30min, 790 jobs | ||
- link: 30min, 789 jobs | ||
- track 1st: 2hr 30min, 8 jobs of 100 time points + overlap | ||
- track 2nd: 2hr, 8 jobs of 100 time points + overlap | ||
- export: 20min | ||
- total: about 7 hours | ||
- NOTES: | ||
- fix window overlap sql solution update by adding parents only when it already exists on solution | ||
- segment step memory usage must be improved, with Daxi dataset it's using about 100GB per frame | ||
- tracks should be divided into smaller chunks | ||
- reduce tracking model build time with vector variables | ||
|
||
# ARTICLE: | ||
- experiments comparing tracking results from essemble of connected components, watershed, cellpose, stardist vs their accuracy alone; | ||
- experiments comparing results from binary contour (their own algorithm post processing) vs contour obtained from network output directly; | ||
- cell-tracking challenge benchmark; | ||
- qualitative results our dataset and jan funke datasets; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from ultrack.core.export.ctc import to_ctc | ||
from ultrack.core.export.trackmate import to_trackmate | ||
from ultrack.core.export.tracks_layer import to_tracks_layer | ||
from ultrack.core.export.zarr import tracks_to_zarr |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from pathlib import Path | ||
|
||
import numpy as np | ||
import pandas as pd | ||
from pytrackmate import trackmate_peak_import | ||
|
||
from ultrack.core.database import NO_PARENT | ||
from ultrack.core.export.trackmate import tracks_layer_to_trackmate | ||
|
||
|
||
def test_trackmate_writer(tmp_path: Path) -> None: | ||
tracks_outpath = tmp_path / "tracks.xml" | ||
|
||
tracks_df = pd.DataFrame( | ||
{ | ||
"id": [1, 2, 3, 4], | ||
"parent_id": [NO_PARENT, 1, 2, 2], | ||
"track_id": [1, 1, 2, 3], | ||
"t": [0, 1, 2, 2], | ||
"z": [0, 0, 0, 0], | ||
"y": [10, 20, 30, 10], | ||
"x": [1, 2, 3, 1], | ||
} | ||
) | ||
|
||
xml_str = tracks_layer_to_trackmate(tracks_df) | ||
with open(tracks_outpath, "w") as f: | ||
f.write(xml_str) | ||
|
||
trackmate_df = trackmate_peak_import(tracks_outpath) | ||
print(trackmate_df) | ||
|
||
assert trackmate_df.shape[0] == tracks_df.shape[0] | ||
|
||
np.testing.assert_allclose( | ||
tracks_df[["t", "z", "y", "x"]], trackmate_df[["t_stamp", "z", "y", "x"]] | ||
) |
Oops, something went wrong.