Ejemplo n.º 1
0
 def onZipfPlot(self):
     before = time.time()
     
     pg.setConfigOptions(antialias=True)
     dialog= QtGui.QDialog(self)
     plotWidget = pg.PlotWidget(name='Zipf\'s Law Plot')
     
     logx = self.model.getLogX()
     ab = self.model.getPolyFit()
     s = ScatterPlotItem(logx, self.model.getLogfreqDist(), size=4, pen=None, brush=pg.mkBrush(255, 255, 255))
     s.addPoints(logx, self.model.getLogfreqDist())
     plot = plotWidget.plot(logx, [self.model.getPoly(x) for x in logx],  pen=(0,255,255), size=4)
     
     legend = LegendItem((130,60), offset=(500,30))
     legend.setParentItem(plotWidget.getPlotItem())
     legend.addItem(s, 'Corpus data')
     legend.addItem(plot, str(round(ab[0], 3)) + 'x + ' +str(round(ab[1], 3)))
     
     plotWidget.addItem(s)
     lay = QtGui.QVBoxLayout()
     lay.addWidget(plotWidget)
     
     dialog.setLayout(lay)
     dialog.show()
             
     self.fillTimeData("creating Zipf plot", time.time() - before)
Ejemplo n.º 2
0
    def __init__(self, cluster, plot, pen=None, brush=None):
        self.__cluster=cluster;
        
        if(pen is None):
            self.__pen=pg.mkPen(QColor("#DFDFDF"));
        else:
            self.__pen=pen;
            
        if(brush is None):
            self.__brush=QBrush(QColor("#DFDFDF"));
        else:
            self.__brush=brush;
#         self.__plotData=pg.ScatterPlotItem(x=[0, 1], y=[0, 1],
#                                       symbol="s", __pen=pg.mkPen("w"),
#                                       size=1);
        
        self.__plotData=FastScatterPlotItem(x=[0], y=[0],
                                      symbol="s", pen=self.__pen,
                                      size=1, pointMode=True);
#         self.__plotData=ScatterPlotItem(x=[0], y=[0], symbol="s",
#                                             pen=self.__pen, brush=self.__brush, size=1);
        self.__plotDataBigP=ScatterPlotItem(x=[0], y=[0], symbol="s",
                                            pen=self.__pen, brush=self.__brush, size=2);
        self.__plotBoundaryData=pg.PlotDataItem(x=[0], y=[0], pen=self.__pen);     
        self.__plot=plot;
        self.__waveStartInd=0;
        self.__selPtsSequence=None;
        self.__calcSelPtsSequence();
        self.__selDispWaves=np.zeros(self.__cluster.getSelectArray().shape, dtype="bool");
Ejemplo n.º 3
0
 def __init__(self, name):
     CtrlNode.__init__(self,
                       name,
                       terminals={
                           'input': {
                               'io': 'in'
                           },
                           'plot': {
                               'io': 'out'
                           }
                       })
     self.item = ScatterPlotItem()
     self.keys = []
Ejemplo n.º 4
0
 def __init__(self, name, num_data, color, ix, max_actors, actor_height):
     self.name = name
     self.num_data = num_data
     self.color = color
     self.ix = ix
     self.max_actors = max_actors
     self.actor_height = actor_height
     self.offset = ix * actor_height
     self.data = np.array([self.offset + 30] * num_data)
     self.head = 0
     self.pre_head = 0
     self.plotItem = PlotCurveItem(pen=pg.mkPen(color, width=3), width=4, name=name)
     self.plotPoint = ScatterPlotItem(pen=pg.mkPen("w", width=5), brush=pg.mkBrush(color), size=5)
     self.render()
Ejemplo n.º 5
0
 def _update_anchors_scatter_item(self, points):
     if self.anchors_scatter_item is not None:
         self.plot_widget.removeItem(self.anchors_scatter_item)
         self.anchors_scatter_item = None
     self.anchors_scatter_item = ScatterPlotItem(x=points[:, 0],
                                                 y=points[:, 1])
     self.plot_widget.addItem(self.anchors_scatter_item)
