a b/script_extract_Pulse_Doppler_data.m
1
% itype = 2 for Pulsed Wave Doppler data
2
itype                       = 2;
3
4
% Velocity Distribution [Units = cm/s]
5
Velocity_axis               = linspace(0, dataout{itype}.meta{1}.Vrange(2), size(dataout{itype}.img{1}, 1))';
6
7
% Spectogram [Rows represents the Velocity and columns are the time stamp]
8
Pulsed_Doppler_Data         = 10*log10(dataout{itype}.img{1}(:,:) + 1);
9
10
% Total number of time stamps
11
Num_Time_Stamps             = size(Pulsed_Doppler_Data, 2);
12
13
%%Plot the spectogram
14
%imagesc((1:Num_Time_Stamps)', Velocity_axis, Pulsed_Doppler_Data); set(gca,'YDir','normal');
15
16
% Find the maximum of the Pulsed Doppler data in each column .
17
% Here, Column represents the time stamps.
18
B = find(Pulsed_Doppler_Data == max(Pulsed_Doppler_Data), size(Pulsed_Doppler_Data, 2), 'first');
19
20
% Repeat the velocity vector for each column
21
new_Velocity_axis           = repmat(Velocity_axis, [1, size(Pulsed_Doppler_Data, 2)]);
22
23
% Calculate the velcotiy data [Units = m/s]
24
handles.Velocity_Data       = new_Velocity_axis(B)/100;
25
26
bframe                      = Pulsed_Doppler_Data;
27
% This saves the single frame 
28
%bframe                      = permute(dataout{1}.img{1}, [2, 1, 3]);