fiveKxyz = [0.9803 1.0000 0.8603]; % 5000K white point
truth = zeros(72,88,3);
mask = zeros(72,88);
mask(32:41, 40:49) = 1;

for f=1:10,
    for a=0:10:90,
        f
        a
        p.freq = f; p.contrast = 1; p.ph = 0;
         p.ang= a*pi/180; p.row = 64; p.col = 64; p.GaborFlag=0;
         [scene,p] = sceneCreate('harmonic',p);

        scene = sceneSet(scene,'fov',0.5);

        vcAddAndSelectObject(scene);
        %sceneWindow

        oi = oiCreate('default');
        oi = oiCompute(scene,oi);

        vcReplaceAndSelectObject(oi);
        %oiWindow;

        sensor = sensorCreate;
        sensor = sensorCompute(sensor, oi);

        vcReplaceAndSelectObject(sensor);
        %sensorImageWindow

        vci = vcImageCreate;
        vci = imageSet(vci, 'colorbalancemethod','gray world');
        vci = imageSet(vci,'colorconversionmethod','MCC optimized');
        vci = imageSet(vci,'demosaicmethod', 'adaptive laplacian');
        vci = imageSet(vci,'internalcolorspace', 'XYZ');
        vci = vcimageCompute(vci, sensor);
        vcReplaceAndSelectObject(vci);
        %vcimageWindow
        
        xyz = imageGet(vci,'dataXYZ');
        whitePt1 = imageGet(vci,'displaywhitepoint');
        srgb = xyz2srgb(xyz);
        
        figure(1)
        imshow(srgb./255);
        
        
        pause;
    end
end
