diff --git a/src/pyMBIR_UI/recon_HFIR_script_batch.py b/src/pyMBIR_UI/recon_HFIR_script_batch.py old mode 100644 new mode 100755 index f4644c7..032fbea --- a/src/pyMBIR_UI/recon_HFIR_script_batch.py +++ b/src/pyMBIR_UI/recon_HFIR_script_batch.py @@ -153,11 +153,15 @@ def main(): #pg.image(rec_mbir); #pg.QtGui.QApplication.exec_() if input_dict["write_op"] == True: - dxchange.write_tiff_stack(rec_mbir, fname=input_dict["op_path"], start=z_start, overwrite=True) + print(f"input_dict['op_path']: {input_dict['op_path']}") + temp_path = os.path.join(input_dict['op_path'], "mbir") + dxchange.write_tiff_stack(rec_mbir, fname=temp_path, start=z_start, overwrite=True) # when done write stop file in batch mode - #if input_dict["running_mode"] == "batch": - # with open(STOP_FILE_NAME + if input_dict["running_mode"] == "batch": + with open(STOP_FILE_NAME, 'w') as json_file: + json.dump({"stop": True}, json_file) + if __name__ == "__main__": main() diff --git a/src/pyMBIR_UI/reconstruction_launcher.py b/src/pyMBIR_UI/reconstruction_launcher.py index 8fb5403..1c8eb19 100644 --- a/src/pyMBIR_UI/reconstruction_launcher.py +++ b/src/pyMBIR_UI/reconstruction_launcher.py @@ -141,18 +141,19 @@ def run(self): # for debugging only !!! remove me #dictionary_of_arguments['n_vox_z'] = 6 - - - - base_output_folder = os.path.basename(dictionary_of_arguments['data_path']) - full_output_folder = os.path.join(dictionary_of_arguments['op_path'], base_output_folder + - "_pymbir_reconstructed") - dictionary_of_arguments['op_path'] = full_output_folder + full_output_folder = os.path.join(dictionary_of_arguments['op_path']) + + # full_output_folder = os.path.join(dictionary_of_arguments['op_path'], base_output_folder + + # "_pymbir_reconstructed") +# dictionary_of_arguments['op_path'] = full_output_folder logging.info(f"Final image will be output in {full_output_folder}") make_or_reset_folder(dictionary_of_arguments['op_path']) logging.info(f"Reset output folder: {full_output_folder}") + dictionary_of_arguments['temp_op_dir'] = os.path.join(dictionary_of_arguments['op_path'], "temporary_pymbir_reconstructed") + make_or_reset_folder(dictionary_of_arguments['temp_op_dir']) + logging.info(f"-> Dictionary of arguments: {dictionary_of_arguments}") logging.info(f"-> reset temporary folder: {dictionary_of_arguments['temp_op_dir']}") @@ -167,7 +168,7 @@ def run(self): logging.info(f"-> Saving config file to be called from command line script") home_folder = os.path.expanduser("~") - json_file_name = os.path.join(home_folder, "config_batch_mode.json" ) + json_file_name = os.path.join(home_folder, "config_batch_mode.json") with open(json_file_name, 'w') as json_file: json.dump(dictionary_of_arguments, json_file) @@ -296,9 +297,14 @@ def check_output_file(self): o_event.update_output_plot() def check_output_3d_volume(self): - output_folder = self.dictionary_of_arguments["op_path"] + print("in check 3D") + base_output_folder = os.path.basename(self.dictionary_of_arguments['data_path']) + output_folder = self.dictionary_of_arguments['op_path'] + print(f"output_folder: {output_folder}") list_tiff_files_in_output_folder = glob.glob(os.path.join(output_folder, "*.tif?")) + print(f"list tiff:{list_tiff_files_in_output_folder}") number_of_files_in_output_folder = len(list_tiff_files_in_output_folder) + print(f"number of files: {number_of_files_in_output_folder}") if number_of_files_in_output_folder == 0: self.parent.ui.tabWidget_3.setTabEnabled(1, False) return