def gabor(self, x, y, orient, freq, env=u"gaussian", size=96, stdev=12, phase=0, col1=u"white", col2=u"black", bgmode=u"avg"): surface = canvas._gabor(orient, freq, env, size, stdev, phase, col1, col2, bgmode) x, y = self.to_xy(x, y) self.surface.blit(surface, (x - 0.5 * size, y - 0.5 * size))
def prepare(self): surface = canvas._gabor(self.orient, self.freq, self.env, self.size, self.stdev, self.phase, self.col1, self.col2, self.bgmode) x, y = self.to_xy(self.x, self.y) self.surface.blit(surface, (x - 0.5 * self.size, y - 0.5 * self.size))
def gabor(self, x, y, orient, freq, env=u"gaussian", size=96, stdev=12, phase=0, col1=u"white", col2=u"black", bgmode=u"avg"): surface = canvas._gabor(orient, freq, env, size, stdev, phase, col1, col2, bgmode) stim = stimuli._visual.Visual(position=self.to_xy((x,y))) stim._surface = surface self.add_stim(stim)
def prepare(self): self._stim = Visual(position=self.to_xy(self.x, self.y)) self._stim.set_surface( canvas._gabor( self.orient, self.freq, self.env, self.size, self.stdev, self.phase, self.col1, self.col2, self.bgmode ) ) self._stim.preload()
def gabor_file(*arglist, **kwdict): """ desc: Creates a temporary file containing a Gabor patch. argument-list: arglist: See canvas.gabor() for a description of arguments. keyword-dict: kwdict: See canvas.gabor() for a description of keywords. returns: A path to the image file. """ from openexp._canvas import canvas as _canvas surface = _canvas._gabor(*arglist, **kwdict) fd, fname = tempfile.mkstemp(suffix=u'.png') pygame.image.save(surface, fname) temp_files.append(fname) os.close(fd) return fname
def gabor_file(*arglist, **kwdict): """ desc: Creates a temporary file containing a Gabor patch. argument-list: arglist: See canvas.gabor() for a description of arguments. keyword-dict: kwdict: See canvas.gabor() for a description of keywords. returns: A path to the image file. """ global temp_files from openexp._canvas import canvas surface = canvas._gabor(*arglist, **kwdict) tmp = tempfile.mkstemp(suffix='.png')[1] pygame.image.save(surface, tmp) temp_files.append(tmp) return tmp
def gabor_file(*arglist, **kwdict): """ desc: Creates a temporary file containing a Gabor patch. argument-list: arglist: See canvas.gabor() for a description of arguments. keyword-dict: kwdict: See canvas.gabor() for a description of keywords. returns: A path to the image file. """ from openexp._canvas import canvas as _canvas surface = _canvas._gabor(*arglist, **kwdict) fd, fname = tempfile.mkstemp(suffix=u".png") pygame.image.save(surface, fname) temp_files.append(fname) os.close(fd) return fname