Ejemplo n.º 6
0
 def __init__(self, name):
     CtrlNode.__init__(self, name, terminals={
         'input': {'io': 'in'},
         'plot': {'io': 'out'}
     })
     self.item = ScatterPlotItem()
     self.keys = []
Ejemplo n.º 7
0
 def __init__(self,
              scatter_widget,
              parent=None,
              name="None",
              view_box=None):
     super().__init__(scatter_widget,
                      parent=parent,
                      _=name,
                      view_box=view_box)
     self._tooltip_delegate = EventDelegate(self.help_event, self._show_arc)
     self.plot_widget.scene().installEventFilter(self._tooltip_delegate)
     self.scatterplot_points = ScatterPlotItem(x=[], y=[])
Ejemplo n.º 8
0
class Actor(object):
    def __init__(self, name, num_data, color, ix, max_actors, actor_height):
        self.name = name
        self.num_data = num_data
        self.color = color
        self.ix = ix
        self.max_actors = max_actors
        self.actor_height = actor_height
        self.offset = ix * actor_height
        self.data = np.array([self.offset + 30] * num_data)
        self.head = 0
        self.pre_head = 0
        self.plotItem = PlotCurveItem(pen=pg.mkPen(color, width=3), width=4, name=name)
        self.plotPoint = ScatterPlotItem(pen=pg.mkPen("w", width=5), brush=pg.mkBrush(color), size=5)
        self.render()

    def __str__(self):
        return "<Actor name:%r, position=%r>" % (self.name, self.head)

    def __repr__(self):
        return "Actor(%r, %r, %r, %r, %r, %r)" % (self.name, self.num_data,
                                                  self.color, self.ix, self.max_actors, self.actor_height)

    def add_value(self, value):
        self.pre_head = self.head
        self.data[self.pre_head] = value / self.max_actors + self.offset
        self.head = (self.pre_head + 1) % self.num_data

    def fill_missing(self, count):
        dp = self.head
        for i in range(count):
            self.data[dp] = self.offset
            dp = (dp + 1) % self.num_data

        self.pre_head = (dp - 1) % self.num_data
        self.head = dp

    def render(self):
        self.plotItem.setData(y=self.data, clear=True)
        self.plotPoint.setData(x=[self.pre_head], y=[self.data[self.pre_head]])
Ejemplo n.º 9
0
    def manual_move(self):
        self.__replot_requested = False

        if self.plotdata.rand is not None:
            rand = self.plotdata.rand
            valid_mask = self.plotdata.valid_mask
            data = self.data[valid_mask]
            selection = self._selection[valid_mask]
            selection = selection[rand]
            ec, _, valid_mask = radviz(
                data, list(self.model_selected), self.plotdata.points
            )
            assert sum(valid_mask) == len(data)
            data = data[rand]
            ec = ec[rand]
            data_x = data.X
            data_y = data.Y
            data_metas = data.metas
        else:
            self.prepare_radviz_data(list(self.model_selected))
            ec = self.plotdata.embedding_coords
            valid_mask = self.plotdata.valid_mask
            data_x = self.data.X[valid_mask]
            data_y = self.data.Y[valid_mask]
            data_metas = self.data.metas[valid_mask]
            selection = self._selection[valid_mask]

        attributes = (self.variable_x, self.variable_y) + self.data.domain.attributes
        domain = Domain(
            attributes=attributes,
            class_vars=self.data.domain.class_vars,
            metas=self.data.domain.metas,
        )
        data = Table.from_numpy(
            domain, X=np.hstack((ec, data_x)), Y=data_y, metas=data_metas
        )
        self.graph.new_data(data, None)
        self.graph.selection = selection
        self.graph.update_data(self.variable_x, self.variable_y, reset_view=True)
        self.graph.plot_widget.addItem(self._circle)
        self.graph.scatterplot_points = ScatterPlotItem(
            x=self.plotdata.points[:, 0], y=self.plotdata.points[:, 1]
        )
        self._update_points_labels()
        self.graph.plot_widget.addItem(self.graph.scatterplot_points)
