9
9
10
10
# %% create training and validation dataset
11
11
# TODO: Modify path to the input data
12
- input_data_path = "/training_data.zarr"
13
- # TODO: Modify path to the output data
14
- track_data_path = "/training_data_tracks.zarr"
15
-
12
+ input_track_path = "/hpc/projects/intracellular_dashboard/organelle_dynamics/2025_07_24_A549_SEC61_TOMM20_G3BP1_ZIKV/1-preprocess/label-free/3-track/2025_07_24_A549_SEC61_TOMM20_G3BP1_ZIKV_cropped.zarr"
13
+ output_track_path = "/hpc/projects/organelle_phenotyping/models/SEC61_TOMM20_G3BP1_Sensor/time_interval/dynaclr_gfp_rfp_ph_2D/classical/data/2025_07_24_A549_SEC61_TOMM20_G3BP1_ZIKV_classical_fake_tracks.zarr"
16
14
# TODO: Modify the channel name to the one you are using for the segmentation mask
17
- segmentation_channel_name = "Nucl_mask "
15
+ segmentation_channel_name = "nuclei_prediction_labels_labels "
18
16
# TODO: Modify the z-slice to the one you are using for the segmentation mask
19
- Z_SLICE = 30
17
+ Z_SLICE = 0
20
18
# %%
21
19
"""
22
20
Add csvs with fake tracking to tracking data.
@@ -67,38 +65,33 @@ def save_track_df(track_df, well_id, pos_name, out_path):
67
65
def main ():
68
66
# Load the input segmentation data
69
67
zarr_input = open_ome_zarr (
70
- input_data_path ,
71
- layout = "hcs" ,
72
- mode = "r+" ,
68
+ input_track_path ,
69
+ mode = "r" ,
73
70
)
74
71
chan_names = zarr_input .channel_names
75
- assert (
76
- segmentation_channel_name in chan_names
77
- ), "Channel name not found in the input data"
72
+ assert segmentation_channel_name in chan_names , (
73
+ "Channel name not found in the input data"
74
+ )
78
75
79
76
# Create the empty store for the tracking data
80
77
position_names = []
81
78
for ds , position in zarr_input .positions ():
82
79
position_names .append (tuple (ds .split ("/" )))
83
80
84
81
create_empty_plate (
85
- store_path = track_data_path ,
82
+ store_path = output_track_path ,
86
83
position_keys = position_names ,
87
- channel_names = segmentation_channel_name ,
84
+ channel_names = [ segmentation_channel_name ] ,
88
85
shape = (1 , 1 , 1 , * position .data .shape [3 :]),
89
86
chunks = position .data .chunks ,
90
87
scale = position .scale ,
91
88
)
92
-
89
+ #
93
90
# Populate the tracking data
94
- with open_ome_zarr (track_data_path , layout = "hcs" , mode = "r+" ) as track_store :
91
+ with open_ome_zarr (output_track_path , layout = "hcs" , mode = "r+" ) as track_store :
95
92
# Create progress bar for wells and positions
96
93
for well_id , well_data in tqdm (zarr_input .wells (), desc = "Processing wells" ):
97
- for pos_name , pos_data in tqdm (
98
- well_data .positions (),
99
- desc = f"Processing positions in { well_id } " ,
100
- leave = False ,
101
- ):
94
+ for pos_name , pos_data in well_data .positions ():
102
95
data = pos_data .data
103
96
T , C , Z , Y , X = data .shape
104
97
track_df_all = pd .DataFrame ()
@@ -110,7 +103,7 @@ def main():
110
103
track_pos ["0" ][0 , 0 , 0 ] = seg_mask
111
104
track_df = create_track_df (seg_mask , time )
112
105
track_df_all = pd .concat ([track_df_all , track_df ])
113
- save_track_df (track_df_all , well_id , pos_name , track_data_path )
106
+ save_track_df (track_df_all , well_id , pos_name , output_track_path )
114
107
zarr_input .close ()
115
108
116
109
0 commit comments