-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCreate_wind_for_substim_test.m
63 lines (48 loc) · 3.54 KB
/
Create_wind_for_substim_test.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
h7 = figure('Color','white','units', 'normalized','Position',[.05 0.05 .9 .95],'Name',All_info.data(Num_fam).name ,'MenuBar', 'none','ToolBar', 'none','CloseRequestFcn',@Delete_h7); % ,'WindowStyle','modal');
temp = All_Stims_choosen_to_fit.data{1,Num_fam};
[n1,n2] = size(temp);
Array_choose_stims_fam = cell(n1,n2);
for j = 1 : n2
for u= 1: n1
if temp(u,j)
[ left bottom width height] = Dimensionate_frame(zeros(n1,n2),u,j);
Bool_select = (All_Stims_choosen_to_fit.data{1,Num_fam}(u,j) == 2);
if Bool_select
Colr = [0 1 0];
else
Colr = [1 1 1];
end
str = [All_info.data(Num_fam).ylabs{u},', ',All_info.data(Num_fam).xlabs{j}];
Array_choose_stims_fam{u,j} = uicontrol('style','checkbox','units','normalized','position',[ left bottom width height],'BackgroundColor',Colr,'Value',1,'string',str,'callback',{@Select_specific_stims, All_Stims_choosen_to_fit, Num_fam, All_info,All_Stims_choosen_to_test});
All_Stims_choosen_to_test.data{Num_fam}(u,j) = 2; % I initialize everithing at 1...
end
end
end
butt_Validate_and_close = uicontrol('Style','pushbutton','units', 'normalized','position', [0.85 0.02 0.1 0.05],'String','Validate and close ','callback',{@Validate_and_close,h7});
uiwait(h7)
function Select_specific_stims(object_handle, event, All_Stims_choosen_to_fit, Num_fam, All_info,All_Stims_choosen_to_test)
%%%%% All_Stims_choosen_to_fit, Num_fam
temp = All_Stims_choosen_to_fit.data{1,Num_fam};
[n1,n2] = size(temp);
Array_choose_stims = cell(n1,n2);
for j = 1 : n2
for u= 1: n1
if temp(u,j)
Array_choose_stims{u,j} = [All_info.data(Num_fam).ylabs{u},', ',All_info.data(Num_fam).xlabs{j}];
end
end
end
Index_stim = find(strcmp(event.Source.String, Array_choose_stims));
if event.Source.Value
All_Stims_choosen_to_test.data{Num_fam}(Index_stim) = 2;
else
All_Stims_choosen_to_test.data{Num_fam}(Index_stim) = 1; %All_info.data(Num_fam).Index_stim;
end
%%%%% [All_info.data(Num_fam).ylabs{u},', ',All_info.data(Num_fam).xlabs{j}]
end
function Validate_and_close(object_handle, event, h7)
Delete_h7(h7);
end
function Delete_h7(object_handle, event)
delete(object_handle)
end