Commit 4d846e2a authored by Luke Campagnola's avatar Luke Campagnola
Browse files

Updates merged from acq4:

 - disabled opengl (performance issues in Qt 4.7)
 - numerous caching changes (disabled deviceCoordinateCache due to performance issues)
 - speed up loading large images in ImageView
 - bugfixes from Ingo Breßler
 - Transform rotation bugfix
 - Added debug module
 - Major performance enhancements for scatterplot, fixed point clicking issues
     ** API change for scatterplot click signals
 - Drawing on ImageItem is working well now
 - PlotItem downsampling no longer uses scipy.signal.resample (this was creating artifacts)
 - Fixed ViewBox behavior when aspect-locked
parent 6783f4fa
......@@ -10,8 +10,8 @@ from PyQt4 import QtCore, QtGui, QtOpenGL, QtSvg
#import time
from Point import *
#from vector import *
import sys
#import debug
import sys, os
import debug
class GraphicsView(QtGui.QGraphicsView):
......@@ -19,8 +19,9 @@ class GraphicsView(QtGui.QGraphicsView):
sigMouseReleased = QtCore.Signal(object)
sigSceneMouseMoved = QtCore.Signal(object)
#sigRegionChanged = QtCore.Signal(object)
lastFileDir = None
def __init__(self, parent=None, useOpenGL=True):
def __init__(self, parent=None, useOpenGL=False):
"""Re-implementation of QGraphicsView that removes scrollbars and allows unambiguous control of the
viewed coordinate range. Also automatically creates a QGraphicsScene and a central QGraphicsWidget
that is automatically scaled to the full view geometry.
......@@ -38,34 +39,27 @@ class GraphicsView(QtGui.QGraphicsView):
useOpenGL = False
self.useOpenGL(useOpenGL)
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0,0,0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Active,QtGui.QPalette.Base,brush)
self.setCacheMode(self.CacheBackground)
brush = QtGui.QBrush(QtGui.QColor(0,0,0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Inactive,QtGui.QPalette.Base,brush)
brush = QtGui.QBrush(QtGui.QColor(244,244,244))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Disabled,QtGui.QPalette.Base,brush)
self.setPalette(palette)
#self.setProperty("cursor",QtCore.QVariant(QtCore.Qt.ArrowCursor))
self.setBackgroundBrush(brush)
self.setFocusPolicy(QtCore.Qt.StrongFocus)
self.setFrameShape(QtGui.QFrame.NoFrame)
self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.setTransformationAnchor(QtGui.QGraphicsView.NoAnchor)
self.setResizeAnchor(QtGui.QGraphicsView.AnchorViewCenter)
#self.setResizeAnchor(QtGui.QGraphicsView.NoAnchor)
self.setViewportUpdateMode(QtGui.QGraphicsView.SmartViewportUpdate)
self.setSceneRect(QtCore.QRectF(-1e10, -1e10, 2e10, 2e10))
#self.setSceneRect(1, 1, 0, 0) ## Set an empty (but non-zero) scene rect so that the view doesn't try to automatically update for us.
#self.setInteractive(False)
self.setViewportUpdateMode(QtGui.QGraphicsView.MinimalViewportUpdate)
#self.setSceneRect(QtCore.QRectF(-1e10, -1e10, 2e10, 2e10))
self.lockedViewports = []
self.lastMousePos = None
#self.setMouseTracking(False)
self.aspectLocked = False
self.yInverted = True
#self.yInverted = True
self.range = QtCore.QRectF(0, 0, 1, 1)
self.autoPixelRange = True
self.currentItem = None
......@@ -86,7 +80,7 @@ class GraphicsView(QtGui.QGraphicsView):
self.clickAccepted = False
#def paintEvent(self, *args):
#prof = debug.Profiler('GraphicsView.paintEvent '+str(id(self)), disabled=True)
#prof = debug.Profiler('GraphicsView.paintEvent '+str(id(self)), disabled=False)
#QtGui.QGraphicsView.paintEvent(self, *args)
#prof.finish()
......@@ -97,6 +91,7 @@ class GraphicsView(QtGui.QGraphicsView):
self.currentItem = None
self.sceneObj = None
self.closed = True
self.setViewport(None)
def useOpenGL(self, b=True):
if b:
......@@ -116,6 +111,7 @@ class GraphicsView(QtGui.QGraphicsView):
self.scene().removeItem(self.centralWidget)
self.centralWidget = item
self.sceneObj.addItem(item)
self.resizeEvent(None)
def addItem(self, *args):
return self.scene().addItem(*args)
......@@ -140,37 +136,43 @@ class GraphicsView(QtGui.QGraphicsView):
self.updateMatrix()
def updateMatrix(self, propagate=True):
#print "udpateMatrix:"
translate = Point(self.range.center())
if self.range.width() == 0 or self.range.height() == 0:
return
scale = Point(self.size().width()/self.range.width(), self.size().height()/self.range.height())
m = QtGui.QTransform()
## First center the viewport at 0
self.resetMatrix()
center = self.viewportTransform().inverted()[0].map(Point(self.width()/2., self.height()/2.))
if self.yInverted:
m.translate(center.x(), center.y())
#print " inverted; translate", center.x(), center.y()
self.setSceneRect(self.range)
if self.aspectLocked:
self.fitInView(self.range, QtCore.Qt.KeepAspectRatio)
else:
m.translate(center.x(), -center.y())
#print " not inverted; translate", center.x(), -center.y()
self.fitInView(self.range, QtCore.Qt.IgnoreAspectRatio)
## Now scale and translate properly
if self.aspectLocked:
scale = Point(scale.min())
if not self.yInverted:
scale = scale * Point(1, -1)
m.scale(scale[0], scale[1])
#print " scale:", scale
st = translate
m.translate(-st[0], -st[1])
#print " translate:", st
self.setTransform(m)
self.currentScale = scale
#self.emit(QtCore.SIGNAL('viewChanged'), self.range)
##print "udpateMatrix:"
#translate = Point(self.range.center())
#if self.range.width() == 0 or self.range.height() == 0:
#return
#scale = Point(self.size().width()/self.range.width(), self.size().height()/self.range.height())
#m = QtGui.QTransform()
### First center the viewport at 0
#self.resetMatrix()
#center = self.viewportTransform().inverted()[0].map(Point(self.width()/2., self.height()/2.))
#if self.yInverted:
#m.translate(center.x(), center.y())
##print " inverted; translate", center.x(), center.y()
#else:
#m.translate(center.x(), -center.y())
##print " not inverted; translate", center.x(), -center.y()
### Now scale and translate properly
#if self.aspectLocked:
#scale = Point(scale.min())
#if not self.yInverted:
#scale = scale * Point(1, -1)
#m.scale(scale[0], scale[1])
##print " scale:", scale
#st = translate
#m.translate(-st[0], -st[1])
##print " translate:", st
#self.setTransform(m)
#self.currentScale = scale
##self.emit(QtCore.SIGNAL('viewChanged'), self.range)
self.sigRangeChanged.emit(self, self.range)
if propagate:
......@@ -251,11 +253,11 @@ class GraphicsView(QtGui.QGraphicsView):
r1.setBottom(r.bottom())
self.setRange(r1, padding=[0, padding], propagate=False)
def invertY(self, invert=True):
#if self.yInverted != invert:
#self.scale[1] *= -1.
self.yInverted = invert
self.updateMatrix()
#def invertY(self, invert=True):
##if self.yInverted != invert:
##self.scale[1] *= -1.
#self.yInverted = invert
#self.updateMatrix()
def wheelEvent(self, ev):
......@@ -347,7 +349,7 @@ class GraphicsView(QtGui.QGraphicsView):
def mouseMoveEvent(self, ev):
if self.lastMousePos is None:
self.lastMousePos = Point(ev.pos())
delta = Point(ev.pos()) - self.lastMousePos
delta = Point(ev.pos() - self.lastMousePos)
self.lastMousePos = Point(ev.pos())
QtGui.QGraphicsView.mouseMoveEvent(self, ev)
......@@ -371,7 +373,8 @@ class GraphicsView(QtGui.QGraphicsView):
self.sigRangeChanged.emit(self, self.range)
elif ev.buttons() in [QtCore.Qt.MidButton, QtCore.Qt.LeftButton]: ## Allow panning by left or mid button.
tr = -delta / self.currentScale
px = self.pixelSize()
tr = -delta * px
self.translate(tr[0], tr[1])
#self.emit(QtCore.SIGNAL('regionChanged(QRectF)'), self.range)
......@@ -386,11 +389,28 @@ class GraphicsView(QtGui.QGraphicsView):
#self.currentItem.mouseMoveEvent(pev)
def pixelSize(self):
"""Return vector with the length and width of one view pixel in scene coordinates"""
p0 = Point(0,0)
p1 = Point(1,1)
tr = self.transform().inverted()[0]
p01 = tr.map(p0)
p11 = tr.map(p1)
return Point(p11 - p01)
def writeSvg(self, fileName=None):
if fileName is None:
fileName = str(QtGui.QFileDialog.getSaveFileName())
self.fileDialog = QtGui.QFileDialog()
self.fileDialog.setFileMode(QtGui.QFileDialog.AnyFile)
self.fileDialog.setAcceptMode(QtGui.QFileDialog.AcceptSave)
if GraphicsView.lastFileDir is not None:
self.fileDialog.setDirectory(GraphicsView.lastFileDir)
self.fileDialog.show()
self.fileDialog.fileSelected.connect(self.writeSvg)
return
fileName = str(fileName)
GraphicsView.lastFileDir = os.path.split(fileName)[0]
self.svg = QtSvg.QSvgGenerator()
self.svg.setFileName(fileName)
self.svg.setSize(self.size())
......@@ -400,7 +420,16 @@ class GraphicsView(QtGui.QGraphicsView):
def writeImage(self, fileName=None):
if fileName is None:
fileName = str(QtGui.QFileDialog.getSaveFileName())
self.fileDialog = QtGui.QFileDialog()
self.fileDialog.setFileMode(QtGui.QFileDialog.AnyFile)
self.fileDialog.setAcceptMode(QtGui.QFileDialog.AcceptSave)
if GraphicsView.lastFileDir is not None:
self.fileDialog.setDirectory(GraphicsView.lastFileDir)
self.fileDialog.show()
self.fileDialog.fileSelected.connect(self.writePng)
return
fileName = str(fileName)
GraphicsView.lastFileDir = os.path.split(fileName)[0]
self.png = QtGui.QImage(self.size(), QtGui.QImage.Format_ARGB32)
painter = QtGui.QPainter(self.png)
rh = self.renderHints()
......
......@@ -21,6 +21,7 @@ import sys
#from numpy import ndarray
import ptime
import numpy as np
import debug
from SignalProxy import proxyConnect
......@@ -53,7 +54,7 @@ class ImageView(QtGui.QWidget):
self.ui.graphicsView.enableMouse(True)
self.ui.graphicsView.autoPixelRange = False
self.ui.graphicsView.setAspectLocked(True)
self.ui.graphicsView.invertY()
#self.ui.graphicsView.invertY()
self.ui.graphicsView.enableMouse()
self.ticks = [t[0] for t in self.ui.gradientWidget.listTicks()]
......@@ -209,12 +210,13 @@ class ImageView(QtGui.QWidget):
key = self.keysPressed.keys()[0]
if key == QtCore.Qt.Key_Right:
self.play(20)
self.lastPlayTime = ptime.time() + 0.2 ## 2ms wait before start
self.jumpFrames(1)
self.lastPlayTime = ptime.time() + 0.2 ## 2ms wait before start
## This happens *after* jumpFrames, since it might take longer than 2ms
elif key == QtCore.Qt.Key_Left:
self.play(-20)
self.lastPlayTime = ptime.time() + 0.2
self.jumpFrames(-1)
self.lastPlayTime = ptime.time() + 0.2
elif key == QtCore.Qt.Key_Up:
self.play(-100)
elif key == QtCore.Qt.Key_Down:
......@@ -340,6 +342,8 @@ class ImageView(QtGui.QWidget):
axes: {'t':0, 'x':1, 'y':2, 'c':3}; Dictionary indicating the interpretation for each axis.
This is only needed to override the default guess.
"""
prof = debug.Profiler('ImageView.setImage', disabled=True)
if not isinstance(img, np.ndarray):
raise Exception("Image must be specified as ndarray.")
self.image = img
......@@ -356,6 +360,7 @@ class ImageView(QtGui.QWidget):
#self.ui.timeSlider.setValue(0)
#self.ui.normStartSlider.setValue(0)
#self.ui.timeSlider.setMaximum(img.shape[0]-1)
prof.mark('1')
if axes is None:
if img.ndim == 2:
......@@ -380,18 +385,23 @@ class ImageView(QtGui.QWidget):
for x in ['t', 'x', 'y', 'c']:
self.axes[x] = self.axes.get(x, None)
prof.mark('2')
self.imageDisp = None
if autoLevels:
if levels is None and autoLevels:
self.autoLevels()
if levels is not None:
if levels is not None: ## this does nothing since getProcessedImage sets these values again.
self.levelMax = levels[1]
self.levelMin = levels[0]
prof.mark('3')
self.currentIndex = 0
self.updateImage()
if self.ui.roiBtn.isChecked():
self.roiChanged()
prof.mark('4')
if self.axes['t'] is not None:
......@@ -412,17 +422,20 @@ class ImageView(QtGui.QWidget):
s.setBounds([start, stop])
#else:
#self.ui.roiPlot.hide()
prof.mark('5')
self.imageItem.resetTransform()
if scale is not None:
self.imageItem.scale(*scale)
if scale is not None:
if pos is not None:
self.imageItem.setPos(*pos)
prof.mark('6')
if autoRange:
self.autoRange()
self.roiClicked()
prof.mark('7')
prof.finish()
def autoLevels(self):
image = self.getProcessedImage()
......@@ -445,10 +458,18 @@ class ImageView(QtGui.QWidget):
if self.imageDisp is None:
image = self.normalize(self.image)
self.imageDisp = image
self.levelMax = float(image.max())
self.levelMin = float(image.min())
self.levelMin, self.levelMax = map(float, ImageView.quickMinMax(self.imageDisp))
return self.imageDisp
@staticmethod
def quickMinMax(data):
while data.size > 1e6:
ax = np.argmax(data.shape)
sl = [slice(None)] * data.ndim
sl[ax] = slice(None, None, 2)
data = data[sl]
return data.min(), data.max()
def normalize(self, image):
if self.ui.normOffRadio.isChecked():
......
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ImageViewTemplate.ui'
#
# Created: Sat Jul 17 13:05:44 2010
# by: PyQt4 UI code generator 4.5.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(726, 588)
self.verticalLayout = QtGui.QVBoxLayout(Form)
self.verticalLayout.setSpacing(0)
self.verticalLayout.setMargin(0)
self.verticalLayout.setObjectName("verticalLayout")
self.splitter = QtGui.QSplitter(Form)
self.splitter.setOrientation(QtCore.Qt.Vertical)
self.splitter.setObjectName("splitter")
self.layoutWidget = QtGui.QWidget(self.splitter)
self.layoutWidget.setObjectName("layoutWidget")
self.gridLayout = QtGui.QGridLayout(self.layoutWidget)
self.gridLayout.setMargin(0)
self.gridLayout.setSpacing(0)
self.gridLayout.setObjectName("gridLayout")
self.graphicsView = GraphicsView(self.layoutWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(10)
sizePolicy.setVerticalStretch(10)
sizePolicy.setHeightForWidth(self.graphicsView.sizePolicy().hasHeightForWidth())
self.graphicsView.setSizePolicy(sizePolicy)
self.graphicsView.setObjectName("graphicsView")
self.gridLayout.addWidget(self.graphicsView, 1, 0, 3, 1)
self.roiBtn = QtGui.QPushButton(self.layoutWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(1)
sizePolicy.setHeightForWidth(self.roiBtn.sizePolicy().hasHeightForWidth())
self.roiBtn.setSizePolicy(sizePolicy)
self.roiBtn.setMaximumSize(QtCore.QSize(30, 16777215))
self.roiBtn.setCheckable(True)
self.roiBtn.setObjectName("roiBtn")
self.gridLayout.addWidget(self.roiBtn, 3, 3, 1, 1)
self.gradientWidget = GradientWidget(self.layoutWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(100)
sizePolicy.setHeightForWidth(self.gradientWidget.sizePolicy().hasHeightForWidth())
self.gradientWidget.setSizePolicy(sizePolicy)
self.gradientWidget.setObjectName("gradientWidget")
self.gridLayout.addWidget(self.gradientWidget, 1, 3, 1, 1)
self.normBtn = QtGui.QPushButton(self.layoutWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(1)
sizePolicy.setHeightForWidth(self.normBtn.sizePolicy().hasHeightForWidth())
self.normBtn.setSizePolicy(sizePolicy)
self.normBtn.setMaximumSize(QtCore.QSize(30, 16777215))
self.normBtn.setCheckable(True)
self.normBtn.setObjectName("normBtn")
self.gridLayout.addWidget(self.normBtn, 2, 3, 1, 1)
self.normGroup = QtGui.QGroupBox(self.layoutWidget)
self.normGroup.setObjectName("normGroup")
self.gridLayout_2 = QtGui.QGridLayout(self.normGroup)
self.gridLayout_2.setMargin(0)
self.gridLayout_2.setSpacing(0)
self.gridLayout_2.setObjectName("gridLayout_2")
self.normSubtractRadio = QtGui.QRadioButton(self.normGroup)
self.normSubtractRadio.setObjectName("normSubtractRadio")
self.gridLayout_2.addWidget(self.normSubtractRadio, 0, 2, 1, 1)
self.normDivideRadio = QtGui.QRadioButton(self.normGroup)
self.normDivideRadio.setChecked(False)
self.normDivideRadio.setObjectName("normDivideRadio")
self.gridLayout_2.addWidget(self.normDivideRadio, 0, 1, 1, 1)
self.label_5 = QtGui.QLabel(self.normGroup)
font = QtGui.QFont()
font.setWeight(75)
font.setBold(True)
self.label_5.setFont(font)
self.label_5.setObjectName("label_5")
self.gridLayout_2.addWidget(self.label_5, 0, 0, 1, 1)
self.label_3 = QtGui.QLabel(self.normGroup)
font = QtGui.QFont()
font.setWeight(75)
font.setBold(True)
self.label_3.setFont(font)
self.label_3.setObjectName("label_3")
self.gridLayout_2.addWidget(self.label_3, 1, 0, 1, 1)
self.label_4 = QtGui.QLabel(self.normGroup)
font = QtGui.QFont()
font.setWeight(75)
font.setBold(True)
self.label_4.setFont(font)
self.label_4.setObjectName("label_4")
self.gridLayout_2.addWidget(self.label_4, 2, 0, 1, 1)
self.normROICheck = QtGui.QCheckBox(self.normGroup)
self.normROICheck.setObjectName("normROICheck")
self.gridLayout_2.addWidget(self.normROICheck, 1, 1, 1, 1)
self.normXBlurSpin = QtGui.QDoubleSpinBox(self.normGroup)
self.normXBlurSpin.setObjectName("normXBlurSpin")
self.gridLayout_2.addWidget(self.normXBlurSpin, 2, 2, 1, 1)
self.label_8 = QtGui.QLabel(self.normGroup)
self.label_8.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_8.setObjectName("label_8")
self.gridLayout_2.addWidget(self.label_8, 2, 1, 1, 1)
self.label_9 = QtGui.QLabel(self.normGroup)
self.label_9.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_9.setObjectName("label_9")
self.gridLayout_2.addWidget(self.label_9, 2, 3, 1, 1)
self.normYBlurSpin = QtGui.QDoubleSpinBox(self.normGroup)
self.normYBlurSpin.setObjectName("normYBlurSpin")
self.gridLayout_2.addWidget(self.normYBlurSpin, 2, 4, 1, 1)
self.label_10 = QtGui.QLabel(self.normGroup)
self.label_10.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_10.setObjectName("label_10")
self.gridLayout_2.addWidget(self.label_10, 2, 5, 1, 1)
self.normOffRadio = QtGui.QRadioButton(self.normGroup)
self.normOffRadio.setChecked(True)
self.normOffRadio.setObjectName("normOffRadio")
self.gridLayout_2.addWidget(self.normOffRadio, 0, 3, 1, 1)
self.normTimeRangeCheck = QtGui.QCheckBox(self.normGroup)
self.normTimeRangeCheck.setObjectName("normTimeRangeCheck")
self.gridLayout_2.addWidget(self.normTimeRangeCheck, 1, 3, 1, 1)
self.normFrameCheck = QtGui.QCheckBox(self.normGroup)
self.normFrameCheck.setObjectName("normFrameCheck")
self.gridLayout_2.addWidget(self.normFrameCheck, 1, 2, 1, 1)
self.normTBlurSpin = QtGui.QDoubleSpinBox(self.normGroup)
self.normTBlurSpin.setObjectName("normTBlurSpin")
self.gridLayout_2.addWidget(self.normTBlurSpin, 2, 6, 1, 1)
self.gridLayout.addWidget(self.normGroup, 0, 0, 1, 4)
self.roiPlot = PlotWidget(self.splitter)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.roiPlot.sizePolicy().hasHeightForWidth())
self.roiPlot.setSizePolicy(sizePolicy)
self.roiPlot.setMinimumSize(QtCore.QSize(0, 40))
self.roiPlot.setObjectName("roiPlot")
self.verticalLayout.addWidget(self.splitter)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
Form.setWindowTitle(QtGui.QApplication.translate("Form", "Form", None, QtGui.QApplication.UnicodeUTF8))
self.roiBtn.setText(QtGui.QApplication.translate("Form", "R", None, QtGui.QApplication.UnicodeUTF8))
self.normBtn.setText(QtGui.QApplication.translate("Form", "N", None, QtGui.QApplication.UnicodeUTF8))
self.normGroup.setTitle(QtGui.QApplication.translate("Form", "Normalization", None, QtGui.QApplication.UnicodeUTF8))
self.normSubtractRadio.setText(QtGui.QApplication.translate("Form", "Subtract", None, QtGui.QApplication.UnicodeUTF8))
self.normDivideRadio.setText(QtGui.QApplication.translate("Form", "Divide", None, QtGui.QApplication.UnicodeUTF8))
self.label_5.setText(QtGui.QApplication.translate("Form", "Operation:", None, QtGui.QApplication.UnicodeUTF8))
self.label_3.setText(QtGui.QApplication.translate("Form", "Mean:", None, QtGui.QApplication.UnicodeUTF8))
self.label_4.setText(QtGui.QApplication.translate("Form", "Blur:", None, QtGui.QApplication.UnicodeUTF8))
self.normROICheck.setText(QtGui.QApplication.translate("Form", "ROI", None, QtGui.QApplication.UnicodeUTF8))
self.label_8.setText(QtGui.QApplication.translate("Form", "X", None, QtGui.QApplication.UnicodeUTF8))
self.label_9.setText(QtGui.QApplication.translate("Form", "Y", None, QtGui.QApplication.UnicodeUTF8))
self.label_10.setText(QtGui.QApplication.translate("Form", "T", None, QtGui.QApplication.UnicodeUTF8))
self.normOffRadio.setText(QtGui.QApplication.translate("Form", "Off", None, QtGui.QApplication.UnicodeUTF8))
self.normTimeRangeCheck.setText(QtGui.QApplication.translate("Form", "Time range", None, QtGui.QApplication.UnicodeUTF8))
self.normFrameCheck.setText(QtGui.QApplication.translate("Form", "Frame", None, QtGui.QApplication.UnicodeUTF8))
from GraphicsView import GraphicsView
from pyqtgraph.GradientWidget import GradientWidget
from PlotWidget import PlotWidget
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file './lib/util/pyqtgraph/ImageViewTemplate.ui'
#
# Created: Wed May 18 20:44:20 2011
# by: PyQt4 UI code generator 4.8.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
_fromUtf8 = lambda s: s
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName(_fromUtf8("Form"))
Form.resize(726, 588)
self.verticalLayout = QtGui.QVBoxLayout(Form)
self.verticalLayout.setSpacing(0)
self.verticalLayout.setMargin(0)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.splitter = QtGui.QSplitter(Form)
self.splitter.setOrientation(QtCore.Qt.Vertical)
self.splitter.setObjectName(_fromUtf8("splitter"))
self.layoutWidget = QtGui.QWidget(self.splitter)
self.layoutWidget.setObjectName(_fromUtf8("layoutWidget"))
self.gridLayout = QtGui.QGridLayout(self.layoutWidget)
self.gridLayout.setMargin(0)
self.gridLayout.setSpacing(0)
self.gridLayout.setMargin(0)
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
self.graphicsView = GraphicsView(self.layoutWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(10)
sizePolicy.setVerticalStretch(10)
sizePolicy.setHeightForWidth(self.graphicsView.sizePolicy().hasHeightForWidth())
self.graphicsView.setSizePolicy(sizePolicy)
self.graphicsView.setObjectName(_fromUtf8("graphicsView"))
self.gridLayout.addWidget(self.graphicsView, 1, 0, 3, 1)
self.roiBtn = QtGui.QPushButton(self.layoutWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(1)
sizePolicy.setHeightForWidth(self.roiBtn.sizePolicy().hasHeightForWidth())
self.roiBtn.setSizePolicy(sizePolicy)
self.roiBtn.setMaximumSize(QtCore.QSize(30, 16777215))
self.roiBtn.setCheckable(True)
self.roiBtn.setObjectName(_fromUtf8("roiBtn"))
self.gridLayout.addWidget(self.roiBtn, 3, 3, 1, 1)
self.gradientWidget = GradientWidget(self.layoutWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(100)
sizePolicy.setHeightForWidth(self.gradientWidget.sizePolicy().hasHeightForWidth())
self.gradientWidget.setSizePolicy(sizePolicy)
self.gradientWidget.setObjectName(_fromUtf8("gradientWidget"))
self.gridLayout.addWidget(self.gradientWidget, 1, 3, 1, 1)
self.normBtn = QtGui.QPushButton(self.layoutWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)