Skip to content

Commit

Permalink
Fixed a few issue, and this one. this refs #50
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanBilheux committed May 2, 2023
1 parent 6c22d6f commit 06fbf67
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 33 deletions.
4 changes: 3 additions & 1 deletion src/hyperctui/hyperctui.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from .setup_projections.event_handler import EventHandler as Step2EventHandler
from .pre_processing_monitor.monitor import Monitor as PreProcessingMonitor
from .crop.crop import Crop
from .rotation_center.rotation_center import RotationCenter
from .rotation_center.event_handler import EventHandler as RotationCenterEventHandler
from .autonomous_reconstruction.event_handler import EventHandler as AutonomousReconstructionHandler
from hyperctui.utilities.status_message_config import StatusMessageStatus, show_status_message
Expand Down Expand Up @@ -341,7 +342,8 @@ def crop_roi_manually_moved(self):

# center of rotation
def initialize_center_of_rotation(self):
pass
o_rot = RotationCenter(parent=self)
o_rot.initialize()

def rotation_center_tomopy_clicked(self, button_state):
self.ui.rotation_center_user_defined_radioButton.blockSignals(True)
Expand Down
14 changes: 14 additions & 0 deletions src/hyperctui/pre_processing_monitor/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ def refresh_button_clicked(self):
self.parent.initialize_crop()
self.parent.initialize_center_of_rotation()

# saving the location of the 0 and 180 degrees folders
o_table = TableHandler(table_ui=self.ui.projections_tableWidget)
full_path_image_0_degree = o_table.get_item_str_from_cell(row=0, column=0)
full_path_image_180_degree = o_table.get_item_str_from_cell(row=1, column=0)

self.parent.session_dict[SessionKeys.full_path_to_projections][SessionKeys.image_0_degree] = \
full_path_image_0_degree
self.parent.session_dict[SessionKeys.full_path_to_projections][SessionKeys.image_180_degree] = \
full_path_image_180_degree

else: # all OBs have been created but not been moved to their final location yet

o_event.move_obs_to_final_folder()
Expand All @@ -129,11 +139,15 @@ def refresh_button_clicked(self):
o_table = TableHandler(table_ui=self.ui.projections_tableWidget)
full_path_image_0_degree = o_table.get_item_str_from_cell(row=0, column=0)
full_path_image_180_degree = o_table.get_item_str_from_cell(row=1, column=0)

self.parent.session_dict[SessionKeys.full_path_to_projections][SessionKeys.image_0_degree] = \
full_path_image_0_degree
self.parent.session_dict[SessionKeys.full_path_to_projections][SessionKeys.image_180_degree] = \
full_path_image_180_degree

else:
return

# we moved the files so we can change the status of the move message
self.ui.final_ob_folder_status.setText(DataStatus.done)
self.ui.final_ob_folder_status.setStyleSheet(f"background-color: {ColorDataStatus.ready_button}")
Expand Down
1 change: 1 addition & 0 deletions src/hyperctui/rotation_center/rotation_center.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ def initialize(self):
bottom = self.parent.ui.crop_bottom_spinBox.value()

self.parent.rotation_center_live_image = self.parent.crop_live_image[top: bottom+1, left: right+1].copy()

self.parent.rotation_center_image_view.setImage(np.transpose(self.parent.rotation_center_live_image))
54 changes: 22 additions & 32 deletions src/hyperctui/ui/main_application.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1288,45 +1288,35 @@
</spacer>
</item>
<item>
<widget class="QPushButton" name="start_first_reconstruction_pushButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Start first acquisition / reconstruction</string>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout_18">
<item>
<widget class="QPushButton" name="start_first_reconstruction_pushButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Start first acquisition / reconstruction</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="autonomous_refresh_pushButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Refresh state</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="autonomous_monitor_groupBox">
<property name="title">
<string>Monitor</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_21">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_15">
<item>
<spacer name="horizontalSpacer_14">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="autonomous_refresh_pushButton">
<property name="text">
<string>Refresh table</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTableWidget" name="autonomous_reconstruction_tableWidget">
<property name="alternatingRowColors">
Expand Down

0 comments on commit 06fbf67

Please sign in to comment.