For me the most intuitive way would be to replicate a 2D grayscale grating in three color channels and set the red color channel to 1.
There is an excellent tutorial how to create Gabor patches with Matlab by Elliot Freeman:
http://www.icn.ucl.ac.uk/courses/MATLAB-Tutorials/Elliot_Freeman/html/gabor_tutorial.html
With two additional lines after
grating = sin( XYf + phaseRad); % make 2D sinewave
you can create a red-white grating which should be usable for your purpose:
grating = repmat(grating / 2 + 0.5, [1 1 3]); % Scale to 0-1 and make 3D
grating(:, :, 1) = 1; % Set red color channel to 1
Adjust the gauss matrix accordingly.
Best,
Andreas
Am 28.11.2013 um 10:56 schrieb
icezland@...:
>
>
> Hi I would like some advice on creating a red-white gabber. I first created a texture of a monochrome gabor (using DriftDemo2 as reference), and then used [255 0 0] as modulateColour when drawing the texture, giving me a red-black gabor. I understand why I'm getting the black lines instead, but I'm not sure how to make the changes. I tried changing the parameters in the ProceduralGaborDemo, but still, I've only managed to get red-black gabors. Should I not be using a monochrome gabor in the first place? Or should I perhaps use a custom colourmap to change the monochrome gabor to a red-white one? Below is a snippet of the code. Any help would be much appreciated. Thanks in advance.
>
> f = 0.2; %grating cycles/pixel;
>
> fr = 2*pi*f; %frequency in radians
>
>
> angle = 45;
>
> p = ceil(1/f);
>
> gratingsize = 16;
>
> visiblesize = 2*texsize;
>
> dstRect = [0 0 visiblesize visiblesize];
>
> x = meshgrid(-texsize:texsize+p,1); %2*texsize+p columns
>
> grating = grey+inc*cos(fr*x);
>
> gratingtex = Screen('MakeTexture', wPtr, grating);
>
>
> Screen('DrawTexture', wPtr, gratingtex, [], ovalLoc(:,i), angle*orient(i), [], [], [255 0 0]);
>
>
>
>
>
>
>
>