selection¶
Window to pick selection type/color, load/export ROIs and clear ROIS
-
class
pdsspect.selection.
SelectionController
(image_set, view)[source]¶ Bases:
object
Controller for
Selection
Parameters: - image_set (
PDSSpectImageSet
) – pdsspect model - view (
Selection
) – View to control
-
image_set
¶ PDSSpectImageSet
– pdsspect model
-
add_ROI
(coordinates, color, image_set=None)[source]¶ Add ROI with the given coordinates and color
Parameters: - coordinates (
numpy.ndarray
ortuple
) –Either a
(m x 2)
array or a tuple of two arraysIf an array, the first column are the x coordinates and the second are the y coordinates. If a tuple of arrays, the first array are x coordinates and the second are the corresponding y coordinates.
- color (
str
) – The name a color incolors
- coordinates (
-
change_alpha
(new_alpha)[source]¶ Change the alpha value to a new alpha value
Parameters: new_alpha ( float
) – Value between 0 and 100
-
change_current_color_index
(index)[source]¶ Change the current color index to a new index
Parameters: index ( int
) – The new color index
- image_set (
-
class
pdsspect.selection.
Selection
(image_set, parent=None)[source]¶ Bases:
PyQt5.QtWidgets.QWidget
,pdsspect.pdsspect_image_set.PDSSpectImageSetViewBase
Window to make/clear/load/export ROIs and choose selection mode/color
Parameters: - image_set (
PDSSpectImageSet
) – pdsspect model - parent (None) – Parent of the view
-
image_set
¶ PDSSpectImageSet
– pdsspect model
-
parent
¶ None – Parent of the view
-
controller
¶ SelectionController
– View controller
-
type_label
¶ QtWidgets.QLabel
– Label for the selection menu
QtWidgets.QComboBox
– Drop down menu of selection types
-
type_layout
¶ QtWidgets.QHBoxLayout
– Horizontal box layout for selection
-
color_label
¶ QtWidgets.QLabel
– Label for thecolor_menu
QtWidgets.QComboBox
– Drop down menu for color selection
-
color_layout
¶ QtWidgets.QHBoxLayout
– Horizontal box layout for color selection
-
opacity_label
¶ QtWidgets.QLabel
– Label for theopacity_slider
-
opacity_slider
¶ QtWidgets.QSlider
– Slider to determine opacity for ROIs
-
opacity_layout
¶ QtWidgets.QHBoxLayout
– Horizontal box layout for opacity slider
-
clear_current_color_btn
¶ QtWidgets.QPushButton
– Button to clear all ROIs will the current color
-
clear_all_btn
¶ QtWidgets.QPushButton
– Button to clear all ROIs
-
export_btn
¶ QtWidgets.QPushButton
– Export ROIs to.npz
file
-
load_btn
¶ QtWidgets.QPushButton
– Load ROIs from.npz
file
-
simultaneous_roi_box
¶ QtWidgets.QPushButton
– When checked, new ROIs appear in every window
-
main_layout
¶ QtWidgets.QVBoxLayout
– Vertical Box layout for main layout
-
change_alpha
(new_alpha)[source]¶ Change alpha value when
opacity_slider
value changes
-
change_color
(index)[source]¶ Change the color when color selected in
color_menu
-
change_selection_type
(index)[source]¶ Change selection type when selected in
selection_menu
-
export
(save_file)[source]¶ Export ROIS to the given filename
Parameters: save_file ( str
) – File with.npz
extension to save ROIs
- image_set (