Exemplo n.º 1
0
    def __init__(self, parent=None):
        DataWindow.__init__(self, parent)
        self.plot = pyqtgraph.PlotWidget(self.plotFrame, antialiasing=True)
        self.plot.hideAxis('bottom')
        self.legend = self.plot.addLegend()
        self.legend.hide()
        self._finish_layout()
        self.actionLegend_Box.triggered.connect(self.on_view_legend_box)
        self.actionX_axis.triggered.connect(self.on_view_x_axis)
        self.actionY_axis.triggered.connect(self.on_view_y_axis)
        self.acceptable_data_types = ['scalar', 'vector', 'tuple', 'triple', 'running_hist', 'histogram' , 'normalized_histogram']
        self.exclusive_source = False
        self.line_colors = [(252, 175, 62), (114, 159, 207), (255, 255, 255),
                            (239, 41, 41), (138, 226, 52), (173, 127, 168)]
        self.colorbar = None
        self.colormap = None
        self.current_index = -1
        self.last_vector_y = {}
        self.last_vector_x = None
        self.hline = None
        self.vline = None
        self.hline_color = (0,204,0)
        self.vline_color = (204,0,0)
        self._settings_diag = LinePlotSettings(self)
        self._histograms = {}
        self._normalized_histograms = {}
        self.updateFonts()

        self.plot.scene().sigMouseMoved.connect(self._onMouseMoved)
Exemplo n.º 2
0
    def __init__(self, parent=None):
        DataWindow.__init__(self, parent)
        self.plot = pyqtgraph.PlotWidget(self.plotFrame, antialiasing=True)
        self.plot.hideAxis('bottom')
        self.legend = self.plot.addLegend()
        self.legend.hide()
        self._finish_layout()
        self.actionLegend_Box.triggered.connect(self.on_view_legend_box)
        self.actionX_axis.triggered.connect(self.on_view_x_axis)
        self.actionY_axis.triggered.connect(self.on_view_y_axis)
        self.acceptable_data_types = ['scalar', 'vector', 'tuple', 'triple', 'running_hist', 'histogram' ]
        self.exclusive_source = False
        self.line_colors = [(252, 175, 62), (114, 159, 207), (255, 255, 255),
                            (239, 41, 41), (138, 226, 52), (173, 127, 168)]
        self.colorbar = None
        self.colormap = None
        self.current_index = -1
        self.last_vector_y = {}
        self.last_vector_x = None
        self.hline = None
        self.vline = None
        self.hline_color = (0,204,0)
        self.vline_color = (204,0,0)
        self._settings_diag = LinePlotSettings(self)
        self._histograms = {}        
        self.updateFonts()

        self.plot.scene().sigMouseMoved.connect(self._onMouseMoved)
Exemplo n.º 3
0
    def __init__(self, parent=None):
        DataWindow.__init__(self, parent)
        self.plot = pyqtgraph.PlotWidget(self.plotFrame, antialiasing=True)
        self.plot.hideAxis('bottom')
        self.legend = self.plot.addLegend()
        self.legend.hide()
        self._finish_layout()
        self.actionLegend_Box.triggered.connect(self.on_view_legend_box)
        self.actionX_axis.triggered.connect(self.on_view_x_axis)
        self.actionY_axis.triggered.connect(self.on_view_y_axis)
        self.exclusive_source = False
        self.line_colors = [(252, 175, 62), (114, 159, 207), (255, 255, 255),
                            (239, 41, 41), (138, 226, 52), (173, 127, 168)]
        self.colorbar = None
        self.colormap = None
        self.current_index = -1
        self.last_vector_y = {}
        self.last_vector_x = None
        self.hline = None
        self.vline = None
        self.hline_color = (0, 204, 0)
        self.vline_color = (204, 0, 0)
        self._settings_diag = LinePlotSettings(self)
        self._histograms = {}
        self._normalized_histograms = {}
        self.updateFonts()

        self.plot.scene().sigMouseMoved.connect(self._onMouseMoved)

        # Make sure menubar is attached to the main window
        self.menubar = self.menuBar()
        self.menubar.setNativeMenuBar(False)
        self.time_on_x_axis = False
        self.time_axis = DateAxisItem(orientation='bottom')