Ejemplo n.º 10
0
    def setup_plot(self, reset_view=True):
        if self.data is None:
            return
        self.graph.jitter_continuous = True
        self.__replot_requested = False

        variables = list(self.model_selected)
        if len(variables) < 2:
            self.Warning.no_features()
            self.graph.new_data(None)
            return

        self.Warning.clear()
        self.prepare_radviz_data(variables)

        if self.plotdata.embedding_coords is None:
            return

        domain = self.data.domain
        new_metas = domain.metas + (self.variable_x, self.variable_y)
        domain = Domain(
            attributes=domain.attributes, class_vars=domain.class_vars, metas=new_metas
        )
        mask = self.plotdata.valid_mask
        array = np.zeros((len(self.data), 2), dtype=np.float)
        array[mask] = self.plotdata.embedding_coords
        data = self.data.transform(domain)
        data[:, self.variable_x] = array[:, 0].reshape(-1, 1)
        data[:, self.variable_y] = array[:, 1].reshape(-1, 1)
        subset_data = (
            data[self._subset_mask & mask]
            if self._subset_mask is not None and len(self._subset_mask)
            else None
        )
        self.plotdata.data = data
        self.graph.new_data(data[mask], subset_data)
        if self._selection is not None:
            self.graph.selection = self._selection[self.plotdata.valid_mask]
        self.graph.update_data(self.variable_x, self.variable_y, reset_view=reset_view)
        self.graph.plot_widget.addItem(self._circle)
        self.graph.scatterplot_points = ScatterPlotItem(
            x=self.plotdata.points[:, 0], y=self.plotdata.points[:, 1]
        )
        self._update_points_labels()
        self.graph.plot_widget.addItem(self.graph.scatterplot_points)
Ejemplo n.º 11
0
class ScatterPlot(CtrlNode):
    """Generates a scatter plot from a record array or nested dicts"""
    nodeName = 'ScatterPlot'
    uiTemplate = [
        ('x', 'combo', {'values': [], 'index': 0}),
        ('y', 'combo', {'values': [], 'index': 0}),
        ('sizeEnabled', 'check', {'value': False}),
        ('size', 'combo', {'values': [], 'index': 0}),
        ('absoluteSize', 'check', {'value': False}),
        ('colorEnabled', 'check', {'value': False}),
        ('color', 'colormap', {}),
        ('borderEnabled', 'check', {'value': False}),
        ('border', 'colormap', {}),
    ]
    
    def __init__(self, name):
        CtrlNode.__init__(self, name, terminals={
            'input': {'io': 'in'},
            'plot': {'io': 'out'}
        })
        self.item = ScatterPlotItem()
        self.keys = []
        
        #self.ui = QtGui.QWidget()
        #self.layout = QtGui.QGridLayout()
        #self.ui.setLayout(self.layout)
        
        #self.xCombo = QtGui.QComboBox()
        #self.yCombo = QtGui.QComboBox()
        
        
    
    def process(self, input, display=True):
        #print "scatterplot process"
        if not display:
            return {'plot': None}
            
        self.updateKeys(input[0])
        
        x = str(self.ctrls['x'].currentText())
        y = str(self.ctrls['y'].currentText())
        size = str(self.ctrls['size'].currentText())
        pen = QtGui.QPen(QtGui.QColor(0,0,0,0))
        points = []
        for i in input:
            pt = {'pos': (i[x], i[y])}
            if self.ctrls['sizeEnabled'].isChecked():
                pt['size'] = i[size]
            if self.ctrls['borderEnabled'].isChecked():
                pt['pen'] = QtGui.QPen(self.ctrls['border'].getColor(i))
            else:
                pt['pen'] = pen
            if self.ctrls['colorEnabled'].isChecked():
                pt['brush'] = QtGui.QBrush(self.ctrls['color'].getColor(i))
            points.append(pt)
        self.item.setPxMode(not self.ctrls['absoluteSize'].isChecked())
            
        self.item.setPoints(points)
        
        return {'plot': self.item}
        
        

    def updateKeys(self, data):
        if isinstance(data, dict):
            keys = list(data.keys())
        elif isinstance(data, list) or isinstance(data, tuple):
            keys = data
        elif isinstance(data, np.ndarray) or isinstance(data, np.void):
            keys = data.dtype.names
        else:
            print("Unknown data type:", type(data), data)
            return
            
        for c in self.ctrls.values():
            c.blockSignals(True)
        for c in [self.ctrls['x'], self.ctrls['y'], self.ctrls['size']]:
            cur = str(c.currentText())
            c.clear()
            for k in keys:
                c.addItem(k)
                if k == cur:
                    c.setCurrentIndex(c.count()-1)
        for c in [self.ctrls['color'], self.ctrls['border']]:
            c.setArgList(keys)
        for c in self.ctrls.values():
            c.blockSignals(False)
                
        self.keys = keys
        

    def saveState(self):
        state = CtrlNode.saveState(self)
        return {'keys': self.keys, 'ctrls': state}
        
    def restoreState(self, state):
        self.updateKeys(state['keys'])
        CtrlNode.restoreState(self, state['ctrls'])
        
