'Remove a segment from the ROI.'

def removeSegment(self, index=(-1)):

    roi = self.lines[index]
    self.lines.pop(index)
    self.scene().removeItem(roi)
    roi.sigRegionChanged.disconnect(self.roiChangedEvent)
    roi.sigRegionChangeStarted.disconnect(self.roiChangeStartedEvent)
    roi.sigRegionChangeFinished.disconnect(self.roiChangeFinishedEvent)
    self.sigRegionChanged.emit(self)