Exemplo n.º 4
0
    def __init__(self, parent=None):
        # This also sets up the UI part
        DataWindow.__init__(self, parent)
        # This is imported here to prevent problems with sphinx
        from .image_view import ImageView

        self.plot = ImageView(self, view=pyqtgraph.PlotItem())
        self._finish_layout()
        self.infoLabel.setText("")
        self.acceptable_data_types = ["image", "vector", "triple", "running_hist"]
        self.exclusive_source = True
        self.alert = False
        self.meanmap = None
        self.vline = None
        self.hline = None

        self.settingsWidget.setVisible(self.actionPlotSettings.isChecked())
        self.settingsWidget.ui.colormap_min.editingFinished.connect(self.set_colormap_range)
        self.settingsWidget.ui.colormap_max.editingFinished.connect(self.set_colormap_range)
        self.settingsWidget.ui.colormap_min.setValidator(QtGui.QDoubleValidator())
        self.settingsWidget.ui.colormap_max.setValidator(QtGui.QDoubleValidator())
        self.settingsWidget.ui.colormap_full_range.clicked.connect(self.set_colormap_full_range)

        self.settingsWidget.ui.histogram_show.toggled.connect(self.plot.getHistogramWidget().setVisible)
        self.actionHistogram.triggered.connect(self.plot.getHistogramWidget().setVisible)
        self.actionHistogram.triggered.connect(self.settingsWidget.ui.histogram_show.setChecked)
        self.settingsWidget.ui.histogram_show.toggled.connect(self.actionHistogram.setChecked)

        self.settingsWidget.ui.x_show.toggled.connect(self.toggle_axis)
        self.actionX_axis.triggered.connect(self.toggle_axis)
        self.settingsWidget.ui.y_show.toggled.connect(self.toggle_axis)
        self.actionY_axis.triggered.connect(self.toggle_axis)
        self.settingsWidget.ui.histogram_show.toggled.connect(self.toggle_axis)
        self.actionHistogram.triggered.connect(self.toggle_axis)

        self.set_sounds_and_volume()
        self.actionSound_on_off.triggered.connect(self.toggle_alert)

        self.plot.getHistogramWidget().region.sigRegionChangeFinished.connect(self.set_colormap_range)
        self.actionPlotSettings.triggered.connect(self.toggle_settings)

        # Make sure to disable native menus
        self.plot.getView().setMenuEnabled(False)
        self.plot.getHistogramWidget().vb.setMenuEnabled(False)
        self.x_axis_name = "left"
        self.y_axis_name = "bottom"
        self._set_logscale_lookuptable()

        self.running_hist_initialised = False
Exemplo n.º 5
0
    def __init__(self, parent=None):
        # This also sets up the UI part
        DataWindow.__init__(self, parent)
        # This is imported here to prevent problems with sphinx
        from .image_view import ImageView
        self.plot = ImageView(self, view=pyqtgraph.PlotItem())
        self._finish_layout()
        self.infoLabel.setText('')
        self.acceptable_data_types = ['image', 'vector', 'triple', 'running_hist']
        self.exclusive_source = True
        self.meanmap = None
        self.last_x = None
        self.last_y = None
        self.mm_last = None
        self.vline = None
        self.hline = None

        self.settingsWidget.setVisible(self.actionPlotSettings.isChecked())
        self.settingsWidget.ui.colormap_min.editingFinished.connect(self.set_colormap_range)
        self.settingsWidget.ui.colormap_max.editingFinished.connect(self.set_colormap_range)
        self.settingsWidget.ui.colormap_min.setValidator(QtGui.QDoubleValidator())
        self.settingsWidget.ui.colormap_max.setValidator(QtGui.QDoubleValidator())
        self.settingsWidget.ui.colormap_full_range.clicked.connect(self.set_colormap_full_range)

        self.settingsWidget.ui.histogram_show.toggled.connect(self.plot.getHistogramWidget().setVisible)
        self.actionHistogram.triggered.connect(self.plot.getHistogramWidget().setVisible)
        self.actionHistogram.triggered.connect(self.settingsWidget.ui.histogram_show.setChecked)
        self.settingsWidget.ui.histogram_show.toggled.connect(self.actionHistogram.setChecked)
        
        self.settingsWidget.ui.x_show.toggled.connect(self.toggle_axis)
        self.actionX_axis.triggered.connect(self.toggle_axis)        
        self.settingsWidget.ui.y_show.toggled.connect(self.toggle_axis)
        self.actionY_axis.triggered.connect(self.toggle_axis)        
        self.settingsWidget.ui.histogram_show.toggled.connect(self.toggle_axis)
        self.actionHistogram.triggered.connect(self.toggle_axis)

        self.settingsWidget.ui.modelCenterX.setValidator(QtGui.QDoubleValidator())
        self.settingsWidget.ui.modelCenterY.setValidator(QtGui.QDoubleValidator())
        self.settingsWidget.ui.modelDiameter.setValidator(QtGui.QDoubleValidator())
        self.settingsWidget.ui.photonEnergy.setValidator(QtGui.QDoubleValidator())
        self.settingsWidget.ui.detectorGain.setValidator(QtGui.QDoubleValidator())
        self.settingsWidget.ui.detectorDistance.setValidator(QtGui.QDoubleValidator())        
        self.settingsWidget.ui.detectorPixelSize.setValidator(QtGui.QDoubleValidator())
        self.modelParameters = {}

        success, spimage = utils.io.load_spimage()
        if not success:
            # no spimage available, we need to disable the model settings
            self.settingsWidget.ui.modelTab.setEnabled(False)
        else:
            self.spimage = spimage

        self.settingsWidget.ui.colormap_max.setValidator(QtGui.QDoubleValidator())

                
        self.plot.getHistogramWidget().region.sigRegionChangeFinished.connect(self.set_colormap_range)
        self.actionPlotSettings.triggered.connect(self.toggle_settings)

        # Make sure to disable native menus
        self.plot.getView().setMenuEnabled(False)
        self.plot.getHistogramWidget().vb.setMenuEnabled(False)
        self.x_axis_name = 'left'
        self.y_axis_name = 'bottom'
        self._set_logscale_lookuptable()

        self.running_hist_initialised = False

        self.actionReset_cache.triggered.connect(self.on_reset_cache)

        self.updateFonts()

        # By default do not show x and y axis on images
        self.plot.getView().getAxis('left').setVisible(False)
        self.actionY_axis.setChecked(False)
        self.plot.getView().getAxis('bottom').setVisible(False)
        self.actionX_axis.setChecked(False)

        self.plot.getView().scene().sigMouseMoved.connect(self._onMouseMoved)
        self.plot.getView().scene().sigMouseHover.connect(self._onMouseHover)
