From ebbf1332771b685329b87155fa648e937b2fb0bf Mon Sep 17 00:00:00 2001 From: TeunHuijben Date: Mon, 11 May 2026 16:30:37 -0700 Subject: [PATCH] tmax parameter is EXCLUSIVE bound --- scripts/script_cropped_fov.py | 2 +- scripts/script_instanseg.py | 2 +- scripts/script_neuromast.py | 2 +- trackedit/DatabaseHandler.py | 4 ++-- trackedit/run.py | 2 +- trackedit/utils/utils.py | 4 ++++ 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/scripts/script_cropped_fov.py b/scripts/script_cropped_fov.py index 93d2e78..7895213 100644 --- a/scripts/script_cropped_fov.py +++ b/scripts/script_cropped_fov.py @@ -18,7 +18,7 @@ working_directory = Path("/home/teun.huijben/Documents/data/Ziwen/2025_07_24_A549/") # name of the database file to start from, or "latest" to start from the latest version, defaults to "data.db" db_filename_start = "latest" -# maximum number of frames display, defaults to None (use all frames) +# exclusive upper bound on frames to load (tmax=66 loads frames 0–65), defaults to None (use all frames) tmax = 66 # (Z),Y,X, defaults to (1, 1, 1) scale = (0.1494, 0.1494) diff --git a/scripts/script_instanseg.py b/scripts/script_instanseg.py index abfab2f..bf99923 100644 --- a/scripts/script_instanseg.py +++ b/scripts/script_instanseg.py @@ -18,7 +18,7 @@ ) # name of the database file to start from, or "latest" to start from the latest version, defaults to "data.db" db_filename_start = "latest" -# maximum number of frames display, defaults to None (use all frames) +# exclusive upper bound on frames to load (tmax=100 loads frames 0–99), defaults to None (use all frames) tmax = 100 # (Z),Y,X, defaults to (1, 1, 1) scale = (1.625, 0.40625, 0.40625) diff --git a/scripts/script_neuromast.py b/scripts/script_neuromast.py index 142bbe1..b7fb9af 100644 --- a/scripts/script_neuromast.py +++ b/scripts/script_neuromast.py @@ -18,7 +18,7 @@ ) # name of the database file to start from, or "latest" to start from the latest version, defaults to "data.db" db_filename_start = "latest" -# maximum number of frames display, defaults to None (use all frames) +# exclusive upper bound on frames to load (tmax=600 loads frames 0–599), defaults to None (use all frames) tmax = 600 # (Z),Y,X, defaults to (1, 1, 1) scale = (0.25, 0.108, 0.108) # microns diff --git a/trackedit/DatabaseHandler.py b/trackedit/DatabaseHandler.py index 0aef118..7b64f2e 100644 --- a/trackedit/DatabaseHandler.py +++ b/trackedit/DatabaseHandler.py @@ -44,7 +44,7 @@ def __init__( self, db_filename_old: str, working_directory: Path, - Tmax: int, + Tmax: int, # exclusive upper bound: Tmax=10 loads frames 0–9 scale: tuple, name: str, annotation_mapping: dict = None, @@ -556,7 +556,7 @@ def check_if_tmax_changed(self): # If max time is less than current Tmax, update it if ( current_max_time < self.Tmax - 1 - ): # Tmax of 600 means 599 is the last timepoint + ): # Tmax is exclusive: Tmax=600 loads frames 0–599 self.Tmax = current_max_time ( self.time_window, diff --git a/trackedit/run.py b/trackedit/run.py index 2652a97..9db2ced 100644 --- a/trackedit/run.py +++ b/trackedit/run.py @@ -58,7 +58,7 @@ def run_trackedit( Args: working_directory: Path to working directory db_filename: Name of database file - tmax: Maximum time point + tmax: Exclusive upper bound on time points to load (e.g. tmax=10 loads frames 0–9) scale: Scale factors for each dimension name: Name for the tracks layer time_chunk: Starting time chunk diff --git a/trackedit/utils/utils.py b/trackedit/utils/utils.py index 6c75745..f1050ca 100644 --- a/trackedit/utils/utils.py +++ b/trackedit/utils/utils.py @@ -260,6 +260,10 @@ def solution_dataframe_from_sql_with_tmax( database_path : str SQL database path (e.g. sqlite:///your.database.db) + tmax : int + Exclusive upper bound on time points to load. Nodes with t >= tmax are excluded + (e.g. tmax=10 loads frames 0–9). + columns : Sequence[sqla.Column], optional Queried columns, MUST include NodeDB.id. By default (NodeDB.id, NodeDB.parent_id, NodeDB.t, NodeDB.z, NodeDB.y, NodeDB.x)