Layout_interface.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:BrainModulyzer 作者: sugeerth 项目源码 文件源码
def captureSnapshot(self):
        """ Logic to capture all the parameters for the data visualization """

        print "Capturing the timepoints"        
        # Code graciously taken from the Qt website 
        msgBox = QtGui.QMessageBox()
        msgBox.setText("Capturing the snapshot.")
        msgBox.setInformativeText("Do you want to capture the parameters of the visualization?")
        msgBox.setStandardButtons(QtGui.QMessageBox.Save | QtGui.QMessageBox.Discard | QtGui.QMessageBox.Cancel)
        msgBox.setDefaultButton(QtGui.QMessageBox.Save)
        ret = msgBox.exec_()

        if ret == QtGui.QMessageBox.Save:
            Sanpshots = dict()
            print "Logic for capturing the paprameters of the visualizations"
            Sanpshots["correlationMode"] = self.widget.ColorNodesBasedOnCorrelation
            Sanpshots["nodeMapping"] = self.widget.nodeSizeFactor
            Sanpshots["edgeThickness"] = self.widget.nodeSizeFactor
            Sanpshots["onlyEdges:"] = self.widget.DisplayOnlyEdges
            Sanpshots["transparentNodes"] = self.widget.setTransp
            Sanpshots["highlightEdges"] = self.widget.HighlightedId
            Sanpshots["communityGraphLevel"] = self.widget.level
            Sanpshots["datasetLoaded"] = (self.matrix_filename,self.template_filename,self.parcelation_filename)

            # Make a Directory 
            try:
                os.makedirs(self.directory_path[0])
            except OSError as exception:
                pass

            from time import gmtime, strftime
            fileName = strftime("%Y-%m-%d %H:%M:%S", gmtime())
            '2009-01-05 22:14:39'

            with open(self.directory_path[0]+"/"+fileName, 'w') as outfile:
                pickle.dump(Sanpshots, outfile)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号