Пример #1
0
	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))
Пример #2
0
	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))
Пример #3
0
    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))
Пример #4
0
	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)
Пример #5
0
	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()
Пример #6
0
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
Пример #7
0
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
Пример #8
0
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
Пример #9
0
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