-
Notifications
You must be signed in to change notification settings - Fork 11
/
work.m
1836 lines (1453 loc) · 64.8 KB
/
work.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 = work(varargin)
%global handles.lmn;
% WORK MATLAB code for work.fig
% WORK, by itself, creates a new WORK or raises the existing
% singleton*.
%
% H = WORK returns the handle to a new WORK or the handle to
% the existing singleton*.
%
% WORK('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in WORK.M with the given input arguments.
%
% WORK('Property','Value',...) creates a new WORK or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before work_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to work_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 work
% Last Modified by GUIDE v2.5 26-Jun-2020 17:57:09
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @work_OpeningFcn, ...
'gui_OutputFcn', @work_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 work is made visible.
function work_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 work (see VARARGIN)
% Choose default command line output for work
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes work wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = work_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 edit1_Callback(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
Filepath=pwd;
folder_name=get(hObject,'string');
handles.folder_name=folder_name;
guidata(hObject,handles);
assignin('base','folder_name',handles.folder_name);
% Hints: get(hObject,'String') returns contents of edit1 as text
% str2double(get(hObject,'String')) returns contents of edit1 as a double
% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (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 browse.
function browse_Callback(hObject, eventdata, handles)
% hObject handle to browse (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
Filepath=pwd;
data_folder_name=uigetdir('c:\');
handles.data_folder_name=data_folder_name;
set(handles.edit1,'String',data_folder_name);
%cd(data_folder_name);
%Groupdir=dir;
%for movin=1:length(Groupdir)-2
%mkdir(fullfile(folder_name,'Preprocessed-data',Groupdir(movin+2).name));
%movefile(Groupdir(movin+2).name,'Preprocessed-data');
%end
cd(Filepath);
%handles.folder_name = folder_name;
%guidata(hObject,handles);
%addpath(genpath(folder_name));
assignin('base','data_folder_name',handles.data_folder_name);
%[filename pathname] = uigetfile({'.'}, 'File selector');
%fullpathname = strcat(pathname,filename);
%text=fileread(fullpathname);
%set(handles.edit1,'string',fullpathname);
%assignin('base','folder',[filename pathname])
function edit2_Callback(hObject, eventdata, handles)
% hObject handle to edit2 (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 edit2 as text
% str2double(get(hObject,'String')) returns contents of edit2 as a double
% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit2 (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 adhd.
function adhd_Callback(hObject, eventdata, handles)
% hObject handle to adhd (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 controls.
function controls_Callback(hObject, eventdata, handles)
% hObject handle to controls (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 controls1.
function controls1_Callback(hObject, eventdata, handles)
% hObject handle to controls1 (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 staticfc.
function staticfc_Callback(hObject, eventdata, handles)
% hObject handle to staticfc (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%addpath(genpath('C:\Users\xyz\Documents\MATLAB\gui'))
%a = get(handles.sfc,'Value')
%if(a == 1)
% Controls_together
%PTSD_together
%staticFC_individual
%data_create_sfc
%end
% Hint: get(hObject,'Value') returns toggle state of staticfc
% --- Executes on button press in sec.
function sec_Callback(hObject, eventdata, handles)
% hObject handle to sec (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%addpath(genpath('C:\Users\xyz\Documents\MATLAB\gui'))
%stec = get(handles.time_series,'Value')
%if(stec == 1)
%Controls_together
%PTSD_together
% secout
%data_create_sec
% assignin('base','con',conmat)
%end
% Hint: get(hObject,'Value') returns toggle state of sec
% --- Executes on button press in dec.
function dec_Callback(hObject, eventdata, handles)
% hObject handle to dec (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 dec
% --- Executes on button press in dfc.
function dfc_Callback(hObject, eventdata, handles)
% hObject handle to dfc (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%addpath(genpath('C:\Users\xyz\Documents\MATLAB\gui'))
%dyfc = get(handles.dfc,'Value')
%if(dyfc == 1)
%Controls_together
%PTSD_together
%dfcout
%data_create
% dfcout
%end
% Hint: get(hObject,'Value') returns toggle state of dfc
% --- Executes on selection change in listbox1.
function listbox1_Callback(hObject, eventdata, handles)
% hObject handle to listbox1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns listbox1 contents as cell array
% contents{get(hObject,'Value')} returns selected item from listbox1
% --- Executes during object creation, after setting all properties.
function listbox1_CreateFcn(hObject, eventdata, handles)
% hObject handle to listbox1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: listbox 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 deconvolution.
function deconvolution_Callback(hObject, eventdata, handles)
% hObject handle to deconvolution (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%deco=get(handles.deconvolution,'Value')
%if(deco==1)
% mat_extraction
% perform_dec
% after_perform_dec
%post_decon_extract_timeseries
%end
% Hint: get(hObject,'Value') returns toggle state of deconvolution
% --- Executes on button press in recursivecluster.
function recursivecluster_Callback(hObject, eventdata, handles)
% hObject handle to recursivecluster (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 recursivecluster
% --- Executes on selection change in listbox2.
function listbox2_Callback(hObject, eventdata, handles)
% hObject handle to listbox2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns listbox2 contents as cell array
% contents{get(hObject,'Value')} returns selected item from listbox2
% --- Executes during object creation, after setting all properties.
function listbox2_CreateFcn(hObject, eventdata, handles)
% hObject handle to listbox2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: listbox 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 initialcluster_Callback(hObject, eventdata, handles)
% hObject handle to initialcluster (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%incl = str2double(get( hObject, 'String' ));
%handles.incl=incl;
%guidata(hObject,handles);
%assignin('base','incl',handles.incl);
global incl;
incl = str2num(get(hObject,'String'));
handles.incl=incl;
guidata(hObject, handles);
assignin('base','incl',handles.incl);
% Hints: get(hObject,'String') returns contents of initialcluster as text
% str2double(get(hObject,'String')) returns contents of initialcluster as a double
% --- Executes during object creation, after setting all properties.
function initialcluster_CreateFcn(hObject, eventdata, handles)
% hObject handle to initialcluster (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 finalcluster_Callback(hObject, eventdata, handles)
% hObject handle to finalcluster (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%fincl = str2double(get( hObject, 'String' ));
%handles.fincl=fincl;
%guidata(hObject,handles);
%assignin('base','fincl',handles.fincl);
global fincl;
fincl = str2num(get(hObject,'String'));
handles.fincl=fincl;
guidata(hObject, handles);
assignin('base','fincl',handles.fincl);
% Hints: get(hObject,'String') returns contents of finalcluster as text
% str2double(get(hObject,'String')) returns contents of finalcluster as a double
% --- Executes during object creation, after setting all properties.
function finalcluster_CreateFcn(hObject, eventdata, handles)
% hObject handle to finalcluster (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 decreasecluster_Callback(hObject, eventdata, handles)
% hObject handle to decreasecluster (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global deccl;
deccl = str2double(get( hObject, 'String' ));
handles.deccl=deccl;
guidata(hObject,handles);
assignin('base','deccl',handles.deccl);
% Hints: get(hObject,'String') returns contents of decreasecluster as text
% str2double(get(hObject,'String')) returns contents of decreasecluster as a double
% --- Executes during object creation, after setting all properties.
function decreasecluster_CreateFcn(hObject, eventdata, handles)
% hObject handle to decreasecluster (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 endpath_Callback(hObject, eventdata, handles)
% hObject handle to endpath (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global epat;
epat = str2double(get( hObject, 'String' ));
handles.epat=epat;
guidata(hObject,handles);
assignin('base','epat',handles.epat);
% Hints: get(hObject,'String') returns contents of endpath as text
% str2double(get(hObject,'String')) returns contents of endpath as a double
% --- Executes during object creation, after setting all properties.
function endpath_CreateFcn(hObject, eventdata, handles)
% hObject handle to endpath (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 folds_Callback(hObject, eventdata, handles)
% hObject handle to folds (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
nofo = str2double(get( hObject, 'String' ));
handles.nofo=nofo;
guidata(hObject,handles);
assignin('base','nofo',handles.nofo);
% Hints: get(hObject,'String') returns contents of folds as text
% str2double(get(hObject,'String')) returns contents of folds as a double
% --- Executes during object creation, after setting all properties.
function folds_CreateFcn(hObject, eventdata, handles)
% hObject handle to folds (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 resampling_Callback(hObject, eventdata, handles)
% hObject handle to resampling (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
resa = str2double(get( hObject, 'String' ))
handles.resa=resa;
guidata(hObject,handles);
assignin('base','resa',handles.resa);
% Hints: get(hObject,'String') returns contents of resampling as text
% str2double(get(hObject,'String')) returns contents of resampling as a double
% --- Executes during object creation, after setting all properties.
function resampling_CreateFcn(hObject, eventdata, handles)
% hObject handle to resampling (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 classes_Callback(hObject, eventdata, handles)
% hObject handle to classes (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 classes as text
% str2double(get(hObject,'String')) returns contents of classes as a double
nocl = str2double(get( hObject, 'String' ))
handles.nocl=nocl;
guidata(hObject,handles);
assignin('base','nocl',handles.nocl);
% --- Executes during object creation, after setting all properties.
function classes_CreateFcn(hObject, eventdata, handles)
% hObject handle to classes (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 selection change in classifier.
function classifier_Callback(hObject, eventdata, handles)
% hObject handle to classifier (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns classifier contents as cell array
% contents{get(hObject,'Value')} returns selected item from classifier
% --- Executes during object creation, after setting all properties.
function classifier_CreateFcn(hObject, eventdata, handles)
% hObject handle to classifier (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu 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 selection change in time_series.
function time_series_Callback(hObject, eventdata, handles)
% hObject handle to time_series (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
presdir=pwd;
tmse=get(handles.time_series,'Value');
if(tmse==1)
templa=strcat(presdir,'\Templates\cc200_91x109x91.nii');
handles.templa=templa;
guidata(hObject,handles);
assignin('base','templa',handles.templa);
end
if(tmse==2)
templa=strcat(presdir,'\Templates\CC400.nii');
handles.templa=templa;
guidata(hObject,handles);
assignin('base','templa',handles.templa);
end
if(tmse==3)
templa=strcat(presdir,'\Templates\dos160_roi_atlas.nii');
handles.templa=templa;
guidata(hObject,handles);
assignin('base','templa',handles.templa);
end
if(tmse==4)
% templa=uigetfile({'.nii'});
%handles.templa=templa;
[temfilnme, tempthnme]=uigetfile({'.nii'});
templa=strcat(tempthnme,temfilnme);
handles.templa=templa;
guidata(hObject,handles);
assignin('base','templa',handles.templa);
end
% Hints: contents = cellstr(get(hObject,'String')) returns time_series contents as cell array
% contents{get(hObject,'Value')} returns selected item from time_series
%addpath(genpath('C:\Users\xyz\Documents\MATLAB\gui'))
%a = get(handles.time_series,'Value')
%if(a == 1)
% msgbox('wait for couple of minutes')
% Extract_timeseries
%msgbox('extraction done, choose sfc, dec, sec, dec')
%end
% --- Executes during object creation, after setting all properties.
function time_series_CreateFcn(hObject, eventdata, handles)
% hObject handle to time_series (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu 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 sfc.
function sfc_Callback(hObject, eventdata, handles)
% hObject handle to sfc (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%addpath(genpath('C:\Users\xyz\Documents\MATLAB\gui'))
%stfc = get(handles.sfc,'Value')
%if(stfc == 1)
%Controls_together
%PTSD_together
%staticFC_individual
%data_create_sfc
%assignin('base','result',staticFC1)
%end
% Hint: get(hObject,'Value') returns toggle state of sfc
function edit10_Callback(hObject, eventdata, handles)
% hObject handle to edit10 (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 edit10 as text
% str2double(get(hObject,'String')) returns contents of edit10 as a double
% --- Executes during object creation, after setting all properties.
function edit10_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit10 (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 dsfc.
function dsfc_Callback(hObject, eventdata, handles)
% hObject handle to dsfc (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%deconsfc=get(handles.dsfc,'Value');
%if(deconsfc==1)
% Controls_together_decon
% PTSD_together_decon
% staticFC_decon_individual
%data_create_decon_sfc
%end
% Hint: get(hObject,'Value') returns toggle state of dsfc
% --- Executes on button press in checkbox5.
function checkbox5_Callback(hObject, eventdata, handles)
% hObject handle to checkbox5 (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 checkbox5
% --- Executes on button press in ddfc.
function ddfc_Callback(hObject, eventdata, handles)
% hObject handle to ddfc (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%decondfc=get(handles.ddfc,'Value')
%if(decondfc==1)
% Controls_together_decon
% PTSD_together_decon
% dfcout_decon
%data_create_decon_dfc
%end
% Hint: get(hObject,'Value') returns toggle state of ddfc
% --- Executes on button press in dsec.
function dsec_Callback(hObject, eventdata, handles)
% hObject handle to dsec (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%deconsec=get(handles.dsec,'Value')
%if(deconsec==1)
% Controls_together_decon
% PTSD_together_decon
% secout_decon
%data_create_sec_decon
%end
% Hint: get(hObject,'Value') returns toggle state of dsec
% --- Executes on button press in SVMradio.
function SVMradio_Callback(hObject, eventdata, handles)
% hObject handle to SVMradio (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 SVMradio
% --- Executes on button press in RCEradio.
function RCEradio_Callback(hObject, eventdata, handles)
% hObject handle to RCEradio (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 RCEradio
% --- Executes when selected object is changed in rcesvm.
function rcesvm_SelectionChangedFcn(hObject, eventdata, handles)
% hObject handle to the selected object in rcesvm
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
blah=get(handles.rcesvm,'SelectedObject');
selecti=get(blah,'String');
switch selecti
case 'Without RCE'
set(handles.uibuttongroup5,'Visible','Off');
%set(handles.checkbox13,'Enable','On');
case 'With RCE'
set(handles.uibuttongroup5,'Visible','On')
% set(handles.checkbox13,'Enable','Off');
end
% --- Executes on button press in checkbox8.
function checkbox8_Callback(hObject, eventdata, handles)
% hObject handle to checkbox8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
handles.HPS=1;
dsf=get(handles.checkbox8,'Value');
if(dsf==1)
handles.DSF = true;
else
handles.DSF= false;
set(handles.checkbox10,'Enable','Off');
end
guidata(hObject, handles);
assignin('base','DSF',handles.DSF);
%if((handles.HPS==true) && (handles.DSF==true))
% set(handles.checkbox10,'Enable','On')
%end
%Hint: get(hObject,'Value') returns toggle state of checkbox8
% --- 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)
handles.DSF=1;
hps=get(handles.checkbox9,'Value');
if(hps==1)
handles.HPS=true;
else
handles.HPS=false;
set(handles.checkbox10,'Enable','Off');
end
guidata(hObject, handles);
assignin('base','HPS',handles.HPS);
if((handles.HPS==true) && (handles.DSF==true))
set(handles.checkbox10,'Enable','On');
elseif((handles.DSF==false) | (handles.HPS==false))
set(handles.checkbox10,'Enable','Off');
elseif((handles.HPS==true) && (handles.DSF==true))
set(handles.checkbox10,'Enable','On');
end
%if(handles.DSF==false)
% set(handles.checkbox10,'Enable','Off')
%end
%if(handles.HPS==false)
%set(handles.checkbox10,'Enable','Off')
%end
% Hint: get(hObject,'Value') returns toggle state of checkbox9
% --- Executes on button press in checkbox10.
function checkbox10_Callback(hObject, eventdata, handles)
% hObject handle to checkbox10 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
madc=get(handles.checkbox10,'Value');
if(madc==1)
handles.MADC=true;
else
handles.MADC=false;
end
guidata(hObject, handles);
assignin('base','MADC',handles.MADC);
% Hint: get(hObject,'Value') returns toggle state of checkbox10
% --- Executes on button press in checkbox11.
function checkbox11_Callback(hObject, eventdata, handles)
% hObject handle to checkbox11 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%ssp=get(handles.checkbox11,'Value')
%if(ssp==1)
% handles.SSP=true
%else
% handles.SSP=false
%end
%guidata(hObject, handles);
%assignin('base','SSP',handles.SSP)
% Hint: get(hObject,'Value') returns toggle state of checkbox11
% --- Executes on button press in run.
function run_Callback(hObject, eventdata, handles)
% hObject handle to run (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
addpath(genpath(pwd));
Filepath=pwd;
warning('off','all');
dsf=get(handles.checkbox8,'Value');
if(dsf==1)
handles.DSF = true;
else
handles.DSF= false;
end
guidata(hObject, handles);
assignin('base','DSF',handles.DSF);
hps=get(handles.checkbox9,'Value');
if(hps==1)
handles.HPS=true;
else
handles.HPS=false;
end
guidata(hObject, handles);
assignin('base','HPS',handles.HPS);
%dsf=get(handles.checkbox8,'Value')
%hps=get(handles.checkbox9,'Value')
%if(dsf == 1 && hps==1)
% set(handles.checkbox10, 'Enable','On')
%end
madc=get(handles.checkbox10,'Value');
if(madc==1)
handles.MADC=true;
else
handles.MADC=false;
end
guidata(hObject, handles);
assignin('base','MADC',handles.MADC);
ssp=get(handles.checkbox11,'Value');
if(ssp==1)
handles.SSP=true;
else
handles.SSP=false;
end
guidata(hObject, handles);
assignin('base','SSP',handles.SSP);
if exist('nofo')
nofo=handles.nofo;
assignin('base','nofo',handles.nofo);
end
if exist('nocl')
nocl=handles.nocl;
assignin('base','nocl',handles.nocl);
end
if exist('resa')
resa=handles.resa;
assignin('base','resa',handles.resa);
end
%hypeelm=handles.hypeelm;
DSF=handles.DSF;
HPS=handles.HPS;
MADC=handles.MADC;
SSP=handles.SSP;
%IIP=handles.IIP;
%lmn=handles.lmn;
if exist('YourFile')
YourFile=handles.YourFile;
end
% global folder_name;
% folder_name=handles.folder_name;
global data_folder_name;
data_folder_name=get(handles.edit1,'string'); %folder_name = handles.folder_name;
global folder_name;
folder_name=data_folder_name;
%if(handles.DSF==1 && handles.HPS==1)
%set(handles.MADS, 'Enable','On')
%end
if exist('lowv')
lowv=handles.lowv;
assignin('base','lowv',handles.lowv);
end
if exist('incred')
incred=handles.incred;
assignin('base','incred',handles.incred);
end
if exist('uppe')
uppe=handles.uppe;
assignin('base','uppe',handles.uppe);
end
global fincl incl deccl epat;
if exist('lowto')
lowto=handles.lowto;
end
if exist('incredto')
incredto=handles.incredto;
end
if exist('uppeto')
uppeto=handles.uppeto;
end
deco=get(handles.deconvolution,'Value');
% if(deco==1|tmse==1)
%
%end
tmse = get(handles.time_series,'Value');
if(tmse == 1|tmse==2|tmse==3|tmse==4)
templa=handles.templa;
% msgbox('wait for couple of minutes')
Extract_timeseries
%msgbox('extraction done, choose sfc, dec, sec, dec')
end
stfc = get(handles.sfc,'Value');
if(stfc == 1)
subjects_together;
staticFC_individual;
data_create_sfc;
randasp_sfc;
global idod;
idod='Results_sfc_';
cool;
clear idod;
end
dyfc = get(handles.dfc,'Value');
if(dyfc == 1)
subjects_together;
dfcout;
data_create_dfc;
randasp_dfc;
global idod;
idod='Results_dfc_';
cool;
clearvars idod;
end
stec=get(handles.sec,'Value');
if(stec == 1)
subjects_together;
secout;
data_create_sec;
randasp_sec;
global idod;
idod='Results_sec_';
cool;
clearvars idod;
end
deco=get(handles.deconvolution,'Value');
if(deco==1)
mat_extraction;
perform_dec;
after_perform_dec;
post_decon_extract_timeseries;
end
deconsec=get(handles.dsec,'Value');
if(deconsec==1)
subjects_together_decon;
secout_decon;
data_create_sec_decon;
randasp_decon_sec;
global idod;
idod='Results_decon_sec_';
cool;
clearvars idod;
end
deconsfc=get(handles.dsfc,'Value');
if(deconsfc==1)
subjects_together_decon;
staticFC_decon_individual;
data_create_decon_sfc;
randasp_decon_sfc;
global idod;
idod='Results_decon_sfc_';
cool;
clearvars idod;
end
decondfc=get(handles.ddfc,'Value');
if(decondfc==1)
subjects_together_decon;
dfcout_decon;
data_create_decon_dfc;
randasp_decon_dfc;
global idod;
idod='Results_decon_dfc_';