'Add a new segment to the ROI connecting from the previous endpoint to *pos*.
(pos is specified in the parent coordinate system of the MultiRectROI)'

def addSegment(self, pos=(0, 0), scaleHandle=False, connectTo=None):

    if (connectTo is None):
        connectTo = self.lines[(-1)].getHandles()[1]
    newRoi = ROI((0, 0), [1, 5], parent=self, pen=self.pen, **self.roiArgs)
    self.lines.append(newRoi)
    if isinstance(connectTo, Handle):
        self.lines[(-1)].addScaleRotateHandle([0, 0.5], [1, 0.5], item=connectTo)
        newRoi.movePoint(connectTo, connectTo.scenePos(), coords='scene')
    else:
        h = self.lines[(-1)].addScaleRotateHandle([0, 0.5], [1, 0.5])
        newRoi.movePoint(h, connectTo, coords='scene')
    h = self.lines[(-1)].addScaleRotateHandle([1, 0.5], [0, 0.5])
    newRoi.movePoint(h, pos)
    if scaleHandle:
        newRoi.addScaleHandle([0.5, 1], [0.5, 0.5])
    newRoi.translatable = False
    newRoi.sigRegionChanged.connect(self.roiChangedEvent)
    newRoi.sigRegionChangeStarted.connect(self.roiChangeStartedEvent)
    newRoi.sigRegionChangeFinished.connect(self.roiChangeFinishedEvent)
    self.sigRegionChanged.emit(self)
