@@ -106,35 +106,39 @@ def post_transfer(
106106 return
107107
108108 if source :
109- dcg_tag = ensure_dcg_exists (
110- collection_type = "spa" ,
111- metadata_source = source ,
112- environment = environment ,
113- token = self ._token ,
114- )
115109 gs_pix_positions = get_grid_square_atlas_positions (
116110 source .parent / partial_path
117111 )
118- for gs , pos_data in gs_pix_positions .items ():
119- if pos_data :
120- capture_post (
121- base_url = str (environment .url .geturl ()),
122- router_name = "session_control.spa_router" ,
123- function_name = "register_grid_square" ,
124- token = self ._token ,
125- session_id = environment .murfey_session ,
126- gsid = int (gs ),
127- data = {
128- "tag" : dcg_tag ,
129- "x_location" : pos_data [0 ],
130- "y_location" : pos_data [1 ],
131- "x_stage_position" : pos_data [2 ],
132- "y_stage_position" : pos_data [3 ],
133- "width" : pos_data [4 ],
134- "height" : pos_data [5 ],
135- "angle" : pos_data [6 ],
136- },
137- )
112+ for images_disc in list (source .glob ("Images-Disc*" )) or [
113+ source / "Images-Disc1"
114+ ]:
115+ # Do the dcg registration for every Images-Disc with this session file
116+ dcg_tag = ensure_dcg_exists (
117+ collection_type = "spa" ,
118+ metadata_source = images_disc ,
119+ environment = environment ,
120+ token = self ._token ,
121+ )
122+ for gs , pos_data in gs_pix_positions .items ():
123+ if pos_data :
124+ capture_post (
125+ base_url = str (environment .url .geturl ()),
126+ router_name = "session_control.spa_router" ,
127+ function_name = "register_grid_square" ,
128+ token = self ._token ,
129+ session_id = environment .murfey_session ,
130+ gsid = int (gs ),
131+ data = {
132+ "tag" : dcg_tag ,
133+ "x_location" : pos_data [0 ],
134+ "y_location" : pos_data [1 ],
135+ "x_stage_position" : pos_data [2 ],
136+ "y_stage_position" : pos_data [3 ],
137+ "width" : pos_data [4 ],
138+ "height" : pos_data [5 ],
139+ "angle" : pos_data [6 ],
140+ },
141+ )
138142
139143 elif (
140144 transferred_file .suffix == ".dm"
@@ -145,12 +149,15 @@ def post_transfer(
145149 source = _get_source (transferred_file , environment = environment )
146150 if source is None :
147151 return None
148- ensure_dcg_exists (
149- collection_type = "spa" ,
150- metadata_source = source ,
151- environment = environment ,
152- token = self ._token ,
153- )
152+ for images_disc in list (source .glob ("Images-Disc*" )) or [
153+ source / "Images-Disc1"
154+ ]:
155+ ensure_dcg_exists (
156+ collection_type = "spa" ,
157+ metadata_source = images_disc ,
158+ environment = environment ,
159+ token = self ._token ,
160+ )
154161
155162 gs_name = int (transferred_file .stem .split ("_" )[1 ])
156163 logger .info (
@@ -168,7 +175,9 @@ def post_transfer(
168175 logger .warning (
169176 f"Cannot find Images-Disc* in { visitless_source_search_dir } "
170177 )
171- return
178+ visitless_source_images_dirs = [
179+ Path (visitless_source_search_dir ) / "Images-Disc1"
180+ ]
172181 visitless_source = str (visitless_source_images_dirs [- 1 ])
173182
174183 if fh_positions :
0 commit comments