def __init__(self, graphWidget, counter,correlationTable,ForCommunities=False):
QtGui.QGraphicsItem.__init__(self)
"""Accepting hover events """
self.setAcceptHoverEvents(True)
self.opacityValue = 255
self.graph = weakref.ref(graphWidget)
self.edgeList = []
self.ForCommunities = True
self.ForCommunities = ForCommunities
self.CommunityColor = None
self.MousePressede = True
self.setTransp = True
self.NodeCommunityColor = False
self.counter = counter
self.aplha = 0.2
self.colorTransparency = True
self.First = True
self.nodesize = 12
self.degreeCentrality = 1.0
# FIX ME switched off untill centre abbreviation is sorted out
# self.Abbr = correlationTable.AbbrName
self.Brain_Regions = correlationTable.RegionName[0]
for i in range (self.counter-1):
self.Brain_Regions[i] = self.Brain_Regions[i].replace(' ','')
if not(self.ForCommunities):
self.setToolTip(str(self.Brain_Regions[self.counter-1]+ " , " + str(self.counter)))
else:
self.setToolTip(str(counter))
self.colorvalue = []
self.Selected = False
self.Translate = Translate()
self.WhitePaint= False
self.newPos = QtCore.QPointF()
self.setFlag(QtGui.QGraphicsItem.ItemIsSelectable)
# self.setFlag(QtGui.QGraphicsItem.ItemIgnoresTransformations)
# self.setFlag(QtGui.QGraphicsItem.ItemUsesExtendedStyleOption)
# self.setFlag(QtGui.QGraphicsItem.ItemSendsGeometryChanges)
if not(self.ForCommunities):
self.nodeColor = QtGui.QColor(self.graph().DataColor[self.counter])
self.setCacheMode(self.DeviceCoordinateCache)
if (len(correlationTable.data) > 150):
self.nodesize = 22 - (2000*len(correlationTable.data)*0.00001)% 3
self.i = 0
self.setZValue(3)
评论列表
文章目录