Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Radial / Polar Gabor Patch
Replies: 0

 Chris Dopuch Posts: 1 Registered: 5/2/13
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));

- phase*ones(imsize) );

%cospattern = 1;

% convolve with gaussian
type = 'gaussian';
filt = fspecial(type, imsize, sigma);
filt = filt/max(max(filt));
im = cospattern .* filt;