Revision 25:d2c4c07df02c utilities/UTIL_showMAP.m
| utilities/UTIL_showMAP.m | ||
|---|---|---|
| 1 |
function UTIL_showMAP (options)
|
|
| 1 |
function UTIL_showMAP (showMapOptions)
|
|
| 2 | 2 |
% UTIL_showMAP produces summaries of the output from MAP's mmost recent run |
| 3 | 3 |
% All MAP outputs are stored in global variables and UTIL_showMAP |
| 4 | 4 |
% simply assumes that they are in place. |
| 5 | 5 |
% |
| 6 |
% options
|
|
| 7 |
% options.printModelParameters=1; % print model parameters
|
|
| 8 |
% options.showModelOutput=1; % plot all stages output
|
|
| 9 |
% options.printFiringRates=1; % mean activity at all stages
|
|
| 10 |
% options.showACF=1; % SACF (probabilities only)
|
|
| 11 |
% options.showEfferent=1; % plot of efferent activity
|
|
| 12 |
% options.surfProbability=0; % HSR (probability) surf plot
|
|
| 13 |
% options.fileName=[]; % parameter filename for plot title
|
|
| 6 |
% showMapOptions
|
|
| 7 |
% showMapOptions.printModelParameters=1; % print model parameters
|
|
| 8 |
% showMapOptions.showModelOutput=1; % plot all stages output
|
|
| 9 |
% showMapOptions.printFiringRates=1; % mean activity at all stages
|
|
| 10 |
% showMapOptions.showACF=1; % SACF (probabilities only)
|
|
| 11 |
% showMapOptions.showEfferent=1; % plot of efferent activity
|
|
| 12 |
% showMapOptions.surfProbability=0; % HSR (probability) surf plot
|
|
| 13 |
% showMapOptions.fileName=[]; % parameter filename for plot title
|
|
| 14 | 14 |
|
| 15 | 15 |
dbstop if warning |
| 16 | 16 |
|
| ... | ... | |
| 27 | 27 |
addpath ( ['..' filesep 'utilities'], ['..' filesep 'parameterStore']) |
| 28 | 28 |
|
| 29 | 29 |
if nargin<1 |
| 30 |
options=[];
|
|
| 30 |
showMapOptions=[];
|
|
| 31 | 31 |
end |
| 32 |
% defaults (plot staged outputs and print rates only) |
|
| 33 |
if ~isfield(options,'printModelParameters') |
|
| 34 |
options.printModelParameters=0; end |
|
| 35 |
if ~isfield(options,'showModelOutput'),options.showModelOutput=1;end |
|
| 36 |
if ~isfield(options,'printFiringRates'),options.printFiringRates=1;end |
|
| 37 |
if ~isfield(options,'showACF'),options.showACF=0;end |
|
| 38 |
if ~isfield(options,'showEfferent'),options.showEfferent=0;end |
|
| 39 |
if ~isfield(options,'surfProbability'),options.surfProbability=0;end |
|
| 40 |
if ~isfield(options,'fileName'),options.fileName=[];end |
|
| 32 |
% defaults (plot staged outputs and print rates only) if options omitted |
|
| 33 |
if ~isfield(showMapOptions,'printModelParameters') |
|
| 34 |
showMapOptions.printModelParameters=0; end |
|
| 35 |
if ~isfield(showMapOptions,'showModelOutput'),showMapOptions.showModelOutput=1;end |
|
| 36 |
if ~isfield(showMapOptions,'printFiringRates'),showMapOptions.printFiringRates=1;end |
|
| 37 |
if ~isfield(showMapOptions,'showACF'),showMapOptions.showACF=0;end |
|
| 38 |
if ~isfield(showMapOptions,'showEfferent'),showMapOptions.showEfferent=0;end |
|
| 39 |
if ~isfield(showMapOptions,'surfProbability'),showMapOptions.surfProbability=0;end |
|
| 40 |
if ~isfield(showMapOptions,'fileName'),showMapOptions.fileName=[];end |
|
| 41 |
if ~isfield(showMapOptions,'surfSpikes'),showMapOptions.surfSpikes=0;end |
|
| 41 | 42 |
|
| 42 | 43 |
|
| 43 |
if options.printModelParameters
|
|
| 44 |
if showMapOptions.printModelParameters
|
|
| 44 | 45 |
% Read parameters from MAPparams<***> file in 'parameterStore' folder |
| 45 | 46 |
% and print out all parameters |
| 46 | 47 |
cmd=['MAPparams' saveMAPparamsName ... |
| ... | ... | |
| 48 | 49 |
eval(cmd); |
| 49 | 50 |
end |
| 50 | 51 |
|
| 51 |
if options.printFiringRates
|
|
| 52 |
if showMapOptions.printFiringRates
|
|
| 52 | 53 |
%% print summary firing rates |
| 53 | 54 |
fprintf('\n\n')
|
| 54 | 55 |
disp('summary')
|
| ... | ... | |
| 78 | 79 |
|
| 79 | 80 |
|
| 80 | 81 |
%% figure (99) summarises main model output |
| 81 |
if options.showModelOutput
|
|
| 82 |
if showMapOptions.showModelOutput
|
|
| 82 | 83 |
plotInstructions.figureNo=99; |
| 83 | 84 |
signalRMS=mean(savedInputSignal.^2)^0.5; |
| 84 | 85 |
signalRMSdb=20*log10(signalRMS/20e-6); |
| ... | ... | |
| 163 | 164 |
end |
| 164 | 165 |
end |
| 165 | 166 |
|
| 166 |
if options.surfProbability
|
|
| 167 |
if showMapOptions.surfProbability
|
|
| 167 | 168 |
%% surface plot of probability |
| 168 | 169 |
figure(97), clf |
| 169 | 170 |
% select only HSR fibers at the bottom of the matrix |
| ... | ... | |
| 183 | 184 |
zlabel('spike rate')
|
| 184 | 185 |
view([-20 60]) |
| 185 | 186 |
% view([0 90]) |
| 186 |
title ([options.fileName ': ' num2str(signalRMSdb,'% 3.0f') ' dB'])
|
|
| 187 |
title ([showMapOptions.fileName ': ' num2str(signalRMSdb,'% 3.0f') ' dB'])
|
|
| 187 | 188 |
end |
| 188 | 189 |
|
| 190 |
if showMapOptions.surfSpikes |
|
| 191 |
%% surface plot of probability |
|
| 192 |
figure(97), clf |
|
| 193 |
% select only HSR fibers at the bottom of the matrix |
|
| 194 |
ANoutput= ANoutput(end-length(savedBFlist)+1:end,:); |
|
| 195 |
PSTHbinWidth=0.001; % 1 ms bins |
|
| 196 |
PSTH=UTIL_PSTHmakerb(ANoutput, ANdt, PSTHbinWidth); |
|
| 197 |
[nY nX]=size(PSTH); |
|
| 198 |
time=PSTHbinWidth*(1:nX); |
|
| 199 |
surf(time, savedBFlist, PSTH) |
|
| 200 |
shading interp |
|
| 201 |
set(gca, 'yScale','log') |
|
| 202 |
xlim([0 max(time)]) |
|
| 203 |
ylim([0 max(savedBFlist)]) |
|
| 204 |
% zlim([0 1000]) |
|
| 205 |
xlabel('time (s)')
|
|
| 206 |
ylabel('best frequency (Hz)')
|
|
| 207 |
zlabel('spike rate')
|
|
| 208 |
view([-20 60]) |
|
| 209 |
% view([0 90]) |
|
| 210 |
title ([showMapOptions.fileName ': ' num2str(signalRMSdb,'% 3.0f') ' dB']) |
|
| 211 |
end |
|
| 212 |
|
|
| 189 | 213 |
|
| 190 | 214 |
%% plot efferent control values as dB |
| 191 |
if options.showEfferent
|
|
| 215 |
if showMapOptions.showEfferent
|
|
| 192 | 216 |
plotInstructions=[]; |
| 193 | 217 |
plotInstructions.figureNo=98; |
| 194 | 218 |
figure(98), clf |
| ... | ... | |
| 212 | 236 |
end |
| 213 | 237 |
|
| 214 | 238 |
%% ACF plot if required |
| 215 |
if options.showACF
|
|
| 239 |
if showMapOptions.showACF
|
|
| 216 | 240 |
tic |
| 217 | 241 |
method.dt=dt; |
| 218 | 242 |
method.segmentNo=1; |
Also available in: Unified diff