[81c116]: / Loading_script.m

Download this file

72 lines (52 with data), 2.9 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
% Varargin is the input data path to the GUI.
% Varargin can be either if these options.
% Varargin = 1 to load a simulaion file of B mode image.
% Varargin = 2 to load a simulaion file of Pulsed Doppler Data.
% Varargin is the path to the file to load.
% if the input path == 1 or 2, pre-loaded files from the workspace will
% be loaded. We call it simulation.
if all(varargin{1} == 1) || all(varargin{1} == 2)
% Set this variable to true for simulation
handles.simulation = true;
% Dummy Save Path. Data will not be saved for simulation platforms
handles.save_path = '';
switch(varargin{1})
case 1
% if input path = 1, b mode images will be loaded.
% Load data from the program folder
load('bframe_sample.mat', 'bframe');
% This variable is set to true if the input is bmode.
handles.Bmode = true;
% Random Frame rate of the B-mode scan
Fs = 43;
% Random Resolution of the Y axis of the B-mode scan
handles.dy = 0.1;
% Time stap for each frame % [Unit: seconds]
handles.time = (0:1/Fs:(size(bframe,3)-1)/Fs)';
% Update handles about the current position
handles.Message_Bar.String = "Loaded Simulation Data for b-mode images";
handles.Waveform_Title.String = "Diameter [not calibrated] Vs Time ";
handles.Play_Button.String = 'Process B-Mode data';
otherwise
% if input path = 2, pulsed doppler data will be loaded.
load('pulsed_doppler_frame.mat', 'dataout');
% This variable is set to true if the input is bmode.
handles.Bmode = false;
% Title of the reults plots
handles.Waveform_Title.String = "Velocity [m/s] Vs #Frame";
% Extract pulsed Doppler data
script_extract_Pulse_Doppler_data;
% Time steps as Frame number
handles.time = (1:Num_Time_Stamps)';
% Update handles about the current position
handles.Message_Bar.String = "Loaded Pulsed Doppler Data";
handles.Play_Button.String = 'Process Pulsed Doppler Data';
end
else
% Set this variable to true for simulation
handles.simulation = false;
% Load the data from DICOM files. This script assumes that the input is
% DICOM images/data recorded from Philips machine. If you have
% images/data from other machines, modify this code.
script_load_data_from_dicom;
end