Skip to content

Commit

Permalink
Manual recon log button goes to input directory (if it exists) by def…
Browse files Browse the repository at this point in the history
…ault
  • Loading branch information
James Brown committed Jun 10, 2015
1 parent 3a8676a commit 38942de
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions harp.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ def __init__(self, app):
self.ui.setupUi(self)
self.app = app


# Store app-specific data such as last directory browsed
self.app_data = AppData()
self.opttab_populate_patterns()
Expand All @@ -103,6 +102,7 @@ def __init__(self, app):
self.current_row = 0
# Set to "" or NA so that HARP can record in the log and GUI there is no data for these parameters. Will be
# updated later if parameters are identified.
self.input_folder = None
self.scan_folder = "NA"
self.recon_log_path = "NA"
self.f_size_out_gb = ""
Expand Down Expand Up @@ -660,16 +660,18 @@ def get_recon_man(self):
:func:`autofill.get_pixel()`,
"""
# Get the information from the dialog box
file_dialog = QtGui.QFileDialog(self)
file = file_dialog.getOpenFileName()
if self.input_folder:
recon_log_path = QtGui.QFileDialog.getOpenFileName(self, 'Select recon log', self.input_folder)
else:
recon_log_path = QtGui.QFileDialog.getOpenFileName(self, 'Select recon log')

# If a file was chosen get pixel size and update paramaters
if file:
if recon_log_path:
try:
# Set the text on the recon file box on the GUI
self.ui.lineEditCTRecon.setText(file)
self.ui.lineEditCTRecon.setText(recon_log_path)
# Check it is an actual path (prob not required)
self.recon_log_path = os.path.abspath(str(file))
self.recon_log_path = os.path.abspath(str(recon_log_path))
# Open the log file as read only
recon_log_file = open(self.recon_log_path, 'r')
# Get pixel size from log file
Expand Down

0 comments on commit 38942de

Please sign in to comment.