#class ImageItem(Node):
    #"""Creates an ImageItem for display in a canvas from a file handle."""
    #nodeName = 'Image'
    
    #def __init__(self, name):
        #Node.__init__(self, name, terminals={
            #'file': {'io': 'in'},
            #'image': {'io': 'out'}
        #})
        #self.imageItem = graphicsItems.ImageItem()
        #self.handle = None
        
    #def process(self, file, display=True):
        #if not display:
            #return {'image': None}
            
        #if file != self.handle:
            #self.handle = file
            #data = file.read()
            #self.imageItem.updateImage(data)
            
        #pos = file.
        
        
        
Ejemplo n.º 12
0
 def _add_point_items(self):
     if self._points is None:
         return
     x, y = self._points[:, 0], self._points[:, 1]
     self._point_items = ScatterPlotItem(x=x, y=y)
     self.plot_widget.addItem(self._point_items)
Ejemplo n.º 13
0
 def __init__(self, name):
     CtrlNode.__init__(self, name, terminals={"input": {"io": "in"}, "plot": {"io": "out"}})
     self.item = ScatterPlotItem()
     self.keys = []
Ejemplo n.º 14
0
class ScatterPlot(CtrlNode):
    """Generates a scatter plot from a record array or nested dicts"""

    nodeName = "ScatterPlot"
    uiTemplate = [
        ("x", "combo", {"values": [], "index": 0}),
        ("y", "combo", {"values": [], "index": 0}),
        ("sizeEnabled", "check", {"value": False}),
        ("size", "combo", {"values": [], "index": 0}),
        ("absoluteSize", "check", {"value": False}),
        ("colorEnabled", "check", {"value": False}),
        ("color", "colormap", {}),
        ("borderEnabled", "check", {"value": False}),
        ("border", "colormap", {}),
    ]

    def __init__(self, name):
        CtrlNode.__init__(self, name, terminals={"input": {"io": "in"}, "plot": {"io": "out"}})
        self.item = ScatterPlotItem()
        self.keys = []

        # self.ui = QtGui.QWidget()
        # self.layout = QtGui.QGridLayout()
        # self.ui.setLayout(self.layout)

        # self.xCombo = QtGui.QComboBox()
        # self.yCombo = QtGui.QComboBox()

    def process(self, input, display=True):
        # print "scatterplot process"
        if not display:
            return {"plot": None}

        self.updateKeys(input[0])

        x = str(self.ctrls["x"].currentText())
        y = str(self.ctrls["y"].currentText())
        size = str(self.ctrls["size"].currentText())
        pen = QtGui.QPen(QtGui.QColor(0, 0, 0, 0))
        points = []
        for i in input:
            pt = {"pos": (i[x], i[y])}
            if self.ctrls["sizeEnabled"].isChecked():
                pt["size"] = i[size]
            if self.ctrls["borderEnabled"].isChecked():
                pt["pen"] = QtGui.QPen(self.ctrls["border"].getColor(i))
            else:
                pt["pen"] = pen
            if self.ctrls["colorEnabled"].isChecked():
                pt["brush"] = QtGui.QBrush(self.ctrls["color"].getColor(i))
            points.append(pt)
        self.item.setPxMode(not self.ctrls["absoluteSize"].isChecked())

        self.item.setPoints(points)

        return {"plot": self.item}

    def updateKeys(self, data):
        if isinstance(data, dict):
            keys = data.keys()
        elif isinstance(data, list) or isinstance(data, tuple):
            keys = data
        elif isinstance(data, np.ndarray) or isinstance(data, np.void):
            keys = data.dtype.names
        else:
            print "Unknown data type:", type(data), data
            return

        for c in self.ctrls.itervalues():
            c.blockSignals(True)
        for c in [self.ctrls["x"], self.ctrls["y"], self.ctrls["size"]]:
            cur = str(c.currentText())
            c.clear()
            for k in keys:
                c.addItem(k)
                if k == cur:
                    c.setCurrentIndex(c.count() - 1)
        for c in [self.ctrls["color"], self.ctrls["border"]]:
            c.setArgList(keys)
        for c in self.ctrls.itervalues():
            c.blockSignals(False)

        self.keys = keys

    def saveState(self):
        state = CtrlNode.saveState(self)
        return {"keys": self.keys, "ctrls": state}

    def restoreState(self, state):
        self.updateKeys(state["keys"])
        CtrlNode.restoreState(self, state["ctrls"])
