Skip to content

Commit

Permalink
fix a few bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
j35 committed Feb 16, 2022
1 parent c768326 commit 99a2191
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 30 deletions.
3 changes: 0 additions & 3 deletions src/pyMBIR_UI/algorithm_dictionary_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,6 @@ def build_dictionary(self, session_dict=None, config_file_name=None):
n_vox_x = session_dict['advanced settings']['n_vox_x, n_vox_y']['n_vox_x_to_use']
n_vox_y = session_dict['advanced settings']['n_vox_x, n_vox_y']['n_vox_y_to_use']

print("in build dictionary")
print(f"session_dict['advanced settings']['n_vox_z']: {session_dict['advanced settings']['n_vox_z']}")

n_vox_z = session_dict['advanced settings']['n_vox_z']['n_vox_z_to_use']
arguments['n_vox_x'] = n_vox_x
arguments['n_vox_y'] = n_vox_y
Expand Down
File renamed without changes.
34 changes: 16 additions & 18 deletions src/pyMBIR_UI/recon_HFIR_script_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@
# -----------------------------------------------------------------------

import argparse
import numpy as np
import time
from tomopy import remove_stripe_fw
try:
from dxchange.writer import write_tiff_stack
from pyMBIR.reconEngine import analytic, MBIR
from pyMBIR.utils import apply_proj_tilt
from readNeutronData import *
from src.pyMBIR_UI.readNeutronData import *
import dxchange
except ModuleNotFoundError:
pass
Expand All @@ -36,22 +34,22 @@ def main():
with open(args.input_json, "r") as read_file:
input_dict = json.load(read_file)

# for testing only
import glob
list_files = glob.glob("/Volumes/G-DRIVE/IPTS/IPTS-25967-pymbir/output_folder/real_output_folder/*.tiff")

import time
import shutil
for _file in list_files:
time.sleep(.5)
shutil.copy(_file, input_dict['temp_op_dir'])

for _file in list_files:
shutil.copy(_file, input_dict['op_path'])
import pprint
pprint.pprint(input_dict)

return # just for testing
# for testing only
#import glob
# list_files = glob.glob("/Volumes/G-DRIVE/IPTS/IPTS-25967-pymbir/output_folder/real_output_folder/*.tiff")

# #import time
# import shutil
# for _file in list_files:
# time.sleep(.5)
# shutil.copy(_file, input_dict['temp_op_dir'])
#
# for _file in list_files:
# shutil.copy(_file, input_dict['op_path'])

pprint.pprint(input_dict)
max_core = input_dict['max_core']
num_wav_level = input_dict['wav_level']
tot_col = input_dict['tot_col']
Expand Down Expand Up @@ -152,7 +150,7 @@ def main():
import pyqtgraph as pg
pg.image(rec_mbir);
pg.QtGui.QApplication.exec_()
if input_dict.write_op == True:
if input_dict["write_op"] == True:
dxchange.write_tiff_stack(rec_mbir, fname=input_dict["op_path"], start=z_start, overwrite=True)


Expand Down
6 changes: 3 additions & 3 deletions src/pyMBIR_UI/reconstruction_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def run(self):
dictionary_of_arguments['running_mode'] = 'batch'

# for debugging only !!! remove me
dictionary_of_arguments['n_vox_z'] = 6
#dictionary_of_arguments['n_vox_z'] = 6



Expand All @@ -166,7 +166,7 @@ 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("/Users/j35/Desktop/config_to_test_batch_mode.json", 'w') as json_file:
with open("/home/j35/config_to_test_batch_mode.json", 'w') as json_file:
json.dump(dictionary_of_arguments, json_file)

current_location = os.path.abspath(os.path.dirname(__file__))
Expand All @@ -175,7 +175,7 @@ def run(self):
proc = subprocess.Popen(['python',
script_exe,
'--input_json',
"/Users/j35/Desktop/config_to_test_batch_mode.json",
"/home/j35/config_to_test_batch_mode.json",
],
shell=False)
self.batch_process_id = proc
Expand Down
8 changes: 2 additions & 6 deletions src/pyMBIR_UI/venkat_function.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
import numpy as np
import logging
import json
from qtpy.QtCore import QObject, QThread, Signal
from qtpy.QtCore import QObject, Signal
from tomopy import remove_stripe_fw
try:
from pyMBIR.reconEngine import analytic, MBIR
from pyMBIR.utils import apply_proj_tilt
except ModuleNotFoundError:
pass
from readNeutronData import *
from pyMBIR_UI.readNeutronData import *
from tomopy.misc.corr import median_filter
import os
import dxchange
import time

from .algorithm_dictionary_creator import AlgorithmDictionaryCreator


class TestWorker(QObject):
finished = Signal()
Expand Down

0 comments on commit 99a2191

Please sign in to comment.