-
Notifications
You must be signed in to change notification settings - Fork 1
/
vesSegment.m
6113 lines (5466 loc) · 258 KB
/
vesSegment.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
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
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
function varargout = vesSegment(varargin)
% VESSEGMENT MATLAB code for vesSegment.fig
% VESSEGMENT, by itself, creates a new VESSEGMENT or raises the existing
% singleton*.
%
% H = VESSEGMENT returns the handle to a new VESSEGMENT or the handle
% tov
% the existing singleton*.
%
% VESSEGMENT('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in VESSEGMENT.M with the given input arguments.
%
% VESSEGMENT('Property','Value',...) creates a new VESSEGMENT or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before vesSegment_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to vesSegment_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 vesSegment
% Last Modified by GUIDE v2.5 09-Jan-2019 01:02:12
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @vesSegment_OpeningFcn, ...
'gui_OutputFcn', @vesSegment_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 vesSegment is made visible.
function vesSegment_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 vesSegment (see VARARGIN)
% Choose default command line output for vesSegment
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
global Data
if exist('Data','var')
if isfield(Data,'Graph')
Data = rmfield(Data,'Graph');
end
end
% --- Outputs from this function are returned to the command line.
function varargout = vesSegment_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;
% --------------------------------------------------------------------
function Untiltled_Callback(hObject, eventdata, handles)
% hObject handle to Untiltled (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function File_loaddata_Callback(hObject, eventdata, handles)
% hObject handle to File_loaddata (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global Data
% clear Data strutre
if exist('Data','var')
if isstruct(Data)
names = fieldnames(Data);
Data = rmfield(Data,names);
end
end
[filename,pathname] = uigetfile({'*.mat;*.tiff;*.tif'},'Please select the Angiogram Data');
h = waitbar(0,'Please wait... loading the data');
[~,~,ext] = fileparts(filename);
if strcmp(ext,'.mat')
load([pathname filename]);
if exist('Output','var')
if isfield(Data,'angio')
if ~strcmp(Data.rawdatapath,Output.rawdatapath)
error('Output raw data path and currently loaded raw data path did not match');
end
else
[~,~,ext] = fileparts(Output.rawdatapath);
if strcmp(ext,'.mat')
if ~exist(Output.rawdatapath,'file')
error('Raw data was moved from Original location');
end
temp = load(Output.rawdatapath);
fn = fieldnames(temp);
Data.angio = temp.(fn{1});
elseif strcmp(ext,'.tiff') || strcmp(ext,'.tif')
info = imfinfo(Output.rawdatapath);
for u = 1:length(info)
if u == 1
temp = imread(Output.rawdatapath,1);
angio = zeros([length(info) size(temp)]);
angio(u,:,:) = temp;
else
angio(u,:,:) = imread(Output.rawdatapath,u);
end
end
Data.angio = angio;
end
Data.rawdatapath = Output.rawdatapath;
end
if isfield(Output,'angioVolume')
Data.angioVolume = double(Output.angioVolume);
end
if isfield(Output,'procSteps')
Data.procSteps = Output.procSteps;
end
if isfield(Output,'angioF')
Data.angioF = Output.angioF;
end
if isfield(Output,'angioT')
Data.angioT = Output.angioT;
end
if isfield(Output,'segangio')
Data.segangio = Output.segangio;
end
if isfield(Output,'fv')
Data.fv = Output.fv;
end
if isfield(Output,'Graph')
Data.Graph = Output.Graph;
set(handles.checkboxDisplayGraph,'enable','on')
end
if isfield(Output,'notes')
Data.notes = Output.notes;
end
else
temp = load([pathname filename]);
fn = fieldnames(temp);
Data.angio = temp.(fn{1});
Data.rawdatapath = [pathname filename];
end
elseif strcmp(ext,'.tiff') || strcmp(ext,'.tif')
info = imfinfo([pathname filename]);
for u = 1:length(info)
if u == 1
temp = imread([pathname filename],1);
angio = zeros([length(info) size(temp)]);
angio(u,:,:) = temp;
else
angio(u,:,:) = imread([pathname filename],u);
end
end
Data.angio = angio;
Data.rawdatapath = [pathname filename];
end
maxI = max(Data.angio(:));
minI = min(Data.angio(:));
set(handles.edit_maxI,'String',num2str(maxI));
set(handles.edit_minI,'String',num2str(minI));
[z,x,y] = size(Data.angio);
set(handles.edit_Zstartframe,'String',num2str(1));
set(handles.edit_ZMIP,'String',num2str(z));
% set(handles.edit_XcenterZoom,'String',num2str(1));
% set(handles.edit_XwidthZoom,'String',num2str(x));
% set(handles.edit_YcenterZoom,'String',num2str(1));
% set(handles.edit_YwidthZoom,'String',num2str(y));
set(handles.edit_XcenterZoom,'String',num2str(mean([1 size(Data.angio,2)-1])))
set(handles.edit_YcenterZoom,'String',num2str(mean([1 size(Data.angio,3)-1])))
set(handles.edit_XwidthZoom,'String',num2str(size(Data.angio,2)));
set(handles.edit_YwidthZoom,'String',num2str(size(Data.angio,2)));
% set(handles.edit_imageInfo,'String','Image info');
% set(handles.edit_imageInfo,'String',[num2str(x) 'X' num2str(y) 'X' num2str(z)]);
str = sprintf('%s\n%s','Image info',[num2str(x) 'X' num2str(y) 'X' num2str(z)]);
set(handles.edit_imageInfo,'String',str);
Data.ZoomXrange = [1 size(Data.angio,2)];
Data.ZoomYrange = [1 size(Data.angio,3)];
waitbar(1);
close(h);
draw(hObject, eventdata, handles);
function draw(hObject, eventdata, handles)
global Data
%%%% Select the data to display(raw dta, filter data, etc...)
if (isfield(Data,'angioF') || isfield(Data,'angioT')) && (get(handles.checkbox_showFiltData,'Value') == 1)
if isfield(Data,'angioT')
I = Data.angioT;
else
I = Data.angioF;
end
elseif isfield(Data,'segangio') && (get(handles.checkbox_showFiltData,'Value') == 0) && (get(handles.checkbox_showRawData,'Value') == 0) && (get(handles.checkbox_showSeg,'Value') == 1)
I = Data.segangio;
else
I = Data.angio;
end
[Sz,Sy,Sx] = size(I);
%%%% Read display range
Zstartframe = str2double(get(handles.edit_Zstartframe,'String'));
Zstartframe = min(max(Zstartframe,1),Sz);
ZMIP = str2double(get(handles.edit_ZMIP,'String'));
Zendframe = min(max(Zstartframe+ZMIP-1,1),Sz);
Xstartframe = str2double(get(handles.edit_XcenterZoom,'String'));
XMIP = str2double(get(handles.edit_XwidthZoom,'String'));
Xstartframe = min(max(Xstartframe-XMIP/2,1),Sx);
Xendframe = min(max(Xstartframe+XMIP,1),Sx);
Ystartframe = str2double(get(handles.edit_YcenterZoom,'String'));
YMIP = str2double(get(handles.edit_YwidthZoom,'String'));
Ystartframe = min(max(Ystartframe-YMIP/2,1),Sy);
Yendframe = min(max(Ystartframe+YMIP,1),Sy);
Data.ZoomXrange = [Xstartframe Xendframe];
Data.ZoomYrange = [Ystartframe Yendframe];
Data.ZoomZrange = [Zstartframe Zendframe];
Zimg = squeeze(max(I(Zstartframe:Zendframe,:,:),[],1));
ZimgXZ = squeeze(max(I(:,Ystartframe:Yendframe,:),[],2));
ZimgYZ = squeeze(max(I(:,:,Xstartframe:Xendframe),[],3));
%Ximg = squeeze(max(I(:,Xstartframe:Xendframe,:),[],2));
%Yimg = squeeze(max(I(:,:,Ystartframe:Yendframe),[],3));
%ZMIPimg = squeeze(max(I,[],1));
if isfield(Data,'segangio') && (get(handles.checkbox_showSeg,'Value') == 1)
ZimgS = squeeze(max(Data.segangio(Zstartframe:Zendframe,:,:),[],1));
% XimgS = squeeze(max(Data.segangio(:,Xstartframe:Xendframe,:),[],2));
% YimgS = squeeze(max(Data.segangio(:,:,Ystartframe:Yendframe),[],3));
% imgS = squeeze(max(Data.segangio,[],1));
end
axes(handles.axes1)
if 1
cmap(254,:) = [1 0 1];
cmap(255,:) = [0 1 0];
cmap(252,:) = [1 0 1];
cmap(253,:) = [0 1 0];
cmap(251,:) = [1 1 0];
else
cmap(254,:) = [1 0 1];
cmap(255,:) = [0 1 0];
cmap(252,:) = [1 1 0];
cmap(253,:) = [1 1 1];
end
if get(handles.checkbox_verifySegments,'Value') && (isfield(Data,'Graph') && isfield(Data.Graph,'segInfo'))
set(handles.text_segNumber,'String','segment');
set(handles.edit_segmentNumber,'String',num2str(Data.Graph.segno));
set(handles.text_segNumber2,'String',[' of ' num2str(size(Data.Graph.segInfo.segPos,1))]);
if strcmp(get(handles.Groups_All,'checked'),'off')
if strcmp(get(handles.verification_allSegments,'checked'),'on')
idx = find(Data.Graph.segInfo.segmentsGrpOrder(:,1) == Data.Graph.segno);
group_no = Data.Graph.segInfo.segmentsGrpOrder(idx,2);
set(handles.text_segNumber,'String','segment');
set(handles.edit_segmentNumber,'String',num2str(Data.Graph.segno));
set(handles.text_segNumber2,'String',[' of ' num2str(size(Data.Graph.segInfo.segPos,1)) ' (Group-' num2str(group_no) ')']);
elseif strcmp(get(handles.unverified,'checked'),'on')
idx = find(Data.Graph.segInfo.segmentsUnverifiedGrpOrder(:,1) == Data.Graph.segno);
group_no = Data.Graph.segInfo.segmentsUnverifiedGrpOrder(idx,2);
set(handles.text_segNumber,'String','segment');
set(handles.edit_segmentNumber,'String',num2str(Data.Graph.segno));
set(handles.text_segNumber2,'String',[' of ' num2str(size(Data.Graph.segInfo.segPos,1)) ' (Group-' num2str(group_no) ' & ' num2str(idx) ' of ' num2str(length(Data.Graph.segInfo.segmentsUnverifiedGrpOrder)) ')']);
end
else
if strcmp(get(handles.AllSegments_All,'checked'),'on')
if strcmp(get(handles.AllSegments_endSegments,'Checked'),'on')
idx = find(Data.Graph.segInfo.A_idx_end{1,1} == Data.Graph.segno);
seginfo_text = [' of ' num2str(size(Data.Graph.segInfo.segPos,1)) ' (' num2str(idx) ' of ' num2str(size(Data.Graph.segInfo.A_idx_end{1,1},2)) ')'];
str2 = num2str(Data.Graph.segno);
str3 = [' of ' num2str(size(Data.Graph.segInfo.segPos,1)) ' (' num2str(idx) ' of ' num2str(size(Data.Graph.segInfo.A_idx_end{1,1},2)) ')'];
else
% set(handles.text_segNumber,'String',['segment ' num2str(Data.Graph.segno) ' of ' num2str(size(Data.Graph.segInfo.segPos,1))]);
seginfo_text = [' of ' num2str(size(Data.Graph.segInfo.segPos,1))];
end
elseif strcmp(get(handles.AllSegments_lessthan3nodes,'checked'),'on')
if strcmp(get(handles.AllSegments_endSegments,'Checked'),'on')
idx = find(Data.Graph.segInfo.A_idx_end{2,1} == Data.Graph.segno);
seginfo_text = [' of ' num2str(size(Data.Graph.segInfo.segPos,1)) ' (' num2str(idx) ' of ' num2str(size(Data.Graph.segInfo.A_idx_end{2,1},2)) ')'];
else
idx = find(Data.Graph.segInfo.A_Idx3 == Data.Graph.segno);
seginfo_text = [' of ' num2str(size(Data.Graph.segInfo.segPos,1)) ' (' num2str(idx) ' of ' num2str(size(Data.Graph.segInfo.A_Idx3,1)) ')'];
end
elseif strcmp(get(handles.AllSegments_lessthan5nodes,'checked'),'on')
if strcmp(get(handles.AllSegments_endSegments,'Checked'),'on')
idx = find(Data.Graph.segInfo.A_idx_end{3,1} == Data.Graph.segno);
seginfo_text = [' of ' num2str(size(Data.Graph.segInfo.segPos,1)) ' (' num2str(idx) ' of ' num2str(size(Data.Graph.segInfo.A_idx_end{3,1},2)) ')'];
else
idx = find(Data.Graph.segInfo.A_Idx5 == Data.Graph.segno);
seginfo_text = [' of ' num2str(size(Data.Graph.segInfo.segPos,1)) ' (' num2str(idx) ' of ' num2str(size(Data.Graph.segInfo.A_Idx5,1)) ')'];
end
elseif strcmp(get(handles.AllSegments_lessthan10nodes,'checked'),'on')
if strcmp(get(handles.AllSegments_endSegments,'Checked'),'on')
idx = find(Data.Graph.segInfo.A_idx_end{4,1} == Data.Graph.segno);
seginfo_text = [' of ' num2str(size(Data.Graph.segInfo.segPos,1)) ' (' num2str(idx) ' of ' num2str(size(Data.Graph.segInfo.A_idx_end{4,1},2)) ')'];
else
idx = find(Data.Graph.segInfo.A_Idx10 == Data.Graph.segno);
seginfo_text = [' of ' num2str(size(Data.Graph.segInfo.segPos,1)) ' (' num2str(idx) ' of ' num2str(size(Data.Graph.segInfo.A_Idx10,1)) ')'];
end
elseif strcmp(get(handles.unverifedlessthan3Nodes,'checked'),'on')
if strcmp(get(handles.Unverified_endSegments,'Checked'),'on')
idx = find(Data.Graph.segInfo.idx_end{2,1} == Data.Graph.segno);
seginfo_text = [' of ' num2str(size(Data.Graph.segInfo.segPos,1)) ' (' num2str(idx) ' of ' num2str(size(Data.Graph.segInfo.idx_end{2,1},2)) ')'];
else
idx = find(Data.Graph.segInfo.unverifiedIdx3 == Data.Graph.segno);
seginfo_text = [' of ' num2str(size(Data.Graph.segInfo.segPos,1)) ' (' num2str(idx) ' of ' num2str(size(Data.Graph.segInfo.unverifiedIdx3,1)) ')'];
end
elseif strcmp(get(handles.unverifedlessthan3Nodes,'checked'),'on')
if strcmp(get(handles.Unverified_endSegments,'Checked'),'on')
idx = find(Data.Graph.segInfo.idx_end{2,1} == Data.Graph.segno);
seginfo_text = [' of ' num2str(size(Data.Graph.segInfo.segPos,1)) ' (' num2str(idx) ' of ' num2str(size(Data.Graph.segInfo.idx_end{2,1},2)) ')'];
else
idx = find(Data.Graph.segInfo.unverifiedIdx3 == Data.Graph.segno);
seginfo_text = [' of ' num2str(size(Data.Graph.segInfo.segPos,1)) ' (' num2str(idx) ' of ' num2str(size(Data.Graph.segInfo.unverifiedIdx3,1)) ')'];
end
elseif strcmp(get(handles.unverifedlessthan5Nodes,'checked'),'on')
if strcmp(get(handles.Unverified_endSegments,'Checked'),'on')
idx = find(Data.Graph.segInfo.idx_end{3,1} == Data.Graph.segno);
seginfo_text = [' of ' num2str(size(Data.Graph.segInfo.segPos,1)) ' (' num2str(idx) ' of ' num2str(size(Data.Graph.segInfo.idx_end{3,1},2)) ')'];
else
idx = find(Data.Graph.segInfo.unverifiedIdx5 == Data.Graph.segno);
seginfo_text = [' of ' num2str(size(Data.Graph.segInfo.segPos,1)) ' (' num2str(idx) ' of ' num2str(size(Data.Graph.segInfo.unverifiedIdx5,1)) ')'];
end
elseif strcmp(get(handles.unverifedlessthan10Nodes,'checked'),'on')
if strcmp(get(handles.Unverified_endSegments,'Checked'),'on')
idx = find(Data.Graph.segInfo.idx_end{4,1} == Data.Graph.segno);
seginfo_text = [' of ' num2str(size(Data.Graph.segInfo.segPos,1)) ' (' num2str(idx) ' of ' num2str(size(Data.Graph.segInfo.idx_end{4,1},2)) ')'];
else
idx = find(Data.Graph.segInfo.unverifiedIdx10 == Data.Graph.segno);
seginfo_text = [' of ' num2str(size(Data.Graph.segInfo.segPos,1)) ' (' num2str(idx) ' of ' num2str(size(Data.Graph.segInfo.unverifiedIdx10,1)) ')'];
end
elseif strcmp(get(handles.unverifedAllNodes,'checked'),'on')
if strcmp(get(handles.Unverified_endSegments,'Checked'),'on')
idx = find(Data.Graph.segInfo.idx_end{1,1} == Data.Graph.segno);
seginfo_text = [' of ' num2str(size(Data.Graph.segInfo.segPos,1)) ' (' num2str(idx) ' of ' num2str(size(Data.Graph.segInfo.idx_end{1,1},2)) ')'];
else
idx = find(Data.Graph.segInfo.unverifiedIdx == Data.Graph.segno);
seginfo_text = [' of ' num2str(size(Data.Graph.segInfo.segPos,1)) ' (' num2str(idx) ' of ' num2str(size(Data.Graph.segInfo.unverifiedIdx,1)) ')'];
end
end
end
if exist('seginfo_text','var')
set(handles.text_segNumber,'String','segment');
set(handles.edit_segmentNumber,'String',num2str(Data.Graph.segno));
set(handles.text_segNumber2,'String', seginfo_text);
% set(handles.text_segNumber,'String',seginfo_text);
end
maxI = str2double(get(handles.edit_maxI,'String'));
minI = str2double(get(handles.edit_minI,'String'));
colormap('gray')
if get(handles.radiobutton_XYview,'Value')
I_h = imagesc(Zimg,[minI maxI]);
elseif get(handles.radiobutton_XZview,'Value')
I_h = imagesc(ZimgXZ,[minI maxI]);
else
I_h = imagesc(ZimgYZ,[minI maxI]);
end
axis image;
axis on
if isfield(Data,'ZoomXrange') && isfield(Data,'ZoomYrange')
if get(handles.radiobutton_XYview,'Value')
xlim(Data.ZoomXrange);
ylim(Data.ZoomYrange);
elseif get(handles.radiobutton_XZview,'Value')
xlim(Data.ZoomXrange);
ylim(Data.ZoomZrange);
else
xlim(Data.ZoomYrange);
ylim(Data.ZoomZrange);
end
end
if get(handles.radiobutton_selectSegment,'Value') == 1 || get(handles.radiobutton_addEdge,'Value') == 1
set(I_h, 'ButtonDownFcn', {@axes_ButtonDown, handles});
end
nodes = Data.Graph.nodes;
edges = Data.Graph.edges;
% nodeSegN = Data.Graph.segInfo.nodeSegN;
% Seg_count = max(nodeSegN(:));
% ZMIP = str2double(get(handles.edit_ZMIP,'String'));
% XMIP = str2double(get(handles.edit_XwidthZoom,'String'));
% YMIP = str2double(get(handles.edit_YwidthZoom,'String'));
% if isfield(Data.Graph,'segno')
% u = Data.Graph.segno;
% else
% u = 1;
% Data.Graph.segno = u;
% end
% seg_nodes = find(nodeSegN == u);
% Data.Graph.verifiedNodes(seg_nodes) = 3;
hold on
lstvisible = find(nodes(:,1)>=Data.ZoomXrange(1) & nodes(:,1)<=Data.ZoomXrange(2) & ...
nodes(:,2)>=Data.ZoomYrange(1) & nodes(:,2)<=Data.ZoomYrange(2) & ...
nodes(:,3)>=Zstartframe & nodes(:,3)<=Zendframe & Data.Graph.verifiedNodes == 1 );
endNodes = Data.Graph.segInfo.segEndNodes(Data.Graph.segno,:);
lstseg = unique([find(Data.Graph.segInfo.nodeSegN == Data.Graph.segno);endNodes(:)]);
% lstseg = intersect(lstseg,lstvisible);
if isfield(Data.Graph,'segmentstodelete')
if sum(ismember(Data.Graph.segmentstodelete,Data.Graph.segno)) ~= 0
cn = 'r.';
ce = 'r-';
elseif Data.Graph.verifiedSegments(Data.Graph.segno) == 1
cn = 'g.';
ce = 'g-';
else
cn ='c.';
ce = 'c-';
end
else
if Data.Graph.verifiedSegments(Data.Graph.segno) == 1
cn = 'g.';
ce = 'g-';
else
cn ='c.';
ce = 'c-';
end
end
% h=plot(nodes(lstseg,1),nodes(lstseg,2),cn);
if get(handles.radiobutton_XYview,'Value')
h=plot(nodes(lstseg,1),nodes(lstseg,2),cn);
elseif get(handles.radiobutton_XZview,'Value')
h=plot(nodes(lstseg,1),nodes(lstseg,3),cn);
else
h=plot(nodes(lstseg,2),nodes(lstseg,3),cn);
end
lstseg_edges = find(Data.Graph.segInfo.edgeSegN == Data.Graph.segno);
for ii = 1:length(lstseg_edges)
% h = plot(nodes(edges(lstseg_edges(ii),:),1), nodes(edges(lstseg_edges(ii),:),2), ce );
if get(handles.radiobutton_XYview,'Value')
h = plot(nodes(edges(lstseg_edges(ii),:),1), nodes(edges(lstseg_edges(ii),:),2), ce );
elseif get(handles.radiobutton_XZview,'Value')
h = plot(nodes(edges(lstseg_edges(ii),:),1), nodes(edges(lstseg_edges(ii),:),3), ce );
else
h = plot(nodes(edges(lstseg_edges(ii),:),2), nodes(edges(lstseg_edges(ii),:),3), ce );
end
end
% for ii=1:length(lstseg)
% lst2 = find(edges(:,1)==lstseg(ii));
% h = plot(nodes(edges(lst2,:),1), nodes(edges(lst2,:),2), ce );
% % h = plot(nodes(edges(lst2,:),1), 'm-' );
% % if get(handles.radiobutton_validateNodes,'Value') == 1 || get(handles.radiobutton_addEdge,'Value') == 1 ...
% % || get(handles.radiobutton_selectSegment,'Value') == 1 || get(handles.radiobutton_unvalidateNodes,'Value') == 1
% % set(h, 'ButtonDownFcn', {@axes_ButtonDown, handles});
% % end
% end
hold off
u1 = Data.Graph.segInfo.segEndNodes(Data.Graph.segno,1);
u2 = Data.Graph.segInfo.segEndNodes(Data.Graph.segno,2);
idx1 = find((Data.Graph.segInfo.segEndNodes(:,1) == u1) | (Data.Graph.segInfo.segEndNodes(:,2) == u1));
idx2 = find((Data.Graph.segInfo.segEndNodes(:,1) == u2) | (Data.Graph.segInfo.segEndNodes(:,2) == u2));
idx = setdiff([idx1;idx2],Data.Graph.segno);
%%%Display segments to delete
for uu = 1:length(idx)
if isfield(Data.Graph,'segmentstodelete')
if sum(ismember(Data.Graph.segmentstodelete,idx(uu))) ~= 0
cn = 'r.';
ce = 'r-';
else
cn = 'm.';
ce = 'm-';
end
else
cn = 'm.';
ce = 'm-';
end
hold on
seg_nodes = find(Data.Graph.segInfo.nodeSegN == idx(uu));
% h=plot(nodes(seg_nodes,1),nodes(seg_nodes,2),cn);
if get(handles.radiobutton_XYview,'Value')
h=plot(nodes(seg_nodes,1),nodes(seg_nodes,2),cn);
elseif get(handles.radiobutton_XZview,'Value')
h=plot(nodes(seg_nodes,1),nodes(seg_nodes,3),cn);
else
h=plot(nodes(seg_nodes,2),nodes(seg_nodes,3),cn);
end
lstseg_edges = find(Data.Graph.segInfo.edgeSegN == idx(uu));
for ii = 1:length(lstseg_edges)
% h = plot(nodes(edges(lstseg_edges(ii),:),1), nodes(edges(lstseg_edges(ii),:),2), ce );
if get(handles.radiobutton_XYview,'Value')
h = plot(nodes(edges(lstseg_edges(ii),:),1), nodes(edges(lstseg_edges(ii),:),2), ce );
elseif get(handles.radiobutton_XZview,'Value')
h = plot(nodes(edges(lstseg_edges(ii),:),1), nodes(edges(lstseg_edges(ii),:),3), ce );
else
h = plot(nodes(edges(lstseg_edges(ii),:),2), nodes(edges(lstseg_edges(ii),:),3), ce );
end
end
% seg_nodes = intersect(seg_nodes,lstvisible);
% h=plot(nodes(seg_nodes,1),nodes(seg_nodes,2),'m.');
% for ii=1:length(seg_nodes)
% lst2 = find(edges(:,1)==seg_nodes(ii));
% h = plot(nodes(edges(lst2,:),1), nodes(edges(lst2,:),2), 'm-' );
% end
hold off
end
guigcf = gcf;
if 1
figure(1); subplot(2,2,1); I_h = imagesc(Zimg,[minI maxI]); axis image; axis on
if isfield(Data,'ZoomXrange') && isfield(Data,'ZoomYrange')
xlim(Data.ZoomXrange);
ylim(Data.ZoomYrange);
end
hold on
if isfield(Data.Graph,'segmentstodelete')
if sum(ismember(Data.Graph.segmentstodelete,Data.Graph.segno)) ~= 0
cn = 'r.';
ce = 'r-';
elseif Data.Graph.verifiedSegments(Data.Graph.segno) == 1
cn = 'g.';
ce = 'g-';
else
cn ='c.';
ce = 'c-';
end
else
if Data.Graph.verifiedSegments(Data.Graph.segno) == 1
cn = 'g.';
ce = 'g-';
else
cn ='c.';
ce = 'c-';
end
end
h=plot(nodes(lstseg,1),nodes(lstseg,2),cn);
lstseg_edges = find(Data.Graph.segInfo.edgeSegN == Data.Graph.segno);
for ii = 1:length(lstseg_edges)
h = plot(nodes(edges(lstseg_edges(ii),:),1), nodes(edges(lstseg_edges(ii),:),2), ce);
end
% for ii=1:length(lstseg)
% lst2 = find(edges(:,1)==lstseg(ii));
% h = plot(nodes(edges(lst2,:),1), nodes(edges(lst2,:),2), ce );
% % h = plot(nodes(edges(lst2,:),1), 'm-' );
% % if get(handles.radiobutton_validateNodes,'Value') == 1 || get(handles.radiobutton_addEdge,'Value') == 1 ...
% % || get(handles.radiobutton_selectSegment,'Value') == 1 || get(handles.radiobutton_unvalidateNodes,'Value') == 1
% % set(h, 'ButtonDownFcn', {@axes_ButtonDown, handles});
% % end
% end
for uu = 1:length(idx)
if isfield(Data.Graph,'segmentstodelete')
if sum(ismember(Data.Graph.segmentstodelete,idx(uu))) ~= 0
cn = 'r.';
ce = 'r-';
else
cn = 'm.';
ce = 'm-';
end
else
cn = 'm.';
ce = 'm-';
end
seg_nodes = find(Data.Graph.segInfo.nodeSegN == idx(uu));
% seg_nodes = intersect(seg_nodes,lstvisible);
h=plot(nodes(seg_nodes,1),nodes(seg_nodes,2),cn);
lstseg_edges = find(Data.Graph.segInfo.edgeSegN == idx(uu));
for ii = 1:length(lstseg_edges)
h = plot(nodes(edges(lstseg_edges(ii),:),1), nodes(edges(lstseg_edges(ii),:),2), ce );
end
% for ii=1:length(seg_nodes)
% lst2 = find(edges(:,1)==seg_nodes(ii));
% h = plot(nodes(edges(lst2,:),1), nodes(edges(lst2,:),2), ce );
% end
end
hold off
Ximg = squeeze(max(I(:,Ystartframe:Yendframe,:),[],2));
subplot(2,2,3); imagesc(Ximg,[minI maxI]); colormap('gray');
axis image;
axis on
if isfield(Data,'ZoomXrange') && isfield(Data,'ZoomYrange')
xlim(Data.ZoomXrange);
ylim(Data.ZoomZrange);
end
hold on
if isfield(Data.Graph,'segmentstodelete')
if sum(ismember(Data.Graph.segmentstodelete,Data.Graph.segno)) ~= 0
cn = 'r.';
ce = 'r-';
elseif Data.Graph.verifiedSegments(Data.Graph.segno) == 1
cn = 'g.';
ce = 'g-';
else
cn ='c.';
ce = 'c-';
end
else
if Data.Graph.verifiedSegments(Data.Graph.segno) == 1
cn = 'g.';
ce = 'g-';
else
cn ='c.';
ce = 'c-';
end
end
x = 1; y= 3;
h=plot(nodes(lstseg,x),nodes(lstseg,y),cn);
lstseg_edges = find(Data.Graph.segInfo.edgeSegN == Data.Graph.segno);
for ii = 1:length(lstseg_edges)
h = plot(nodes(edges(lstseg_edges(ii),:),x), nodes(edges(lstseg_edges(ii),:),y), ce);
end
% for ii=1:length(lstseg)
% lst2 = find(edges(:,1)==lstseg(ii));
% h = plot(nodes(edges(lst2,:),x), nodes(edges(lst2,:),y), ce );
% % h = plot(nodes(edges(lst2,:),1), 'm-' );
% % if get(handles.radiobutton_validateNodes,'Value') == 1 || get(handles.radiobutton_addEdge,'Value') == 1 ...
% % || get(handles.radiobutton_selectSegment,'Value') == 1 || get(handles.radiobutton_unvalidateNodes,'Value') == 1
% % set(h, 'ButtonDownFcn', {@axes_ButtonDown, handles});
% % end
% end
hold off
for uu = 1:length(idx)
if isfield(Data.Graph,'segmentstodelete')
if sum(ismember(Data.Graph.segmentstodelete,idx(uu))) ~= 0
cn = 'r.';
ce = 'r-';
else
cn = 'm.';
ce = 'm-';
end
else
cn = 'm.';
ce = 'm-';
end
hold on
seg_nodes = find(Data.Graph.segInfo.nodeSegN == idx(uu));
% seg_nodes = intersect(seg_nodes,lstvisible);
h=plot(nodes(seg_nodes,x),nodes(seg_nodes,y),cn);
lstseg_edges = find(Data.Graph.segInfo.edgeSegN == idx(uu));
for ii = 1:length(lstseg_edges)
h = plot(nodes(edges(lstseg_edges(ii),:),x), nodes(edges(lstseg_edges(ii),:),y), ce );
end
% for ii=1:length(seg_nodes)
% lst2 = find(edges(:,1)==seg_nodes(ii));
% h = plot(nodes(edges(lst2,:),x), nodes(edges(lst2,:),y), 'm-' );
% end
hold off
end
Yimg = squeeze(max(I(:,:,Xstartframe:Xendframe),[],3));
subplot(2,2,2); imagesc(Yimg',[minI maxI]); colormap('gray');
axis image;
axis on
if isfield(Data,'ZoomXrange') && isfield(Data,'ZoomYrange')
xlim(Data.ZoomZrange);
ylim(Data.ZoomYrange);
end
hold on
if isfield(Data.Graph,'segmentstodelete')
if sum(ismember(Data.Graph.segmentstodelete,Data.Graph.segno)) ~= 0
cn = 'r.';
ce = 'r-';
elseif Data.Graph.verifiedSegments(Data.Graph.segno) == 1
cn = 'g.';
ce = 'g-';
else
cn ='c.';
ce = 'c-';
end
else
if Data.Graph.verifiedSegments(Data.Graph.segno) == 1
cn = 'g.';
ce = 'g-';
else
cn ='c.';
ce = 'c-';
end
end
x = 3; y= 2;
h=plot(nodes(lstseg,x),nodes(lstseg,y),cn);
lstseg_edges = find(Data.Graph.segInfo.edgeSegN == Data.Graph.segno);
for ii = 1:length(lstseg_edges)
h = plot(nodes(edges(lstseg_edges(ii),:),x), nodes(edges(lstseg_edges(ii),:),y), ce);
end
% for ii=1:length(lstseg)
% lst2 = find(edges(:,1)==lstseg(ii));
% h = plot(nodes(edges(lst2,:),x), nodes(edges(lst2,:),y), ce );
% % h = plot(nodes(edges(lst2,:),1), 'm-' );
% % if get(handles.radiobutton_validateNodes,'Value') == 1 || get(handles.radiobutton_addEdge,'Value') == 1 ...
% % || get(handles.radiobutton_selectSegment,'Value') == 1 || get(handles.radiobutton_unvalidateNodes,'Value') == 1
% % set(h, 'ButtonDownFcn', {@axes_ButtonDown, handles});
% % end
% end
hold off
for uu = 1:length(idx)
if isfield(Data.Graph,'segmentstodelete')
if sum(ismember(Data.Graph.segmentstodelete,idx(uu))) ~= 0
cn = 'r.';
ce = 'r-';
else
cn = 'm.';
ce = 'm-';
end
else
cn = 'm.';
ce = 'm-';
end
hold on
seg_nodes = find(Data.Graph.segInfo.nodeSegN == idx(uu));
% seg_nodes = intersect(seg_nodes,lstvisible);
h=plot(nodes(seg_nodes,x),nodes(seg_nodes,y),cn);
lstseg_edges = find(Data.Graph.segInfo.edgeSegN == idx(uu));
for ii = 1:length(lstseg_edges)
h = plot(nodes(edges(lstseg_edges(ii),:),x), nodes(edges(lstseg_edges(ii),:),y), ce );
end
% for ii=1:length(seg_nodes)
% lst2 = find(edges(:,1)==seg_nodes(ii));
% h = plot(nodes(edges(lst2,:),x), nodes(edges(lst2,:),y), ce );
% end
hold off
end
figure(2)
clf
n = ceil((Data.ZoomZrange(2)-Data.ZoomZrange(1))/10);
n1 = ceil(n/4);
for iii = 1:n
ha(iii)=subplot(n1,4,iii);
colormap('gray')
img10 = squeeze(max(I(Zstartframe+(iii-1)*10:min(Zstartframe+(iii-1)*10,Zendframe),:,:),[],1));
imagesc(img10,[minI maxI]);
axis on
axis image
if isfield(Data,'ZoomXrange') && isfield(Data,'ZoomYrange')
xlim(Data.ZoomXrange);
ylim(Data.ZoomYrange);
end
if isfield(Data.Graph,'segmentstodelete')
if sum(ismember(Data.Graph.segmentstodelete,Data.Graph.segno)) ~= 0
cn = 'r.';
ce = 'r-';
elseif Data.Graph.verifiedSegments(Data.Graph.segno) == 1
cn = 'g.';
ce = 'g-';
else
cn ='c.';
ce = 'c-';
end
else
if Data.Graph.verifiedSegments(Data.Graph.segno) == 1
cn = 'g.';
ce = 'g-';
else
cn ='c.';
ce = 'c-';
end
end
hold on
h=plot(nodes(lstseg,1),nodes(lstseg,2),cn);
lstseg_edges = find(Data.Graph.segInfo.edgeSegN == Data.Graph.segno);
for ii = 1:length(lstseg_edges)
h = plot(nodes(edges(lstseg_edges(ii),:),1), nodes(edges(lstseg_edges(ii),:),2), ce );
end
for uu = 1:length(idx)
if isfield(Data.Graph,'segmentstodelete')
if sum(ismember(Data.Graph.segmentstodelete,idx(uu))) ~= 0
cn = 'r.';
ce = 'r-';
else
cn = 'm.';
ce = 'm-';
end
else
cn = 'm.';
ce = 'm-';
end
seg_nodes = find(Data.Graph.segInfo.nodeSegN == idx(uu));
% seg_nodes = intersect(seg_nodes,lstvisible);
h=plot(nodes(seg_nodes,1),nodes(seg_nodes,2),cn);
lstseg_edges = find(Data.Graph.segInfo.edgeSegN == idx(uu));
for ii = 1:length(lstseg_edges)
h = plot(nodes(edges(lstseg_edges(ii),:),1), nodes(edges(lstseg_edges(ii),:),2), ce );
end
% for ii=1:length(seg_nodes)
% lst2 = find(edges(:,1)==seg_nodes(ii));
% h = plot(nodes(edges(lst2,:),1), nodes(edges(lst2,:),2), ce );
% end
end
hold off
end
% linkaxes(ha,'xy')
end
% uicontrol(guigcf);
figure(guigcf);
else
if get(handles.radiobutton_fastDisplay,'Value') && isfield(Data,'angioVolume')
cmap = gray(255);
if 1
cmap(254,:) = [1 0 1];
cmap(255,:) = [0 1 0];
cmap(252,:) = [1 0 1];
cmap(253,:) = [0 1 0];
cmap(251,:) = [1 1 0];
else
cmap(254,:) = [1 0 1];
cmap(255,:) = [0 1 0];
cmap(252,:) = [1 1 0];
cmap(253,:) = [1 1 1];
end
Zimg = squeeze(max(Data.angioVolume(Zstartframe:Zendframe,:,:),[],1));
I_h = imagesc(Zimg,[0 256]);
colormap(cmap);
axis image
axis on
if isfield(Data,'ZoomXrange') && isfield(Data,'ZoomYrange')
xlim(Data.ZoomXrange);
ylim(Data.ZoomYrange);
end
if get(handles.radiobutton_validateNodes,'Value') == 1 || get(handles.radiobutton_addEdge,'Value') == 1 ...
|| get(handles.radiobutton_selectSegment,'Value') == 1 || get(handles.radiobutton_unvalidateNodes,'Value') == 1
set(I_h, 'ButtonDownFcn', {@axes_ButtonDown, handles});
end
else
if (get(handles.checkbox_showFiltData,'Value') == 1) || (get(handles.checkbox_showRawData,'Value') == 1)
colormap('gray')
maxI = str2double(get(handles.edit_maxI,'String'));
minI = str2double(get(handles.edit_minI,'String'));
if get(handles.radiobutton_XYview,'Value')
I_h = imagesc(Zimg,[minI maxI]);
elseif get(handles.radiobutton_XZview,'Value')
I_h = imagesc(ZimgXZ,[minI maxI]);
else
I_h = imagesc(ZimgYZ,[minI maxI]);
end
if isfield(Data,'segangio') && (get(handles.checkbox_showSeg,'Value') == 1)
hold on
img = double(ZimgS);
green = cat(3, zeros(size(img)),ones(size(img)), zeros(size(img)));
hold on
h = imagesc(green);
hold off
set(h, 'AlphaData', img*0.25)
else
if get(handles.checkbox_showColorbar,'Value') == 1
colorbar;
end
end
if isfield(Data,'fg_seed_vol') && (get(handles.checkbox_showFGSeeds,'Value') == 1)
ZimgFG = squeeze(max(Data.fg_seed_vol(Zstartframe:Zendframe,:,:),[],1));
hold on
img = double(ZimgFG);
red = cat(3, ones(size(img)),zeros(size(img)), zeros(size(img)));
hold on
h = imagesc(red);
hold off
set(h, 'AlphaData', img*0.25)
end
if isfield(Data,'bg_seed_vol') && (get(handles.checkbox_showBGSeeds,'Value') == 1)
ZimgBG = squeeze(max(Data.bg_seed_vol(Zstartframe:Zendframe,:,:),[],1));
hold on
img = double(ZimgBG);
blue = cat(3, zeros(size(img)),zeros(size(img)), ones(size(img)));
hold on
h = imagesc(blue);
hold off
set(h, 'AlphaData', img*0.25)
end
axis image
axis on
if isfield(Data,'ZoomXrange') && isfield(Data,'ZoomYrange')
if get(handles.radiobutton_XYview,'Value')
xlim(Data.ZoomXrange);
ylim(Data.ZoomYrange);
elseif get(handles.radiobutton_XZview,'Value')
xlim(Data.ZoomXrange);
ylim(Data.ZoomZrange);
else
xlim(Data.ZoomYrange);
ylim(Data.ZoomZrange);
end
end
elseif get(handles.checkbox_showSeg,'Value') == 1 && isfield(Data,'segangio')
% C = [0 0 0; 0 0.25 0; 0 0.5 0; 0 1 0];
img = double(ZimgS);
green = cat(3, zeros(size(img)),img*0.25, zeros(size(img)));
imagesc(green);
% colormap(C);
% colorbar;
axis image;
axis on
if isfield(Data,'ZoomXrange') && isfield(Data,'ZoomYrange')
xlim(Data.ZoomXrange);
ylim(Data.ZoomYrange);
end
% set(h, 'AlphaData', img*0.25)
end
% Display fgseeds
if isfield(Data,'Selected_fg_seeds')
hold on
for u = 1:length(Data.Selected_fg_seeds)
tempMat = Data.Selected_fg_seeds{u};
for v = 1:size(tempMat,1)
if tempMat(v,1) >= Zstartframe && tempMat(v,1) <= Zendframe
text(tempMat(v,3), tempMat(v,2),'X','Color','r');
end
end
end
hold off
end
% Display Graph
if isfield(Data,'Graph') && get(handles.checkboxDisplayGraph,'value')==1
nodes = Data.Graph.nodes;
edges = Data.Graph.edges;
lst = find(nodes(:,1)>=Data.ZoomXrange(1) & nodes(:,1)<=Data.ZoomXrange(2) & ...
nodes(:,2)>=Data.ZoomYrange(1) & nodes(:,2)<=Data.ZoomYrange(2) & ...
nodes(:,3)>=Zstartframe & nodes(:,3)<=Zendframe );
% if isfield(Data.Graph,'verifiedNodes')
% c = blanks(length(lst));
% c(1:length(lst)) = 'm.';
% lst1 = find(lst & Data.Graph.verifiedNodes == 1);
% c(lst1) = 'g.';
% lst2 = find(lst & Data.Graph.verifiedNodes == 2);
% c(lst2) = 'g*';
% else
% c = 'm.';
% end
% c = 'm.';
hold on
% h=plot(nodes(lst,1),nodes(lst,2),'m.');
if get(handles.radiobutton_XYview,'Value')
h=plot(nodes(lst,1),nodes(lst,2),'m.');
elseif get(handles.radiobutton_XZview,'Value')
h=plot(nodes(lst,1),nodes(lst,3),'m.');
else
h=plot(nodes(lst,2),nodes(lst,3),'m.');
end
% for u = 1:length(lst)
%
% end
if isfield(Data.Graph,'verifiedNodes')
lstg = find(nodes(:,1)>=Data.ZoomXrange(1) & nodes(:,1)<=Data.ZoomXrange(2) & ...
nodes(:,2)>=Data.ZoomYrange(1) & nodes(:,2)<=Data.ZoomYrange(2) & ...
nodes(:,3)>=Zstartframe & nodes(:,3)<=Zendframe & Data.Graph.verifiedNodes > 1 );
% h=plot(nodes(lstg,1),nodes(lstg,2),'g.');
if get(handles.radiobutton_XYview,'Value')
h=plot(nodes(lstg,1),nodes(lstg,2),'g.');
elseif get(handles.radiobutton_XZview,'Value')
h=plot(nodes(lstg,1),nodes(lstg,3),'g.');
else
h=plot(nodes(lstg,2),nodes(lstg,3),'g.');
end
% lsts = find(nodes(:,1)>=Data.ZoomXrange(1) & nodes(:,1)<=Data.ZoomXrange(2) & ...
% nodes(:,2)>=Data.ZoomYrange(1) & nodes(:,2)<=Data.ZoomYrange(2) & ...
% nodes(:,3)>=Zstartframe & nodes(:,3)<=Zendframe & Data.Graph.verifiedNodes == 2 );
% h=plot(nodes(lsts,1),nodes(lsts,2),'g*','MarkerSize',15);
% lstseg = find(nodes(:,1)>=Data.ZoomXrange(1) & nodes(:,1)<=Data.ZoomXrange(2) & ...
% nodes(:,2)>=Data.ZoomYrange(1) & nodes(:,2)<=Data.ZoomYrange(2) & ...
% nodes(:,3)>=Zstartframe & nodes(:,3)<=Zendframe & Data.Graph.verifiedNodes == 3 );
% h=plot(nodes(lstseg,1),nodes(lstseg,2),'g.');
end
set(h,'markersize',12)
if isfield(Data.Graph,'nodeS')
if ~isempty(Data.Graph.nodeS)