Ejemplo n.º 15
0
class ScatterPlot(CtrlNode):
    """Generates a scatter plot from a record array or nested dicts"""
    nodeName = 'ScatterPlot'
    uiTemplate = [
        ('x', 'combo', {
            'values': [],
            'index': 0
        }),
        ('y', 'combo', {
            'values': [],
            'index': 0
        }),
        ('sizeEnabled', 'check', {
            'value': False
        }),
        ('size', 'combo', {
            'values': [],
            'index': 0
        }),
        ('absoluteSize', 'check', {
            'value': False
        }),
        ('colorEnabled', 'check', {
            'value': False
        }),
        ('color', 'colormap', {}),
        ('borderEnabled', 'check', {
            'value': False
        }),
        ('border', 'colormap', {}),
    ]

    def __init__(self, name):
        CtrlNode.__init__(self,
                          name,
                          terminals={
                              'input': {
                                  'io': 'in'
                              },
                              'plot': {
                                  'io': 'out'
                              }
                          })
        self.item = ScatterPlotItem()
        self.keys = []

        #self.ui = QtGui.QWidget()
        #self.layout = QtGui.QGridLayout()
        #self.ui.setLayout(self.layout)

        #self.xCombo = QtGui.QComboBox()
        #self.yCombo = QtGui.QComboBox()

    def process(self, input, display=True):
        #print "scatterplot process"
        if not display:
            return {'plot': None}

        self.updateKeys(input[0])

        x = str(self.ctrls['x'].currentText())
        y = str(self.ctrls['y'].currentText())
        size = str(self.ctrls['size'].currentText())
        pen = QtGui.QPen(QtGui.QColor(0, 0, 0, 0))
        points = []
        for i in input:
            pt = {'pos': (i[x], i[y])}
            if self.ctrls['sizeEnabled'].isChecked():
                pt['size'] = i[size]
            if self.ctrls['borderEnabled'].isChecked():
                pt['pen'] = QtGui.QPen(self.ctrls['border'].getColor(i))
            else:
                pt['pen'] = pen
            if self.ctrls['colorEnabled'].isChecked():
                pt['brush'] = QtGui.QBrush(self.ctrls['color'].getColor(i))
            points.append(pt)
        self.item.setPxMode(not self.ctrls['absoluteSize'].isChecked())

        self.item.setPoints(points)

        return {'plot': self.item}

    def updateKeys(self, data):
        if isinstance(data, dict):
            keys = list(data.keys())
        elif isinstance(data, list) or isinstance(data, tuple):
            keys = data
        elif isinstance(data, np.ndarray) or isinstance(data, np.void):
            keys = data.dtype.names
        else:
            print("Unknown data type:", type(data), data)
            return

        for c in self.ctrls.values():
            c.blockSignals(True)
        for c in [self.ctrls['x'], self.ctrls['y'], self.ctrls['size']]:
            cur = str(c.currentText())
            c.clear()
            for k in keys:
                c.addItem(k)
                if k == cur:
                    c.setCurrentIndex(c.count() - 1)
        for c in [self.ctrls['color'], self.ctrls['border']]:
            c.setArgList(keys)
        for c in self.ctrls.values():
            c.blockSignals(False)

        self.keys = keys

    def saveState(self):
        state = CtrlNode.saveState(self)
        return {'keys': self.keys, 'ctrls': state}

    def restoreState(self, state):
        self.updateKeys(state['keys'])
        CtrlNode.restoreState(self, state['ctrls'])
