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

Private GIT Repository
relecture vlad de 0 a 70
[these_gilles.git] / THESE / codes / meanshift / Ms_segmenter / Operation_prompt_right.m
1 if Region_right{I} == 0\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_right{I} = base2dec(Regions_disp{1}, 10);                % to correspond\r
24                 Choice_right = uicontrol('Parent', New_wind);\r
25                 Call_back_right = ...\r
26                 sprintf('Segment_demo(''Right'', %18.16f, %d)', Choice_right, I);\r
27                 set(Choice_right, 'Style', 'Popup', 'String', Regions_disp, ...\r
28                 'Units', 'Normalized', 'Position', [0.55 0.5 0.45 0.5], ...\r
29                 'Callback', Call_back_right);\r
30                 Ok_button = uicontrol('Parent', New_wind, ...\r
31               'String', 'OK', 'Style', 'Pushbutton', ...\r
32               'Units', 'Normalized', 'Position', [0.1 0 0.3 0.4]);\r
33         end\r
34         \r
35         Callback=sprintf('Segment_demo(''%s'',%d,%d)', 'Cancel operation', 0, I);\r
36         Cancel_button = uicontrol('Parent', New_wind, ...\r
37            'String', 'Cancel', 'Style', 'Pushbutton', 'Callback', Callback, ...\r
38            'Units', 'Normalized', 'Position', [0.6 0 0.3 0.4]);\r
39 else\r
40         Interactive = 0;\r
41 end\r