@@ -203,17 +203,23 @@ def reconstruction_pipeline(
203203 recon_template = os .path .join (_recon_dir , "recon_OSEM_template.par" )
204204 acf_forwardprojector = os .path .join (_recon_dir , "acf_forwardprojector.par" )
205205
206- reconstruction_pipeline (
207- output_dir = output_dir ,
208- ct_path = args .ct ,
209- ct_face_and_bed_path = ct_face_and_bed_path ,
210- face_and_bed_mask_path = face_and_bed_mask_path ,
211- add_sino_path = add_sino_path ,
212- mult_sino_path = mult_sino_path ,
213- prompts_sino_path = prompts_sino_path ,
214- offset_json_path = offset_json_path ,
215- recon_template = recon_template ,
216- acf_forwardprojector = acf_forwardprojector ,
217- overwrite = args .overwrite ,
218- verbose = args .verbose ,
219- )
206+ log_path = os .path .join (output_dir , "intermediates" , "recon.log" )
207+ try :
208+ reconstruction_pipeline (
209+ output_dir = output_dir ,
210+ ct_path = args .ct ,
211+ ct_face_and_bed_path = ct_face_and_bed_path ,
212+ face_and_bed_mask_path = face_and_bed_mask_path ,
213+ add_sino_path = add_sino_path ,
214+ mult_sino_path = mult_sino_path ,
215+ prompts_sino_path = prompts_sino_path ,
216+ offset_json_path = offset_json_path ,
217+ recon_template = recon_template ,
218+ acf_forwardprojector = acf_forwardprojector ,
219+ overwrite = args .overwrite ,
220+ verbose = args .verbose ,
221+ )
222+ except Exception :
223+ if not args .verbose :
224+ print (f"\n Reconstruction failed. Check { log_path } for details, or rerun with -v/--verbose for more output." , flush = True )
225+ raise
0 commit comments