a b/set_the_variables_update_handles.m
1
% This function intializes all the variables
2
3
% Choose default command line output for Ultrasound_Analyse
4
handles.output  = hObject;
5
6
% Run this script to load the data.
7
% If the input is a bmode images, data is saved as "b_frame"
8
% if the input is Pulsed Dopper data, data is saved as "Velocity_Data"
9
Loading_script;
10
11
% If the file does not exist, close the GUI
12
if handles.simulation == false && handles.file_exist == false
13
    return;
14
end
15
16
% This variable will be used in all codes.
17
Processed_Input(:, :, :)    = bframe;
18
19
% Save one frame for quick processing
20
handles.first_frame         = Processed_Input(:, :, 1);
21
22
% Number of Rectangular boxes.
23
% The count starts from -1 just to adjust for initializtion script.
24
handles.number_Box           = 0;
25
26
% Saving this variable in workspace 
27
%save('Processed_Input.mat', 'Processed_Input', '-v7.3');
28
handles.Processed_Input     = Processed_Input; 
29
30
% Save the diameter waveform from each frame in this variable
31
handles.Mean_diameter_in_metric = ones(size(Processed_Input, 3), 1) * nan;
32
33
% Update handles about the current position
34
handles.Rect_Proximal_Position              = [];%[size(Processed_Input, 1)/4,size(Processed_Input, 2)/6, 50, 50];
35
handles.Rect_Distal_Position                = [];%[size(Processed_Input, 1)/4,size(Processed_Input, 2)*2/3, 50, 50];
36
handles.Rect_distal_Rotation_in_degree      = [];%0;
37
handles.Rect_proximal_Rotation_in_degree    = [];%0;
38
39
% Initialize the axes with the first frame 
40
imagesc(handles.first_frame, 'Parent', handles.Plot_Image); 
41
42
if(handles.Bmode)
43
    % Input is a B mode image
44
    colormap(handles.Plot_Image, 'gray'); 
45
else
46
    % Input is a Pulsed Doppler data
47
    set(gca,'YDir','normal');
48
end
49
50
% Run this script to put the "Box" on the images
51
%script_put_rectangle_on_image
52
53
% Update the Threshold based on the new end values of the slider, stops any
54
% running timers, update box locations
55
script_update_Threshold_and_display;