|
a |
|
b/demoTriplex.m |
|
|
1 |
% Example of using DICOMReaderGeneral and DICOMPhysioReader to parse native |
|
|
2 |
% streams from DICOM files. |
|
|
3 |
|
|
|
4 |
fn = 'pw_ecg'; |
|
|
5 |
[native,dataout,params] = DICOMReaderGeneral(fn); |
|
|
6 |
|
|
|
7 |
%% triplex |
|
|
8 |
figure(1); |
|
|
9 |
for i1 = 1:size(dataout{1}.img{1},3) |
|
|
10 |
Xvec = linspace(0,size(dataout{1}.img{1},1)*dataout{1}.meta{1}.res(1),size(dataout{1}.img{1},1)); |
|
|
11 |
Yvec = linspace(0,size(dataout{1}.img{1},2)*dataout{1}.meta{1}.res(2),size(dataout{1}.img{1},2)); |
|
|
12 |
subplot(221); imagesc(Xvec,Yvec,dataout{1}.img{1}(:,:,i1)'); axis image; title(sprintf('B-Mode'));xlabel('Azimuth [mm]'); ylabel('Range [mm]'); |
|
|
13 |
t_spectrogram = linspace(0,size(dataout{2}.img{1},1)*dataout{1}.meta{1}.res(1)./dataout{2}.meta{1}.Xres,size(dataout{2}.img{1},2)); |
|
|
14 |
v_spectrogram = linspace(dataout{2}.meta{1}.Vrange(1),dataout{2}.meta{1}.Vrange(2),size(dataout{2}.img{1},1)); |
|
|
15 |
subplot(222); imagesc(t_spectrogram,v_spectrogram,SP); set(gca,'YDir','normal'); |
|
|
16 |
xlabel('Time [s]'); ylabel('Velocity [cm/s]'); title(sprintf('Spectral Doppler')); |
|
|
17 |
subplot(223); imagesc(Xvec,Yvec,dataout{3}.img{1}(:,:,i1)'); axis image; title(sprintf('Color Power')); xlabel('Azimuth[mm]'); ylabel('Range [mm]'); colorbar; |
|
|
18 |
colormap gray; drawnow; |
|
|
19 |
end |
|
|
20 |
|
|
|
21 |
physio = DICOMPhysioReader(fn); |
|
|
22 |
figure(1); subplot(224); |
|
|
23 |
plot(physio.time/physio.timerResolution,physio.channels(:,1)); |
|
|
24 |
isRPeak = find(physio.isRPeak); |
|
|
25 |
hold on; plot(physio.time(isRPeak)/physio.timerResolution,physio.channels(isRPeak,1),'rv'); |
|
|
26 |
xlabel('Time [s]'); ylabel('ECG Amplitude'); axis tight; |
|
|
27 |
legend('ECG I','RPeak Detection'); |