-
Notifications
You must be signed in to change notification settings - Fork 0
/
motionBlurSVM_new.m
42 lines (41 loc) · 2.29 KB
/
motionBlurSVM_new.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
%% load parameters
stimParams = struct(...
'spatialFrequencyCyclesPerDeg', 10, ...
'orientationDegs', 90, ...
'phaseDegs', 90, ...
'sizeDegs', 0.5, ...
'sigmaDegs', 0.25/3, ...
'contrast', 100/100,...
'meanLuminanceCdPerM2', 15, ...
'center', [0 0], ...
'pixelsAlongWidthDim', [], ...
'pixelsAlongHeightDim', [] ...
);
integrationTime = 15;
theMosaic = cMosaic('sizeDegs', [1, 1] * stimParams.sizeDegs, ...
'integrationTime', integrationTime / 1000);
%% excitation
% null_responses = computeConeResponseforSVM(stimParams, theMosaic, 'null', 'visualize', 'all'); % don't need to reset the contrast
% % case 1: no change
test_responses_1 = computeConeResponseforSVM(stimParams, theMosaic, 'test', 'visualize', 'excitation', 'responseFlag', 'excitation'); % 'contrast', 0,
% test_responses_1 = computeConeResponseforSVM(stimParams, theMosaic, 'test', 'center', [0 0], 'visualize', 'all');
% test_responses_2 = computeConeResponseforSVM(stimParams, theMosaic, 'test', 'center', [0 10], 'visualize', 'all');
% test_responses_3 = computeConeResponseforSVM(stimParams, theMosaic,'test', 'visualize', 'all'); % 'center', [0 0],
%% get threshold
[threshold, curvefit, gof, case3_excitation_0_1_24, case3_excitation_org_0_1_24] = getThresholdSVM(stimParams, theMosaic, 'excitation', ...
'min', 0, 'nstep', 1, 'max', 24, ...
'visualize', 'true', 'nTrials', 100, ...
'showResult', 'true','center',[0 20]);
%% visualize
x = [0:1:24];
y = [case2_photocurrent_0_1_40 case2_photocurrent_41_1_60];
[curvefit, gof] = fitPsychometric(x,case3_photocurrent_0_1_24);
%% try
% visualizeResponseOverTime(test_responses_1, 'excitation');
% visualizeAllResponses(null_responses, 'targetCone',1951,'excitationScale', [0 50], 'photocurrentScale', [0 300]);
visualizeAllResponses(test_responses_3, 'targetCone',1923, 'excitationScale', [0 50], 'photocurrentScale', [0 300]);
% visualizeResponseOverTime(test_responses_1, 'excitation', 'targetCone', 200);
% % case 2: shift down 1/2 cycle
% test_responses_2 = computeConeResponseforSVM(stimParams, 'test', 'center', [0 10]);
% % case 3: shift down 1 cycle
% test_responses_3 = computeConeResponseforSVM(stimParams, 'test', 'center', [0 20]);