Ejemplo n.º 16
0
class ClusterPlotItem(object):
    def __init__(self, cluster, plot, pen=None, brush=None):
        self.__cluster=cluster;
        
        if(pen is None):
            self.__pen=pg.mkPen(QColor("#DFDFDF"));
        else:
            self.__pen=pen;
            
        if(brush is None):
            self.__brush=QBrush(QColor("#DFDFDF"));
        else:
            self.__brush=brush;
#         self.__plotData=pg.ScatterPlotItem(x=[0, 1], y=[0, 1],
#                                       symbol="s", __pen=pg.mkPen("w"),
#                                       size=1);
        
        self.__plotData=FastScatterPlotItem(x=[0], y=[0],
                                      symbol="s", pen=self.__pen,
                                      size=1, pointMode=True);
#         self.__plotData=ScatterPlotItem(x=[0], y=[0], symbol="s",
#                                             pen=self.__pen, brush=self.__brush, size=1);
        self.__plotDataBigP=ScatterPlotItem(x=[0], y=[0], symbol="s",
                                            pen=self.__pen, brush=self.__brush, size=2);
        self.__plotBoundaryData=pg.PlotDataItem(x=[0], y=[0], pen=self.__pen);     
        self.__plot=plot;
        self.__waveStartInd=0;
        self.__selPtsSequence=None;
        self.__calcSelPtsSequence();
        self.__selDispWaves=np.zeros(self.__cluster.getSelectArray().shape, dtype="bool");
        
    
    def setPlotData(self, xChN, yChN, xChParamT, yChParamT, drawType=0):
        if(drawType==0):
            self.__plotData.setData(x=self.__cluster.getParam(xChN, xChParamT),
                                  y=self.__cluster.getParam(yChN, yChParamT),
                                  symbol="s", pen=self.__pen,
                                  size=1, pointMode=True);
