def save(self, filename): """Save current ROIs of the widget as a dict of ROI to a file. :param str filename: The file to which to save the ROIs """ roilist, roidict = self.roiTable.getROIListAndDict() datadict = {'ROI': {'roilist': roilist, 'roidict': roidict}} dictdump.dump(datadict, filename)