]> AND Private Git Repository - these_gilles.git/blob - THESE/codes/meanshift/Ms_segmenter/Operation_prompt.m
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
11 oct
[these_gilles.git] / THESE / codes / meanshift / Ms_segmenter / Operation_prompt.m
1 if Region_left{I} == 0  % region was not chosen via "Select"\r
2         % prompt for an operation - one region only\r
3         Scr_sz = get(0, 'ScreenSize');\r
4         New_wind = dialog('Name', 'Choose region(s)', 'Position', ...\r
5            [Scr_sz(3)*0.3 Scr_sz(4)*0.4 Scr_sz(3)*0.3 Scr_sz(4)*0.1]);\r
6         \r
7         k = 0;  Ok_button = 0;  Interactive = 1;\r
8         if Show_all_regions{I}          % not just active\r
9                 k = Bndred_regions{I};\r
10                 for i=1:Bndred_regions{I}\r
11                           Regions_disp{i} = sprintf('%d', i);\r
12                 end\r
13         else\r
14           for i=1:Bndred_regions{I}\r
15                   if Regions{I}{i}.Private.Active\r
16                           k = k+1;\r
17                           Regions_disp{k} = sprintf('%d', i);\r
18                   end\r
19           end\r
20         end\r
21         \r
22         if k > 0\r
23                 Region_left{I} = base2dec(Regions_disp{1}, 10);         % to correspond\r
24                 Choice_left = uicontrol('Parent', New_wind);\r
25                 Call_back_left=sprintf('Segment_demo(''Left'',%18.16f,%d)', Choice_left, I);\r
26                 set(Choice_left, 'Style', 'Popup', 'String', Regions_disp, ...\r
27                         'Units', 'Normalized', 'Position', [0 0.5 0.45 0.5], ...\r
28                         'Callback', Call_back_left);\r
29                 Ok_button = uicontrol('Parent', New_wind, ...\r
30               'String', 'OK', 'Style', 'Pushbutton', ...\r
31               'Units', 'Normalized', 'Position', [0.1 0 0.3 0.4]);\r
32         end\r
33         \r
34         Callback=sprintf('Segment_demo(''%s'',%d,%d)', 'Cancel operation', 0, I);\r
35         Cancel_button = uicontrol('Parent', New_wind, ...\r
36            'String', 'Cancel', 'Style', 'Pushbutton', 'Callback', Callback, ...\r
37            'Units', 'Normalized', 'Position', [0.6 0 0.3 0.4]);\r
38 else\r
39         Interactive = 0;\r
40 end\r