Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.



Radial / Polar Gabor Patch
Posted:
May 2, 2013 3:55 PM


Dear Mathworks community,
I am very new to Matlab, and I need to create a mask for an experiment my lab is trying to run. The stimuli we are using are gabor patches arranged in a circle, pointing in various angles. The mask needs to look like a radial gabor patch with the 'lines' of the patch extending outwards in all directions.
Here's the code we use to generate the patches:
function im = generate_gabor(ort, lambda, sigma, phase)
% set image size (cut off after center +/ 3*sigma) imsize = round(5*[sigma sigma]);
% generate cosine pattern X = ones(imsize(1),1)*[(imsize(2)1)/2:1:(imsize(2)1)/2]; Y =[(imsize(1)1)/2:1:(imsize(1)1)/2]' * ones(1,imsize(2));
cospattern = cos(2.*pi.*1/lambda.* (cos(deg2rad(ort)).*X ... + sin(deg2rad(ort)).*Y) ...  phase*ones(imsize) );
%cospattern = 1;
% convolve with gaussian type = 'gaussian'; filt = fspecial(type, imsize, sigma); filt = filt/max(max(filt)); im = cospattern .* filt;
function r = deg2rad(d)
r = (d/360)*(2*pi);
Could someone please help me with this?