#             self.__plotData.setData(x=self.__cluster.getParam(xChN, xChParamT),
#                                         y=self.__cluster.getParam(yChN, yChParamT),
#                                         symbol="s", pen=self.__pen, brush=self.__brush,
#                                         size=1);
        else:
            self.__plotDataBigP.setData(x=self.__cluster.getParam(xChN, xChParamT),
                                        y=self.__cluster.getParam(yChN, yChParamT),
                                        symbol="s", pen=self.__pen, brush=self.__brush,
                                        size=2);
        boundaries=self.__cluster.getBoundaries([xChN, yChN], [xChParamT, yChParamT]);
        if(len(boundaries)>0):
            points=np.zeros((2, 0));
            connArr=np.zeros(0, dtype="bool");
            for i in boundaries:
                curPoints=i.getPoints();
                points=np.hstack((points, curPoints));
                curCon=np.zeros(curPoints.shape[1], dtype="bool");
                curCon[:-1]=True;
                connArr=np.hstack((connArr, curCon));
            self.__plotBoundaryData.setData(x=points[0, :], y=points[1, :], 
                                            connect=connArr);
        else:
            self.__plotBoundaryData.setData(x=[0], y=[0], connect="all");
            
    
                              
    def addToPlot(self, drawType=0):
        if(drawType==0):
            self.__plot.addItem(self.__plotData);
        else:
            self.__plot.addItem(self.__plotDataBigP);
        self.__plot.addItem(self.__plotBoundaryData);
        
    def removeFromPlot(self, plotType=0):
        if(plotType==0):
            self.__plot.removeItem(self.__plotData);
        else:
            self.__plot.RemoveItem(self.__plotDataBigP);
        self.__plot.removeItem(self.__plotBoundaryData);
        
    def getCurPen(self):
        return self.__pen;
    
    def __calcSelPtsSequence(self):
        sBA=self.__cluster.getSelectArray();
        self.__selPtsSequence=np.cumsum(sBA);
        
    def getPrevWaves(self, indIncSize, trigChOnly):
        self.__calcSelPtsSequence();
        if(self.__waveStartInd<=0):
            return (None, None, None, None, None);
        self.__waveStartInd=self.__waveStartInd-indIncSize;
        if(self.__waveStartInd+indIncSize>=self.__getNumSelPts()):
            self.__waveStartInd=self.__getNumSelPts()-indIncSize;
#         self.__waveStartInd=self.__waveStartInd%self.__getNumSelPts();
        if(self.__waveStartInd<=0):
            self.__waveStartInd=0;
        sBA=self.__getSelPointsByRange(self.__waveStartInd, self.__waveStartInd+indIncSize);
        self.__selDispWaves=self.__selDispWaves | sBA;
        
        (nptsPerCh, waves, xvals, connArrs)=self.__cluster.getWaveforms(sBA, None, trigChOnly);
        return (self.__cluster.getNumChannels(), nptsPerCh, waves, xvals, connArrs);
        
    def getNextWaves(self, indIncSize, trigChOnly):
        self.__calcSelPtsSequence();
        if(self.__waveStartInd>=self.__getNumSelPts()):
            return (None, None, None, None, None);
        sBA=self.__getSelPointsByRange(self.__waveStartInd, self.__waveStartInd+indIncSize);
        self.__selDispWaves=self.__selDispWaves | sBA;
        
        self.__waveStartInd=self.__waveStartInd+indIncSize;
        
        (nptsPerCh, waves, xvals, connArrs)=self.__cluster.getWaveforms(sBA, None, trigChOnly);
        return (self.__cluster.getNumChannels(), nptsPerCh, waves, xvals, connArrs);
    
    def resetWaveInd(self):
        self.__waveStartInd=0;
        
    def clearSelDispWaves(self):
        self.__selDispWaves[:]=False;
        
    def resetViewWaves(self):
        self.__calcSelPtsSequence();
        
    def getSelDispWaves(self):
        (wAvg, wSEM, w25P, wMed, w75P)=self.__cluster.calcWaveStats();
        
        (nptsPerCh, waves, xvals, conArrs)=self.__cluster.getWaveforms(self.__selDispWaves, 
                                                                       None, False)
        return (waves, wAvg, wSEM, w25P, wMed, w75P);
    
    def __getSelPointsByRange(self, startInd, endInd):
        sBA=self.__cluster.getSelectArray();
        return sBA & ((self.__selPtsSequence>=startInd) & (self.__selPtsSequence<endInd));
    
    def __getNumSelPts(self):
        return self.__selPtsSequence[-1];