-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample.m
36 lines (31 loc) · 1.39 KB
/
example.m
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
% Enable GPU processing
GPU = true;
% Load MVnet networks
load(fullfile(pwd, 'models', 'MVnet_2ch_1st.mat'));
load(fullfile(pwd, 'models', 'MVnet_2ch_2nd.mat'));
load(fullfile(pwd, 'models', 'MVnet_4ch_1st.mat'));
load(fullfile(pwd, 'models', 'MVnet_4ch_2nd.mat'));
% Load anonymized dicom data from a subject
data_sample_path_2ch = fullfile(pwd, 'data_sample', '2ch');
data_sample_path_4ch = fullfile(pwd, 'data_sample', '4ch');
[IM_2ch, Rxy_2ch, TimeVector_2ch] = MVnet_functions('load_dicom_data', data_sample_path_2ch);
[IM_4ch, Rxy_4ch, TimeVector_4ch] = MVnet_functions('load_dicom_data', data_sample_path_4ch);
% Track the mitral valve valve
MV_2ch = MVnet_functions('pipeline',IM_2ch,Rxy_2ch,MVnet_2ch_1st,MVnet_2ch_2nd,GPU);
MV_4ch = MVnet_functions('pipeline',IM_4ch,Rxy_4ch,MVnet_4ch_1st,MVnet_4ch_2nd,GPU);
% Derive clinical metrics
[MVdist, MVvel, MAPSE, MVs, MVe, MVa] = MVnet_functions('get_clinical', ...
MV_2ch, MV_4ch, Rxy_2ch, TimeVector_2ch, Rxy_4ch, TimeVector_4ch);
% Visualize the tracking
figure,
for i=1:size(MV_4ch,1)
subplot(1,2,1),
imagesc(IM_2ch(:,:,i)),colormap(gray), axis image, hold on,
plot(MV_2ch(i,2),MV_2ch(i,1),'*r'), hold on,
plot(MV_2ch(i,4),MV_2ch(i,3),'*g'),
subplot(1,2,2),
imagesc(IM_4ch(:,:,i)),colormap(gray), axis image, hold on,
plot(MV_4ch(i,2),MV_4ch(i,1),'*r'), hold on,
plot(MV_4ch(i,4),MV_4ch(i,3),'*g'),
pause(0.2);
end