Switch to unified view

a b/script_put_rectangle_on_image.m
1
% update the Number of Rectangular boxes.
2
handles.number_Box          = handles.number_Box + 1;
3
4
% This if-else condition is to address the initializtion scripts.
5
[Current_Num, Previous_Num] = script_adjust_NUM_for_intialization(handles.number_Box);
6
7
% Rectangular mask for proximal wall
8
Rect_proximal = images.roi.Rectangle(gca,...
9
                    'Position', [randi([100 300],1) 50 50 50],...
10
                    'RotationAngle', 0, ...
11
                    'StripeColor','r', ...
12
                    'Label', sprintf('%d', handles.number_Box), ...
13
                    'LabelTextColor', 'r', ...
14
                    'LineWidth', 5, ...
15
                    'FaceAlpha', 0, ...
16
                    'Rotatable', true, ...
17
                    'Parent', handles.Plot_Image);
18
19
% Rectangular mask for distal wall
20
Rect_distal = images.roi.Rectangle(gca,...
21
                    'Position', [randi([100 300],1) 400 50 50],...
22
                    'RotationAngle', 0, ...
23
                    'StripeColor','y', ...
24
                    'Label', sprintf('%d', handles.number_Box), ...
25
                    'LabelTextColor', 'y', ...
26
                    'LineWidth', 5, ...
27
                    'FaceAlpha', 0, ...
28
                    'Rotatable', true, ...
29
                    'Parent', handles.Plot_Image);
30
31
% Update the handle to load the Rect object to the current box
32
handles.Rect_proximal(Current_Num, 1)   = Rect_proximal;
33
handles.Rect_distal(Current_Num, 1)     = Rect_distal;
34
35