Revision 26:b03ef38fe497 utilities/UTIL_showMAP.m
| utilities/UTIL_showMAP.m | ||
|---|---|---|
| 1 |
function UTIL_showMAP (showMapOptions) |
|
| 1 |
function UTIL_showMAP (showMapOptions, paramChanges)
|
|
| 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. |
| ... | ... | |
| 40 | 40 |
if ~isfield(showMapOptions,'fileName'),showMapOptions.fileName=[];end |
| 41 | 41 |
if ~isfield(showMapOptions,'surfSpikes'),showMapOptions.surfSpikes=0;end |
| 42 | 42 |
|
| 43 |
|
|
| 43 |
%% send all model parameters to command window |
|
| 44 | 44 |
if showMapOptions.printModelParameters |
| 45 | 45 |
% Read parameters from MAPparams<***> file in 'parameterStore' folder |
| 46 | 46 |
% and print out all parameters |
| 47 |
cmd=['MAPparams' saveMAPparamsName ... |
|
| 48 |
'(-1, 1/dt, 1);']; |
|
| 49 |
eval(cmd); |
|
| 47 |
if nargin>1 |
|
| 48 |
cmd=['MAPparams' saveMAPparamsName '(-1, 1/dt, 1, paramChanges);']; |
|
| 49 |
eval(cmd); |
|
| 50 |
else |
|
| 51 |
cmd=['MAPparams' saveMAPparamsName '(-1, 1/dt, 1);']; |
|
| 52 |
eval(cmd); |
|
| 53 |
disp(' no parameter changes found')
|
|
| 54 |
end |
|
| 50 | 55 |
end |
| 51 | 56 |
|
| 57 |
%% summarise firing rates in command window |
|
| 52 | 58 |
if showMapOptions.printFiringRates |
| 53 | 59 |
%% print summary firing rates |
| 54 | 60 |
fprintf('\n\n')
|
| ... | ... | |
| 71 | 77 |
% disp(['IC by type: ' num2str(mean(ICfiberTypeRates,2)')]) |
| 72 | 78 |
else |
| 73 | 79 |
disp(['AN: ' num2str(mean(mean(ANprobRateOutput)))]) |
| 74 |
[PSTH pointsPerBin]= UTIL_makePSTH(ANprobRateOutput, dt, 0.001);
|
|
| 80 |
PSTH= UTIL_PSTHmakerb(ANprobRateOutput, dt, 0.001);
|
|
| 75 | 81 |
disp(['max max AN: ' num2str(max(max(... |
| 76 |
PSTH/pointsPerBin )))])
|
|
| 82 |
PSTH )))]) |
|
| 77 | 83 |
end |
| 78 | 84 |
end |
| 79 | 85 |
|
| 80 | 86 |
|
| 81 |
%% figure (99) summarises main model output
|
|
| 87 |
%% figure (99): display output from all model stages
|
|
| 82 | 88 |
if showMapOptions.showModelOutput |
| 83 | 89 |
plotInstructions.figureNo=99; |
| 84 | 90 |
signalRMS=mean(savedInputSignal.^2)^0.5; |
| ... | ... | |
| 150 | 156 |
UTIL_plotMatrix(ICmembraneOutput, plotInstructions); |
| 151 | 157 |
end |
| 152 | 158 |
|
| 153 |
otherwise % probability (4-6) |
|
| 154 |
plotInstructions.displaydt=dt; |
|
| 159 |
otherwise % AN rate based on probability of firing |
|
| 160 |
PSTHbinWidth=0.001; |
|
| 161 |
PSTH= UTIL_PSTHmakerb(ANprobRateOutput, dt, PSTHbinWidth); |
|
| 162 |
plotInstructions.displaydt=PSTHbinWidth; |
|
| 155 | 163 |
plotInstructions.numPlots=2; |
| 156 | 164 |
plotInstructions.subPlotNo=2; |
| 157 | 165 |
plotInstructions.yLabel='BF'; |
| ... | ... | |
| 159 | 167 |
plotInstructions.yLabel='LSR HSR'; |
| 160 | 168 |
plotInstructions.plotDivider=1; |
| 161 | 169 |
end |
| 162 |
plotInstructions.title='AN - spike probability';
|
|
| 163 |
UTIL_plotMatrix(ANprobRateOutput, plotInstructions);
|
|
| 170 |
plotInstructions.title='AN - spike rate';
|
|
| 171 |
UTIL_plotMatrix(PSTH, plotInstructions);
|
|
| 164 | 172 |
end |
| 165 | 173 |
end |
| 166 | 174 |
|
| 167 | 175 |
if showMapOptions.surfProbability |
| 168 | 176 |
%% surface plot of probability |
| 177 |
if strcmp(saveAN_spikesOrProbability,'probability') && ... |
|
| 178 |
length(savedBFlist)>2 |
|
| 169 | 179 |
figure(97), clf |
| 170 | 180 |
% select only HSR fibers at the bottom of the matrix |
| 171 | 181 |
ANprobRateOutput= ANprobRateOutput(end-length(savedBFlist)+1:end,:); |
| ... | ... | |
| 185 | 195 |
view([-20 60]) |
| 186 | 196 |
% view([0 90]) |
| 187 | 197 |
title ([showMapOptions.fileName ': ' num2str(signalRMSdb,'% 3.0f') ' dB']) |
| 198 |
end |
|
| 188 | 199 |
end |
| 189 | 200 |
|
| 190 | 201 |
if showMapOptions.surfSpikes |
| 191 |
%% surface plot of probability
|
|
| 202 |
%% surface plot of AN spikes
|
|
| 192 | 203 |
figure(97), clf |
| 193 | 204 |
% select only HSR fibers at the bottom of the matrix |
| 194 | 205 |
ANoutput= ANoutput(end-length(savedBFlist)+1:end,:); |
| 195 |
PSTHbinWidth=0.001; % 1 ms bins
|
|
| 196 |
PSTH=UTIL_PSTHmakerb(ANoutput, ANdt, PSTHbinWidth);
|
|
| 206 |
PSTHbinWidth=0.005; % 1 ms bins
|
|
| 207 |
PSTH=UTIL_makePSTH(ANoutput, ANdt, PSTHbinWidth);
|
|
| 197 | 208 |
[nY nX]=size(PSTH); |
| 198 | 209 |
time=PSTHbinWidth*(1:nX); |
| 199 | 210 |
surf(time, savedBFlist, PSTH) |
| ... | ... | |
| 211 | 222 |
end |
| 212 | 223 |
|
| 213 | 224 |
|
| 214 |
%% plot efferent control values as dB |
|
| 225 |
%% figure(98) plot efferent control values as dB
|
|
| 215 | 226 |
if showMapOptions.showEfferent |
| 216 | 227 |
plotInstructions=[]; |
| 217 | 228 |
plotInstructions.figureNo=98; |
Also available in: Unified diff