def createObjects(self): displayObject.createObjects(self) x,y=self.pos sz=float(self.params['sz']) try: res=float(self.params['res'][0]) except: res=float(self.params['res']) col=zeros(res**2) for n in range(int(res**2)): col[n]=(myrand[mod(n+self.RC,len(myrand))]*self.params['std']+self.params['mu']) self.stim.switch_to() self.fgObjects=(primitives.checkerBoard(x,y,sz,res,col), ) self.stat.switch_to() self.fgObjects[0].enableArrays()
def createObjects(self): if 'bgCal' in self.params.keys(): bgSz=float(self.params['bgSz']) bgRes=float(self.params['bgRes']) col=self.params['bgCal'].astype(float64)/255. self.stim.switch_to() self.bgObjects=(primitives.checkerBoard(W/2,H/2,bgSz,bgRes,col), ) self.stat.switch_to() self.bgObjects[0].enableArrays() else: self.background=primitives.Polygon(v=[(0,0),(0,H),(W,H),(W,0),(0,0)],z=0, color=self.bg, stroke=0) self.bgObjects=(self.background, ) if 'dispCell' in self.params and self.params['dispCell']: soma=primitives.Circle(self.cellPos[0],self.cellPos[1],width=round(20*0.68),color=(.5,.5,0,.5),stroke=2) dendrites=primitives.Circle(self.cellPos[0],self.cellPos[1],width=round(150*0.68),color=(.5,.5,0,.5),stroke=1) self.statObjects+=(soma,dendrites) outline=primitives.Polygon(v=[(0,0),(0,H),(W,H),(W,0),(0,0)],z=0, color=(0,0,1,1), stroke=2) self.statObjects+=(outline,)