Skip to content

Commit

Permalink
working on populating the table before segmentation. this refs #49
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanBilheux committed May 22, 2023
1 parent 3dbfc2a commit 6bd69eb
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/hyperctui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
16 changes: 15 additions & 1 deletion src/hyperctui/autonomous_reconstruction/event_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions src/hyperctui/hyperctui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 8 additions & 3 deletions src/hyperctui/initialization/gui_initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down

0 comments on commit 6bd69eb

Please sign in to comment.