MCPcopy Create free account
hub / github.com/NSLS2/PyXRF / __init__

Method __init__

pyxrf/gui_module/dlg_load_mask.py:55–164  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

53 """
54
55 def __init__(self):
56 super().__init__()
57
58 self._validation_enabled = False
59
60 self.resize(500, 300)
61 self.setWindowTitle("Load Mask or Select ROI")
62
63 # Initialize variables used with ROI selection group
64 self._n_rows = 0
65 self._n_columns = 0
66 self._roi_active = False
67 self._row_start = -1
68 self._column_start = -1
69 self._row_end = -1
70 self._column_end = -1
71 # ... with Mask group
72 self._mask_active = False
73 self._mask_file_path = ""
74 self._default_directory = ""
75
76 # Fields for entering spatial ROI coordinates
77 self.validator_rows = QIntValidator()
78 self.validator_rows.setBottom(1)
79 self.validator_cols = QIntValidator()
80 self.validator_cols.setBottom(1)
81
82 self.le_roi_start_row = LineEditExtended()
83 self.le_roi_start_row.setValidator(self.validator_rows)
84 self.le_roi_start_row.editingFinished.connect(self.le_roi_start_row_editing_finished)
85 self.le_roi_start_row.textChanged.connect(self.le_roi_start_row_text_changed)
86 self.le_roi_start_col = LineEditExtended()
87 self.le_roi_start_col.setValidator(self.validator_cols)
88 self.le_roi_start_col.editingFinished.connect(self.le_roi_start_col_editing_finished)
89 self.le_roi_start_col.textChanged.connect(self.le_roi_start_col_text_changed)
90 self.le_roi_end_row = LineEditExtended()
91 self.le_roi_end_row.setValidator(self.validator_rows)
92 self.le_roi_end_row.editingFinished.connect(self.le_roi_end_row_editing_finished)
93 self.le_roi_end_row.textChanged.connect(self.le_roi_end_row_text_changed)
94 self.le_roi_end_col = LineEditExtended()
95 self.le_roi_end_col.setValidator(self.validator_cols)
96 self.le_roi_end_col.editingFinished.connect(self.le_roi_end_col_editing_finished)
97 self.le_roi_end_col.textChanged.connect(self.le_roi_end_col_text_changed)
98 self._text_map_size_base = " * Map size: "
99 self.label_map_size = QLabel(self._text_map_size_base + "not set")
100
101 # Group box for spatial ROI selection
102 self.gb_roi = QGroupBox("Select ROI (in pixels)")
103 set_tooltip(
104 self.gb_roi,
105 "Select rectangular <b>spatial ROI</b>. If <b>mask</b> is "
106 "loaded, then ROI is applied to the masked data.",
107 )
108 self.gb_roi.setCheckable(True)
109 self.gb_roi.toggled.connect(self.gb_roi_toggled)
110 self.gb_roi.setChecked(self._roi_active)
111 vbox = QVBoxLayout()
112 grid = QGridLayout()

Callers

nothing calls this directly

Calls 4

_validate_all_widgetsMethod · 0.95
LineEditExtendedClass · 0.85
set_tooltipFunction · 0.85
LineEditReadOnlyClass · 0.85

Tested by

no test coverage detected