[81c116]: / script_put_rectangle_on_image.m

Download this file

36 lines (29 with data), 1.5 kB

 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
% update the Number of Rectangular boxes.
handles.number_Box = handles.number_Box + 1;
% This if-else condition is to address the initializtion scripts.
[Current_Num, Previous_Num] = script_adjust_NUM_for_intialization(handles.number_Box);
% Rectangular mask for proximal wall
Rect_proximal = images.roi.Rectangle(gca,...
'Position', [randi([100 300],1) 50 50 50],...
'RotationAngle', 0, ...
'StripeColor','r', ...
'Label', sprintf('%d', handles.number_Box), ...
'LabelTextColor', 'r', ...
'LineWidth', 5, ...
'FaceAlpha', 0, ...
'Rotatable', true, ...
'Parent', handles.Plot_Image);
% Rectangular mask for distal wall
Rect_distal = images.roi.Rectangle(gca,...
'Position', [randi([100 300],1) 400 50 50],...
'RotationAngle', 0, ...
'StripeColor','y', ...
'Label', sprintf('%d', handles.number_Box), ...
'LabelTextColor', 'y', ...
'LineWidth', 5, ...
'FaceAlpha', 0, ...
'Rotatable', true, ...
'Parent', handles.Plot_Image);
% Update the handle to load the Rect object to the current box
handles.Rect_proximal(Current_Num, 1) = Rect_proximal;
handles.Rect_distal(Current_Num, 1) = Rect_distal;