-
Notifications
You must be signed in to change notification settings - Fork 0
/
Save_and_Plot.m
52 lines (50 loc) · 1.88 KB
/
Save_and_Plot.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
43
44
45
46
47
48
49
50
51
52
Import_FinderSpiker;
OddsMatrix=getoddmatrix(isSIGNALS,notSIGNALS);
Experiment=Experiment(Experiment~='\'); % NAMES PATCH
%% Plot Final Data
% GET Condition's Rasters & Whole RASTER
[~,Raster_Condition,RASTER_CONCAT]=SortNeuronsCondition(RASTER);
% Actual Active ROIs
TotalActiveNeurons=find(sum(RASTER_CONCAT,2)>0);
QoE=round(100*length(TotalActiveNeurons)/length(XY),2);
fprintf('Actual \nActive \nNeurons: %d %%\n',round(QoE));
% SEE RESULTS ################################################
Plot_Raster_Ensembles(RASTER_CONCAT,fs); % Clean Whole Raster
% set(gcf,'Name',['ID: ',Experiment],'NumberTitle','off')
CurrentFig=gcf;
CurrentFig.Name = ['ID: ',Experiment,' ready to Analyze'];
CurrentFig.NumberTitle='off';
Label_Condition_Raster(Names_Conditions,Raster_Condition,fs); % Labels
%% Update Data: VisualInspector,Oddsmatrix, Raster_Condition
checkname=1; oksave=false;
while checkname==1
% Get Directory
DP=pwd;
Slashes=find(DP=='\');
DefaultPath=[DP(1:Slashes(end)),'Processed Data'];
if exist(DefaultPath,'dir')==0
DefaultPath=pwd; % Current Diretory of MATLAB
end
uiwait(msgbox('Open .mat file to overwrite & update changes'))
[FileName,PathName] = uigetfile('*.mat',[' SAVE CHANGES & pick the Analysis File ',Experiment],...
'MultiSelect', 'off',DefaultPath);
% dotindex=find(FileName=='.');
if strcmp(FileName(1:end-4),Experiment)
checkname=0; oksave=true;
% SAVE DATA
save([PathName,FileName],'OddsMatrix','Raster_Condition',...
'RasterAlgorithm','RASTER_CONCAT',...
'-append');
disp([Experiment,' -> UPDATED (OddsMAtrix Data)'])
elseif FileName==0
checkname=0;
disp('....CANCELLED')
else
disp('Not the same Experiment!')
disp('Try again!')
end
end
%% Save Features Tables
if oksave
save_preocessing_intel;
end