Exemplo n.º 6
0
    def __init__(self, parent=None):
        # This also sets up the UI part
        DataWindow.__init__(self, parent)
        # This is imported here to prevent problems with sphinx
        from .image_view import ImageView
        self.plot = ImageView(self, view=pyqtgraph.PlotItem())
        self._finish_layout()
        self.infoLabel.setText('')
        self.acceptable_data_types = [
            'image', 'vector', 'triple', 'running_hist'
        ]
        self.exclusive_source = True
        self.meanmap = None
        self.last_x = None
        self.last_y = None
        self.mm_last = None
        self.vline = None
        self.hline = None

        self.settingsWidget.setVisible(self.actionPlotSettings.isChecked())
        self.settingsWidget.ui.colormap_min.editingFinished.connect(
            self.set_colormap_range)
        self.settingsWidget.ui.colormap_max.editingFinished.connect(
            self.set_colormap_range)
        self.settingsWidget.ui.colormap_min.setValidator(
            QtGui.QDoubleValidator())
        self.settingsWidget.ui.colormap_max.setValidator(
            QtGui.QDoubleValidator())
        self.settingsWidget.ui.colormap_full_range.clicked.connect(
            self.set_colormap_full_range)

        self.settingsWidget.ui.histogram_show.toggled.connect(
            self.plot.getHistogramWidget().setVisible)
        self.actionHistogram.triggered.connect(
            self.plot.getHistogramWidget().setVisible)
        self.actionHistogram.triggered.connect(
            self.settingsWidget.ui.histogram_show.setChecked)
        self.settingsWidget.ui.histogram_show.toggled.connect(
            self.actionHistogram.setChecked)

        self.settingsWidget.ui.x_show.toggled.connect(self.toggle_axis)
        self.actionX_axis.triggered.connect(self.toggle_axis)
        self.settingsWidget.ui.y_show.toggled.connect(self.toggle_axis)
        self.actionY_axis.triggered.connect(self.toggle_axis)
        self.settingsWidget.ui.histogram_show.toggled.connect(self.toggle_axis)
        self.actionHistogram.triggered.connect(self.toggle_axis)

        self.settingsWidget.ui.modelCenterX.setValidator(
            QtGui.QDoubleValidator())
        self.settingsWidget.ui.modelCenterY.setValidator(
            QtGui.QDoubleValidator())
        self.settingsWidget.ui.modelDiameter.setValidator(
            QtGui.QDoubleValidator())
        self.settingsWidget.ui.photonEnergy.setValidator(
            QtGui.QDoubleValidator())
        self.settingsWidget.ui.detectorGain.setValidator(
            QtGui.QDoubleValidator())
        self.settingsWidget.ui.detectorDistance.setValidator(
            QtGui.QDoubleValidator())
        self.settingsWidget.ui.detectorPixelSize.setValidator(
            QtGui.QDoubleValidator())
        self.modelParameters = {}

        success, spimage = utils.io.load_spimage()
        if not success:
            # no spimage available, we need to disable the model settings
            self.settingsWidget.ui.modelTab.setEnabled(False)
        else:
            self.spimage = spimage

        self.settingsWidget.ui.colormap_max.setValidator(
            QtGui.QDoubleValidator())

        self.plot.getHistogramWidget().region.sigRegionChangeFinished.connect(
            self.set_colormap_range)
        self.actionPlotSettings.triggered.connect(self.toggle_settings)

        # Make sure to disable native menus
        self.plot.getView().setMenuEnabled(False)
        self.plot.getHistogramWidget().vb.setMenuEnabled(False)
        self.x_axis_name = 'left'
        self.y_axis_name = 'bottom'
        self._set_logscale_lookuptable()

        self.running_hist_initialised = False

        self.actionReset_cache.triggered.connect(self.on_reset_cache)