-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplotProbeV2.m
More file actions
771 lines (629 loc) · 28.5 KB
/
plotProbeV2.m
File metadata and controls
771 lines (629 loc) · 28.5 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
function varargout = plotProbeV2(varargin)
% PLOTPROBEV2 MATLAB code for plotProbeV2.fig
% PLOTPROBEV2, by itself, creates a new PLOTPROBEV2 or raises the existing
% singleton*.
%
% H = PLOTPROBEV2 returns the handle to a new PLOTPROBEV2 or the handle to
% the existing singleton*.
%
% PLOTPROBEV2('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in PLOTPROBEV2.M with the given input arguments.
%
% PLOTPROBEV2('Property','Value',...) creates a new PLOTPROBEV2 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before plotProbeV2_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to plotProbeV2_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help plotProbeV2
% Last Modified by GUIDE v2.5 07-Dec-2021 13:26:17
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @plotProbeV2_OpeningFcn, ...
'gui_OutputFcn', @plotProbeV2_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before plotProbeV2 is made visible.
function plotProbeV2_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to plotProbeV2 (see VARARGIN)
debugFlag=0;
handles.debugFlag=debugFlag;
if debugFlag
% Homer3Path='C:\Users\oanto\Documents\MATLAB\work\BU\Homer3tucker';
% run([Homer3Path,filesep,'setpaths'])
datos=conditionData('out_hrf.mat');
else
if ~isempty(varargin)
datos=conditionData(varargin);
end
end
if exist('datos','var')
handles.data=datos;
%if data is present, send to axis to plot
if ~isempty(datos)
plotData(hObject,handles);
end
end
% Choose default command line output for plotProbeV2
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes plotProbeV2 wait for user response (see UIRESUME)
% uiwait(handles.mainFigure);
% --- Outputs from this function are returned to the command line.
function varargout = plotProbeV2_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on mouse press over axes background.
function probeAxes_ButtonDownFcn(hObject, eventdata, handles)
% hObject handle to probeAxes (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%handles.currentPoint = get(hObject,'CurrentPoint');
stimIndex=1; %<-change this to be a control reading from the available types of stims
%Identify curve parameters
HRFNum=str2num(get(eventdata.Source,'Tag')); %#ok<ST2NM>
wavelengthIndex=handles.data.averages.measurementList(HRFNum).wavelengthIndex;
dataTypeLabel=handles.data.averages.measurementList(HRFNum).dataTypeLabel;
dataType=handles.data.averages.measurementList(HRFNum).dataType;
dataTypeIndex=handles.data.averages.measurementList(HRFNum).dataTypeIndex;
sourceIndex=handles.data.averages.measurementList(HRFNum).sourceIndex;
detectorIndex=handles.data.averages.measurementList(HRFNum).detectorIndex;
rho=handles.data.rhoHRF(HRFNum);
%find the other related curves
ml=handles.data.measurementList;
relatedChannels=find(ml(:,1)==sourceIndex&ml(:,2)==detectorIndex); %thes are all same source and detector and thus same rho; indexed to the time series
%figure out which time series I'm plotting
activePlots=[handles.al1.Value||handles.al2.Value,...
handles.ml1.Value||handles.ml2.Value,...
handles.vl1.Value||handles.vl2.Value];
indiPlots=find(activePlots==1);
nsubplots=sum(activePlots);
%define time series to plot
t=handles.data.timeSeries.time;
plotBuffer=handles.data.timeSeries.dataTimeSeries(:,relatedChannels);
%plot
figure
switch handles.seriesSelector.SelectedObject.String
case 'Delta moment'
if nsubplots
for ki=1:nsubplots
subplot(nsubplots,1,ki)
switch indiPlots(ki)
case 1
scaling=1;
offset=0;
if handles.al1.Value
yyaxis left
plot(t,plotBuffer(:,1))
scaling=max(plotBuffer(:,1));
offset=mean(plotBuffer(:,1));
ylabel('Intensity \lambda_1')
hold on
end
if handles.dispStims.Value
plot(t,handles.data.stims{stimIndex}.onsets*(scaling-offset)+offset,'-k')
Ys=[zeros(2,size(handles.data.stims{stimIndex}.s1,2))+offset;...
scaling*ones(2,size(handles.data.stims{stimIndex}.s1,2))];
patch(handles.data.stims{stimIndex}.s1,Ys,[1,.6,.6])
end
if handles.al2.Value
yyaxis right
plot(t,plotBuffer(:,4))
ylabel('Intensity \lambda_2')
end
case 2
scaling=1;
offset=0;
if handles.ml1.Value
yyaxis left
plot(t,plotBuffer(:,2))
scaling=max(plotBuffer(:,2));
offset=mean(plotBuffer(:,2));
ylabel('First moment \lambda_1')
hold on
end
if handles.dispStims.Value
plot(t,handles.data.stims{stimIndex}.onsets*(scaling-offset)+offset,'-k')
Ys=[zeros(2,size(handles.data.stims{stimIndex}.s1,2))+offset;...
scaling*ones(2,size(handles.data.stims{stimIndex}.s1,2))];
patch(handles.data.stims{stimIndex}.s1,Ys,[1,.6,.6])
end
hold off
if handles.ml2.Value
yyaxis right
plot(t,plotBuffer(:,5))
ylabel('First moment \lambda_2')
end
case 3
scaling=1;
offset=0;
if handles.vl1.Value
yyaxis left
plot(t,plotBuffer(:,3))
scaling=max(plotBuffer(:,3));
offset=mean(plotBuffer(:,3));
ylabel('Variance \lambda_1')
hold on
end
if handles.dispStims.Value
plot(t,handles.data.stims{stimIndex}.onsets*(scaling-offset)+offset,'-k')
Ys=[zeros(2,size(handles.data.stims{stimIndex}.s1,2))+offset;...
scaling*ones(2,size(handles.data.stims{stimIndex}.s1,2))];
patch(handles.data.stims{stimIndex}.s1,Ys,[1,.6,.6])
end
hold off
if handles.vl2.Value
yyaxis right
plot(t,plotBuffer(:,6))
ylabel('Variance \lambda_2')
end
end
end
sgtitle(['Source ', num2str(sourceIndex),...
'. Detector ',num2str(detectorIndex),...
'. (',' \rho=',num2str(rho),')']);
xlabel('Time [s]')
else
plot(t,handles.data.timeSeries.dataTimeSeries(:,HRFNum))
xlabel('Time [s]')
ytags={'Intensity','m1','V'};
ylabel([ytags{handles.data.probe.momentOrders(dataTypeIndex)+1},...
'\lambda_',num2str(wavelengthIndex),...
' \rho=',num2str(rho)])
title(['Source ', num2str(sourceIndex),...
'. Detector ',num2str(detectorIndex),...
'.']);
end
case 'Hb time series'
case 'HRF'
end
% --------------------------------------------------------------------
function fileTag_Callback(hObject, eventdata, handles)
% hObject handle to fileTag (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function loadTag_Callback(hObject, eventdata, handles)
% hObject handle to loadTag (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% function called when loading the data
[fName,path]=uigetfile;
if ~isempty(fName)
handles.mainFigure.Name = ['plotProbeV2 - ',fName];
datos=conditionData({[path,fName]});
handles.data=datos;
%if data is present, send to axis to plot
if ~isempty(datos)
plotData(hObject,handles);
end
end
% Update handles structure
guidata(hObject, handles);
% --- Executes during object creation, after setting all properties.
function mainFigure_CreateFcn(hObject, eventdata, handles)
% hObject handle to mainFigure (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
function [outputData,params]=conditionData(inputData)
%this function will be used either to process the data received either from
%the load function or as the passed argument. It will either accept a
%filename to load, or a data structure containing the desired variables. It
%will be assumed that a string input is a filename, otherwise it will be a
%structure
%This should be able to read snirf files and not only mat files
if length(inputData)==1 %assumes it's a file name
load(inputData{1},'yavg','data','probe','stims')
datos.timeSeries=data;
datos.averages=yavg;
datos.probe=probe;
datos.stims=stims;
elseif length(inputData)>1 %assumes it's a varargin argument
%however, said varargin argument should have up to 7 entries; non
%provided arguments should be []
%[probe,stim,HRFdod,HRFconc,dod,conc,Intensity]
%dod is implicitly permitted to be delta of a moment of higher order;
%Intensity is implicitly permitted to be a moment of higher order
datos.probe=inputData{1};
datos.stims=inputData{2};
flagConc=0;
flagDod=0;
try
datos.averages=inputData{3};
flagDod=1; %flag indicating what type of data was loaded
catch
datos.averages=inputData{4};
flagConc=1;
end
%for now ignore HRF in conc space if it's present in dod space; at some
%point it should do different things if we provide both
flagTimeSeries=0; %if this is zero, disable clicking on curves
if flagDod
try
datos.timeSeries=inputData{5};
flagTimeSeries=1;
end
elseif flagConc%for now, assume only one or the other is active
try
datos.timeSeries=inputData{6};
flagTimeSeries=1;
end
else
%if neither is present,try to use intensity data
try
datos.timeSeries=inputData{7};
flagTimeSeries=1;
end
end
end
%do some data and variable validation. I basically need to find if the data
%is TD fNIRS or regular. Also, find what fields are included so options can
%be enabled in the GUI
%preprocess stuff
stimClassNumber=length(datos.stims);
stims=cell(1,stimClassNumber);
stimNames=cell(1,stimClassNumber);
tt=datos.timeSeries.time;
%make stimulus time series
for kii=1:stimClassNumber
onsets=zeros(size(tt)); %stimulus onsets
s1=zeros(4,size(datos.stims(kii).data,1)); %used for creating patches
for ki=1:size(datos.stims(kii).data,1)
sIdx=find(tt>=datos.stims.data(ki,1)&tt<=datos.stims.data(ki,1)+datos.stims.data(ki,2));
onsets(sIdx(1))=1;
s1(:,ki)=[tt(sIdx(1));tt(sIdx(end));tt(sIdx(end));tt(sIdx(1))];
end
stims{kii}.onsets=onsets;
stims{kii}.s1=s1;
stims{kii}.name=datos.stims(kii).name;
stimNames{kii}=datos.stims(kii).name;
end
datos.stims=stims;
[ml,rho] = getMeasurementListArray(datos.timeSeries,datos.probe);
datos.measurementList=ml;
[ml,rho] = getMeasurementListArray(datos.averages,datos.probe);
datos.measurementListHRF=ml;
datos.rhoHRF=rho;
%output a structure indicating what things will be enabled or
%disabled based on the data available. Not sure if it's better to send the
%handles structure to this function directly or make the function caller do
%the GUI adaptation
params.stims.number=stimClassNumber;
params.stims.names=stimNames;
outputData=datos;
function plotData(hObject,handles)
%data types at https://github.com/fNIRS/snirf/blob/master/snirf_specification.md
probe= handles.data.probe;
yavg=handles.data.averages;
rhoRange=[str2double(handles.loLimrho.String) str2double(handles.hiLimrho.String)];
fig =handles.probeAxes;
buttonPressFuncHandle=@(hObject,eventdata)plotProbeV2('probeAxes_ButtonDownFcn',hObject,eventdata,guidata(hObject));
cla(fig)
if isempty(rhoRange)||~handles.filterDistances.Value
rhoMin = 0;
rhoMax = 100;
else
rhoMin = rhoRange(1);
if length(rhoRange>=2)
rhoMax = rhoRange(2);
else
rhoMax = 100;
end
end
% Get output from BasicProcSteam.m
measurementList = yavg.measurementList;
dAvg = yavg.dataTimeSeries;
tHRF = yavg.time;
% create the ml matrix and get source detector separation (SDS) for each channel
nMeas = length(measurementList);
mlHRF = zeros(nMeas,4);
rhoHRF = zeros(nMeas,1);
pCH = zeros(nMeas,2);
for iM = 1:nMeas
mlHRF(iM,1) = measurementList(iM).sourceIndex;
mlHRF(iM,2) = measurementList(iM).detectorIndex;
mlHRF(iM,4) = measurementList(iM).wavelengthIndex;
switch measurementList(iM).dataTypeLabel
case 'HRF HbO'
mlHRF(iM,3) = 1;
case 'HRF HbR'
mlHRF(iM,3) = 2;
case 'HRF HbT'
mlHRF(iM,3) = 3;
case 'HRF dOD'
mlHRF(iM,3) = 1;
case 'HRF dMTF'
mlHRF(iM,3) = 2;
case 'HRF dVar'
mlHRF(iM,3) = 3;
end
ps = probe.sourcePos3D( mlHRF(iM,1), : );
pd = probe.detectorPos3D( mlHRF(iM,2), : );
rhoHRF(iM) = norm( ps-pd);
pCH(iM,:) = (probe.sourcePos2D( mlHRF(iM,1), 1:2 ) + probe.detectorPos2D( mlHRF(iM,2), 1:2 )) / 2;
end
% plot HRFs in probe arrangement
lstKeep1 = find(rhoHRF>=rhoMin & rhoHRF<=rhoMax & mlHRF(:,3)==1 );
lstKeep2 = find(rhoHRF>=rhoMin & rhoHRF<=rhoMax & mlHRF(:,3)==2 );
lstKeep3 = find(rhoHRF>=rhoMin & rhoHRF<=rhoMax & mlHRF(:,3)==3 );
lstKeep1a = find(rhoHRF>=rhoMin & rhoHRF<=rhoMax & mlHRF(:,3)==1 & mlHRF(:,4)==1 );
lstKeep2a = find(rhoHRF>=rhoMin & rhoHRF<=rhoMax & mlHRF(:,3)==2 & mlHRF(:,4)==1 );
lstKeep3a = find(rhoHRF>=rhoMin & rhoHRF<=rhoMax & mlHRF(:,3)==3 & mlHRF(:,4)==1 );
lstKeep1b = find(rhoHRF>=rhoMin & rhoHRF<=rhoMax & mlHRF(:,3)==1 & mlHRF(:,4)==2 );
lstKeep2b = find(rhoHRF>=rhoMin & rhoHRF<=rhoMax & mlHRF(:,3)==2 & mlHRF(:,4)==2 );
lstKeep3b = find(rhoHRF>=rhoMin & rhoHRF<=rhoMax & mlHRF(:,3)==3 & mlHRF(:,4)==2 );
% d1 = dAvg(:,lstKeep1);
% d2 = dAvg(:,lstKeep2);
% d3 = dAvg(:,lstKeep3);
d1a = dAvg(:,lstKeep1a);
d2a = dAvg(:,lstKeep2a);
d3a = dAvg(:,lstKeep3a);
d1b = dAvg(:,lstKeep1b);
d2b = dAvg(:,lstKeep2b);
d3b = dAvg(:,lstKeep3b);
ax=fig;
hp=plot(ax, probe.sourcePos2D(mlHRF(lstKeep1,1),1), probe.sourcePos2D(mlHRF(lstKeep1,1),2), 'r.' );
set(hp,'color',[1 0.5 0.5])
set(hp,'markersize',8)
set(hp,'ButtonDownFcn',buttonPressFuncHandle);
hold on
hp=plot(ax, probe.detectorPos2D(mlHRF(lstKeep1,2),1), probe.detectorPos2D(mlHRF(lstKeep1,2),2), 'b.' );
set(hp,'color',[0.5 0.5 1])
set(hp,'markersize',8)
set(hp,'ButtonDownFcn',buttonPressFuncHandle);
%plot( pCH(lstKeep1,1), pCH(lstKeep1,2), 'go' )
xx = ((tHRF - min(tHRF)) / (max(tHRF) - min(tHRF)) - 0.5) * 0.05;
yy = dAvg(:,lstKeep1);
yy(:,:,2) = dAvg(:,lstKeep2);
yy(:,:,3) = dAvg(:,lstKeep3);
if 0
minyy = min(yy(:));
maxyy = max(yy(:));
yy1 = ((yy(:,:,1)) / (maxyy-minyy)) * 0.05 * str2double(handles.edit3.String);
yy2 = ((yy(:,:,2)) / (maxyy-minyy)) * 0.05 * str2double(handles.edit3.String);
yy3 = ((yy(:,:,3)) / (maxyy-minyy)) * 0.05 * str2double(handles.edit3.String);
for iM = 1:length(lstKeep1)
h=plot(ax, xx+pCH(lstKeep1(iM),1), yy1(:,iM)+pCH(lstKeep1(iM),2), 'r-');
set(h,'ButtonDownFcn',buttonPressFuncHandle);
set(h,'Tag',num2str(lstKeep1(iM)));
end
for iM = 1:length(lstKeep2)
h=plot(ax, xx+pCH(lstKeep2(iM),1), yy2(:,iM)+pCH(lstKeep2(iM),2), 'b-');
set(h,'ButtonDownFcn',buttonPressFuncHandle);
set(h,'Tag',num2str(lstKeep2(iM)));
end
for iM = 1:length(lstKeep3)
h=plot(ax, xx+pCH(lstKeep3(iM),1), yy3(:,iM)+pCH(lstKeep3(iM),2), 'c-');
set(h,'ButtonDownFcn',buttonPressFuncHandle);
set(h,'Tag',num2str(lstKeep3(iM)));
end
else
minyy = min(min(d1a));
maxyy = max(max(d1a));
yy1 = ((d1a) / (maxyy-minyy)) * 0.05 * str2double(handles.edit3.String);
for iM = 1:length(lstKeep1a)
h=plot(ax, xx+pCH(lstKeep1a(iM),1), yy1(:,iM)+pCH(lstKeep1a(iM),2), 'r-.');
set(h,'ButtonDownFcn',buttonPressFuncHandle);
set(h,'Tag',num2str(lstKeep1a(iM)));
end
minyy = min(min(d1b));
maxyy = max(max(d1b));
yy1 = ((d1b) / (maxyy-minyy)) * 0.05 * str2double(handles.edit3.String);
for iM = 1:length(lstKeep1b)
h=plot(ax, xx+pCH(lstKeep1b(iM),1), yy1(:,iM)+pCH(lstKeep1b(iM),2), 'r-');
set(h,'ButtonDownFcn',buttonPressFuncHandle);
set(h,'Tag',num2str(lstKeep1b(iM)));
end
minyy = min(min(d2a));
maxyy = max(max(d2a));
yy1 = ((d2a) / (maxyy-minyy)) * 0.05 * str2double(handles.edit3.String);
for iM = 1:length(lstKeep2a)
h=plot(ax, xx+pCH(lstKeep2a(iM),1), yy1(:,iM)+pCH(lstKeep2a(iM),2), 'b-.');
set(h,'ButtonDownFcn',buttonPressFuncHandle);
set(h,'Tag',num2str(lstKeep2a(iM)));
end
minyy = min(min(d2b));
maxyy = max(max(d2b));
yy1 = ((d2b) / (maxyy-minyy)) * 0.05 * str2double(handles.edit3.String);
for iM = 1:length(lstKeep2b)
h=plot(ax, xx+pCH(lstKeep2b(iM),1), yy1(:,iM)+pCH(lstKeep2b(iM),2), 'b-');
set(h,'ButtonDownFcn',buttonPressFuncHandle);
set(h,'Tag',num2str(lstKeep2b(iM)));
end
minyy = min(min(d3a));
maxyy = max(max(d3a));
yy1 = ((d3a) / (maxyy-minyy)) * 0.05 * str2double(handles.edit3.String);
for iM = 1:length(lstKeep3a)
h=plot(ax, xx+pCH(lstKeep3a(iM),1), yy1(:,iM)+pCH(lstKeep3a(iM),2), 'c-.');
set(h,'ButtonDownFcn',buttonPressFuncHandle);
set(h,'Tag',num2str(lstKeep3a(iM)));
end
minyy = min(min(d3b));
maxyy = max(max(d3b));
yy1 = ((d3b) / (maxyy-minyy)) * 0.05 * str2double(handles.edit3.String);
for iM = 1:length(lstKeep3b)
h=plot(ax, xx+pCH(lstKeep3b(iM),1), yy1(:,iM)+pCH(lstKeep3b(iM),2), 'c-');
set(h,'ButtonDownFcn',buttonPressFuncHandle);
set(h,'Tag',num2str(lstKeep3b(iM)));
end
end
axis(ax,'image')
% Update handles structure
guidata(hObject, handles);
function hiLimrho_Callback(hObject, eventdata, handles)
% hObject handle to hiLimrho (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of hiLimrho as text
% str2double(get(hObject,'String')) returns contents of hiLimrho as a double
plotData(hObject,handles)
% --- Executes during object creation, after setting all properties.
function hiLimrho_CreateFcn(hObject, eventdata, handles)
% hObject handle to hiLimrho (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function loLimrho_Callback(hObject, eventdata, handles)
% hObject handle to loLimrho (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of loLimrho as text
% str2double(get(hObject,'String')) returns contents of loLimrho as a double
plotData(hObject,handles)
% --- Executes during object creation, after setting all properties.
function loLimrho_CreateFcn(hObject, eventdata, handles)
% hObject handle to loLimrho (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in filterDistances.
function filterDistances_Callback(hObject, eventdata, handles)
% hObject handle to filterDistances (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of filterDistances
plotData(hObject,handles)
% --- Executes on button press in debug.
function debug_Callback(hObject, eventdata, handles)
% hObject handle to debug (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
disp('debug!')
% --- Executes during object creation, after setting all properties.
function axes3_CreateFcn(hObject, eventdata, handles)
% hObject handle to axes3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: place code in OpeningFcn to populate axes3
% --- Executes on mouse press over axes background.
function axes3_ButtonDownFcn(hObject, eventdata, handles)
% hObject handle to axes3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes during object creation, after setting all properties.
function probeAxes_CreateFcn(hObject, eventdata, handles)
% hObject handle to probeAxes (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: place code in OpeningFcn to populate probeAxes
% --- Executes during object deletion, before destroying properties.
function probeAxes_DeleteFcn(hObject, eventdata, handles)
% hObject handle to probeAxes (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in radiobutton1.
function radiobutton1_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton1
% --- Executes on button press in radiobutton2.
function radiobutton2_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton2
% --- Executes on button press in radiobutton3.
function radiobutton3_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton3
% --- Executes on button press in al1.
function al1_Callback(hObject, eventdata, handles)
% hObject handle to al1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of al1
% --- Executes on button press in ml1.
function ml1_Callback(hObject, eventdata, handles)
% hObject handle to ml1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of ml1
% --- Executes on button press in vl1.
function vl1_Callback(hObject, eventdata, handles)
% hObject handle to vl1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of vl1
% --- Executes on button press in al2.
function al2_Callback(hObject, eventdata, handles)
% hObject handle to al2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of al2
% --- Executes on button press in ml2.
function ml2_Callback(hObject, eventdata, handles)
% hObject handle to ml2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of ml2
% --- Executes on button press in vl2.
function vl2_Callback(hObject, eventdata, handles)
% hObject handle to vl2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of vl2
% --- Executes on button press in dispStims.
function dispStims_Callback(hObject, eventdata, handles)
% hObject handle to dispStims (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of dispStims
% --- Executes on button press in checkbox9.
function checkbox9_Callback(hObject, eventdata, handles)
% hObject handle to checkbox9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of checkbox9
function edit3_Callback(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit3 as text
% str2double(get(hObject,'String')) returns contents of edit3 as a double
%plot data with the new scale
plotData(hObject,handles)
% --- Executes during object creation, after setting all properties.
function edit3_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end