Skip to content

Commit 6d4195d

Browse files
committed
added more realtime plots like hit rate and stim distribution in ArpitSoundCatContniuous
1 parent 6fbc526 commit 6d4195d

File tree

8 files changed

+2361
-405
lines changed

8 files changed

+2361
-405
lines changed

Protocols/@ArpitSoundCatContinuous/ArpitSoundCatContinuous.m

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@
6767
DeclareGlobals(obj, 'ro_args', {'stimulus_distribution_history'});
6868
SoloFunctionAddVars('StimulusSection', 'rw_args', 'stimulus_distribution_history');
6969

70+
SoloParamHandle(obj, 'stimulus_left_distribution_history', 'value', cell(0));
71+
DeclareGlobals(obj, 'ro_args', {'stimulus_left_distribution_history'});
72+
SoloFunctionAddVars('StimulusSection', 'rw_args', 'stimulus_left_distribution_history');
73+
74+
SoloParamHandle(obj, 'stimulus_right_distribution_history', 'value', cell(0));
75+
DeclareGlobals(obj, 'ro_args', {'stimulus_right_distribution_history'});
76+
SoloFunctionAddVars('StimulusSection', 'rw_args', 'stimulus_right_distribution_history');
77+
7078
SoloParamHandle(obj, 'violation_history', 'value', []);
7179
DeclareGlobals(obj, 'ro_args', {'violation_history'});
7280
SoloFunctionAddVars('SideSection', 'rw_args', 'violation_history');
@@ -226,7 +234,7 @@
226234
SessionDefinition(obj, 'run_eod_logic_without_saving');
227235

228236
% Sending Summary Statistics to SQL Database
229-
perf = PsychometricSection(obj, 'evaluate');
237+
% perf = PsychometricSection(obj, 'evaluate');
230238

231239
% SoundCatContextSwitchSummary(obj,'protocol_data',perf);
232240

Protocols/@ArpitSoundCatContinuous/PsychometricSection.asv

Lines changed: 405 additions & 0 deletions
Large diffs are not rendered by default.

Protocols/@ArpitSoundCatContinuous/PsychometricSection.m

Lines changed: 257 additions & 400 deletions
Large diffs are not rendered by default.

Protocols/@ArpitSoundCatContinuous/StimulusSection.asv

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ switch action
204204
x=oldx; y=oldy;
205205
figure(parentfig);
206206

207-
SoloFunctionAddVars('PsychometricSection', 'ro_args',{'Category_Dist';'Rule';'boundary'});
207+
SoloFunctionAddVars('PsychometricSection', 'ro_args',{'Category_Dist';'Rule';'boundary';'Prob_Dist_Right';'Prob_Dist_Left'});
208208

209209
varargout{1} = x;
210210
varargout{2} = y;
@@ -256,8 +256,8 @@ switch action
256256

257257
if value(StimulusShow) == 1 % only run if the figure window is open
258258

259-
stim_values = value(stimulus_history);
260-
stim_present = stim_values(end);
259+
stim_values = value(thisstimlog);
260+
stim_present = stim_values(n_done_trials);
261261
stim_history = stim_values(1:end-1);
262262

263263
% figure out if legends,present stim and histogram to be plotted or not
@@ -287,6 +287,8 @@ switch action
287287
'plot_legend',legend_draw...
288288
);
289289
plot_h.value = handle_h;
290+
drawnow;
291+
pause(0.01);
290292
end
291293

292294
end
@@ -312,7 +314,7 @@ switch action
312314
% Changing animals side reference to stimuli reference depending upon Rule
313315
% Even the setting in StimulusSection is based upon side not on the
314316
% basis of whether left or right of boundary
315-
317+
316318
if strcmp(Rule,'S1>S_boundary Left') % side left is right to stim boundary
317319
if strcmpi(ThisTrial, 'LEFT')
318320
stim_side = 'right';
@@ -777,6 +779,8 @@ switch action
777779
case 'update_stimulus_history'
778780
ps=value(stimulus_history);
779781
ps1 = value(stimulus_distribution_history);
782+
ps2 = value(stimulus_right_distribution_history);
783+
ps3 = value(stimulus_left_distribution_history);
780784
ps(n_done_trials)=value(thisstimlog(n_done_trials));
781785
ps1{n_done_trials}=value(Category_Dist);
782786
stimulus_history.value=ps;

Protocols/@ArpitSoundCatContinuous/StimulusSection.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,10 +779,18 @@
779779
case 'update_stimulus_history'
780780
ps=value(stimulus_history);
781781
ps1 = value(stimulus_distribution_history);
782+
ps2 = value(stimulus_right_distribution_history);
783+
ps3 = value(stimulus_left_distribution_history);
784+
782785
ps(n_done_trials)=value(thisstimlog(n_done_trials));
783786
ps1{n_done_trials}=value(Category_Dist);
787+
ps2{n_done_trials}=value(Prob_Dist_Right);
788+
ps3{n_done_trials}=value(Prob_Dist_Left);
789+
784790
stimulus_history.value=ps;
785791
stimulus_distribution_history.value = ps1;
792+
stimulus_right_distribution_history.value = ps2;
793+
stimulus_left_distribution_history.value = ps3;
786794

787795
%% Case hide
788796
case 'hide'

Protocols/@ArpitSoundCatContinuous/private/CreateSamples_from_Distribution.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
% CreateSamples_from_Distribution
44
%
5+
% This function is specifically called within StimulusSection to perform
6+
% the actions
7+
58
% This function generates random samples from a customizable bimodal
69
% distribution and can optionally plot the distribution, a history histogram,
710
% and dynamic current picks.

Protocols/@ArpitSoundCatContinuous/private/RealTimeAnalysis.asv

Lines changed: 768 additions & 0 deletions
Large diffs are not rendered by default.

Protocols/@ArpitSoundCatContinuous/private/RealTimeAnalysis.m

Lines changed: 903 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)