@@ -231,7 +231,6 @@ def batch_mode_execute(
231231 input_path : Path ,
232232 output_path : Path ,
233233 * ,
234- product_file_type : str = 'NPZ' ,
235234 fluorescence_input_file_path : Path | None = None ,
236235 fluorescence_output_file_path : Path | None = None ,
237236 ) -> int :
@@ -241,39 +240,20 @@ def batch_mode_execute(
241240 self .reconstructor .reconstructor_api .save_model (output_path )
242241 return output .result
243242
244- input_product_index = self .product .product_api .open_product (
245- input_path , file_type = product_file_type
246- )
247-
248- if input_product_index < 0 :
249- logger .error (f'Failed to open product "{ input_path } "!' )
250- return - 1
251-
252243 if action .lower () == 'reconstruct' :
253- logger .info ('Reconstructing...' )
254- output_product_index = self .reconstructor .reconstructor_api .reconstruct (
255- input_product_index
256- )
257- self .reconstructor .reconstructor_api .process_results (block = True )
258- logger .info ('Reconstruction complete.' )
259-
260- self .product .product_api .save_product (
261- output_product_index , output_path , file_type = product_file_type
262- )
244+ input_product_api = self .workflow .workflow_api .open_product (input_path )
245+ output_product_api = input_product_api .reconstruct_local (block = True )
246+ output_product_api .save_product (output_path )
263247
264248 if (
265249 fluorescence_input_file_path is not None
266250 and fluorescence_output_file_path is not None
267251 ):
268252 self .fluorescence_core .enhance_fluorescence (
269- output_product_index ,
253+ output_product_api . get_product_index () ,
270254 fluorescence_input_file_path ,
271255 fluorescence_output_file_path ,
272256 )
273- elif action .lower () == 'prepare_training_data' :
274- self .reconstructor .reconstructor_api .export_training_data (
275- output_path , input_product_index
276- )
277257 else :
278258 logger .error (f'Unknown batch mode action "{ action } "!' )
279259 return - 1
0 commit comments