Skip to content

Commit ccbeb90

Browse files
committed
TEST: added new test for the scan_removal_tool. Also added an option for launching the projection viewer where the code does not advance until the window is closed
1 parent afbbea1 commit ccbeb90

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

src/pyxalign/data_structures/projections.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,8 +688,14 @@ def save_projections_object(
688688
h5_obj.close()
689689
print(f"projections saved to {h5_obj.file.filename}{h5_obj.name}")
690690

691-
def launch_viewer(self, options: Optional[ProjectionViewerOptions] = None):
692-
self.gui = launch_projection_viewer(self, options, enable_dropping=True)
691+
def launch_viewer(
692+
self,
693+
options: Optional[ProjectionViewerOptions] = None,
694+
wait_until_closed: Optional[bool] = False,
695+
):
696+
self.gui = launch_projection_viewer(
697+
self, options, enable_dropping=True, wait_until_closed=wait_until_closed
698+
)
693699

694700

695701
class ComplexProjections(Projections):

src/pyxalign/plotting/interactive/launchers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@ def launch_projection_viewer(
2020
projections: "p.Projections",
2121
options: Optional[ProjectionViewerOptions] = None,
2222
enable_dropping: bool = True,
23+
wait_until_closed: bool = False,
2324
) -> ProjectionViewer:
2425
app = QApplication.instance() or QApplication([])
2526
gui = ProjectionViewer(projections, options, enable_dropping=enable_dropping)
2627
gui.show()
28+
if wait_until_closed:
29+
app.exec_()
2730
return gui
2831

2932

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from pyxalign import options as opts
2+
from pyxalign.test_utils_2 import CITestHelper
3+
4+
# Setup the test
5+
# ci_options = opts.CITestOptions(test_data_name="cSAXS_e18044_LamNI_201907")
6+
ci_options = opts.CITestOptions(test_data_name="TP2")
7+
ci_test_helper = CITestHelper(options=ci_options)
8+
# load data with phase unwrapped projections
9+
task = ci_test_helper.load_checkpoint_task(file_name="pre_pma_task.h5")
10+
# launch viewer
11+
task.phase_projections.launch_viewer(wait_until_closed=True)
12+

0 commit comments

Comments
 (0)