From 6f6e5f1e2acf685dddc5df9a2807aa8fc701e59c Mon Sep 17 00:00:00 2001 From: j35 Date: Wed, 16 Feb 2022 11:08:14 -0500 Subject: [PATCH] changed default json location --- src/pyMBIR_UI/recon_HFIR_script_batch.py | 11 ++++++++--- src/pyMBIR_UI/reconstruction_launcher.py | 8 +++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/pyMBIR_UI/recon_HFIR_script_batch.py b/src/pyMBIR_UI/recon_HFIR_script_batch.py index fe08f29..6b0b992 100644 --- a/src/pyMBIR_UI/recon_HFIR_script_batch.py +++ b/src/pyMBIR_UI/recon_HFIR_script_batch.py @@ -23,6 +23,8 @@ import os import json +STOP_FILE_NAME = "OVER.txt" + def main(): @@ -147,12 +149,15 @@ def main(): print('Starting MBIR..') rec_mbir = np.float32(MBIR(proj_data, count_data, proj_params, miscalib, vol_params, rec_params)) - import pyqtgraph as pg - pg.image(rec_mbir); - pg.QtGui.QApplication.exec_() + #import pyqtgraph as pg + #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) + # when done write stop file in batch mode + #if input_dict["running_mode"] == "batch": + if __name__ == "__main__": main() diff --git a/src/pyMBIR_UI/reconstruction_launcher.py b/src/pyMBIR_UI/reconstruction_launcher.py index fd138e3..29c7967 100644 --- a/src/pyMBIR_UI/reconstruction_launcher.py +++ b/src/pyMBIR_UI/reconstruction_launcher.py @@ -166,7 +166,9 @@ def run(self): self.dictionary_of_arguments = dictionary_of_arguments logging.info(f"-> Saving config file to be called from command line script") - with open("/home/j35/config_to_test_batch_mode.json", 'w') as json_file: + home_folder = os.path.abspath("~/") + 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) current_location = os.path.abspath(os.path.dirname(__file__)) @@ -175,8 +177,8 @@ def run(self): proc = subprocess.Popen(['python', script_exe, '--input_json', - "/home/j35/config_to_test_batch_mode.json", - ], + json_file_name, +], shell=False) self.batch_process_id = proc