diff --git a/src/hyperctui/__init__.py b/src/hyperctui/__init__.py index a273258..8cd0f97 100644 --- a/src/hyperctui/__init__.py +++ b/src/hyperctui/__init__.py @@ -8,6 +8,9 @@ __all__ = ['load_ui'] root = os.path.dirname(os.path.realpath(__file__)) + +golden_ratio_file = os.path.join(os.path.dirname(__file__), os.path.join('static', 'golden_angle.csv')) + refresh_image = os.path.join(root, "static/refresh.png") refresh_large_image = os.path.join(root, "static/refresh_large.png") more_infos = os.path.join(root, "static/more_infos.png") diff --git a/src/hyperctui/autonomous_reconstruction/event_handler.py b/src/hyperctui/autonomous_reconstruction/event_handler.py index 9d96fcd..9a2b7f5 100644 --- a/src/hyperctui/autonomous_reconstruction/event_handler.py +++ b/src/hyperctui/autonomous_reconstruction/event_handler.py @@ -124,7 +124,21 @@ def start_acquisition(self): def init_autonomous_table(self): # output_table = - pass + nbr_angles = self.parent.ui.evaluation_frequency_spinBox.value() + list_golden_ratio_angles_collected = self.parent.golden_ratio_angles[0:nbr_angles] + + tof_regions = self.parent.tof_regions + list_tof_region_collected = [] + for _index in tof_regions.keys(): + if tof_regions[_index][EvaluationRegionKeys.state]: + _from = str(tof_regions[_index][EvaluationRegionKeys.from_value]).replace(".", "_") + _to = str(tof_regions[_index][EvaluationRegionKeys.to_value]).replace(".", "_") + list_tof_region_collected.append(f"from_{_from}Ang_to_{_to}Ang") + + + + + def refresh_table_clicked(self): pass \ No newline at end of file diff --git a/src/hyperctui/hyperctui.py b/src/hyperctui/hyperctui.py index 9ee7638..3ae2409 100644 --- a/src/hyperctui/hyperctui.py +++ b/src/hyperctui/hyperctui.py @@ -98,6 +98,9 @@ class HyperCTui(QMainWindow): # autonomous reconstruction + # angles + golden_ratio_angles = None + # evaluation regions evaluation_regions = OrderedDict() evaluation_regions[0] = {EvaluationRegionKeys.state: True, diff --git a/src/hyperctui/initialization/gui_initialization.py b/src/hyperctui/initialization/gui_initialization.py index 479a4db..b27d13a 100644 --- a/src/hyperctui/initialization/gui_initialization.py +++ b/src/hyperctui/initialization/gui_initialization.py @@ -5,9 +5,9 @@ import numpy as np import os -from ..utilities.config_handler import ConfigHandler -from ..utilities.table import TableHandler -from .. import more_infos, TabNames, tab0_icon, tab1_icon +from hyperctui.utilities.config_handler import ConfigHandler +from hyperctui.utilities.table import TableHandler +from hyperctui import more_infos, TabNames, tab0_icon, tab1_icon, golden_ratio_file class GuiInitialization: @@ -25,6 +25,11 @@ def all(self): self.tables() self.tabs() self.pyqtgraph() + self.autonomous_reconstruction_data() + + def autonomous_reconstruction_data(self): + table = pd.read_csv(golden_angle_file) + self.parent.golden_ratio_angles = list(table['angles']) def tabs(self): self.parent.ui.tabWidget.setTabText(0, TabNames.tab0)