How to plot time intensity curves from doppler waveform images?

4 visualizaciones (últimos 30 días)
Samay Mehta
Samay Mehta el 19 de Feb. de 2022
Respondida: Brahmadev el 9 de Feb. de 2024
How to plot time intensity curves from doppler waveform images? Basically I want to work out the intensity of each beat on the doppler and plot how the colour intensity changes over a 5 minute period (there will probably be about 600 beats during a 5 minute period so to manually select 600 beats and find out the average brightness will be too time consuming). Is there a more automated way to do this? I have software which can put a blue line that traces the doppler so basically work out average intensity below that line for each beat.
  2 comentarios
Image Analyst
Image Analyst el 19 de Feb. de 2022
What data do you have? Numerical data? A text file of numbers? A workbook with the signal in it? An RGB image like you have above? What is the form of the best possible data you can export from your instrument?
Attach it with the paperclip icon after you read this:
Samay Mehta
Samay Mehta el 5 de Mzo. de 2022
Hi, apologies for such a delayed reply. I was locked out of my account. Thank you for replying so quickly.
Okay so basically I initally had .sdy files which was a recording of a patient's doppler flow waveform. I have screen recorded the file so i have the flow doppler on a video file format too (.wmv) - the doppler flow looks like the image i have shown in the previous message. I have also screenshotted various parts during the recording so have it in image file formats too.
So basically just as some background - the patients doppler waves were low intensity (I think this is like brightness/whiteness) before injecting contrast and higher intensity after giving contrast. So i wanted to take an average of lets say 20 beats of doppler waves for before contrast and also same for after contrast and work out the average intensity of the waves. But i don't know if theres a way to automatically get a software to outline the waves and then produce a number for intensity.
Do you have any ideas?
Look forward to your thoughts.

Iniciar sesión para comentar.

Respuestas (2)

Avni Agrawal
Avni Agrawal el 9 de Feb. de 2024
Hi Samay,
I understand that you are trying to plot time intenstiy curves from doppler waveform images.The Doppler-Time Intensity Scope block creates a scrolling display of Doppler response intensities as a function of time. The input consists of Doppler responses for a pulse or FMCW signal. Each frame of data creates a new line on the scope. The scope serves only as a display of the Doppler response. Using the response as input corresponds to setting the IQDataInput property of the phased.DTIScope System objec to false.
Please take a look at this documentation for better understanding: https://www.mathworks.com/help/phased/ref/dopplertimeintensityscope.html

Brahmadev
Brahmadev el 9 de Feb. de 2024
As per my understanding, you have '.wmv' file that you would like to read it 600 times in 5 minutes. Post this, you would like to find an average of of the doppler traces of all the beats. Without the data used for plotting the traces, this can be done by taking the average of the pixels, given that the color of the trace is known.
fileName = 'dopplerWaveform.wmv'; % Change filename to your file name.
v = VideoReader(filename, 'VideoFormat', 'Grayscale'); % Read image as Grayscale
VideoLength = length(read(v))/30; % Length of video in seconds
FrameToRead = 600;
firstFrame = read(v, 1);
runningAverage = zeros(1, length(firstFrame)); % Defining an array of the length of the video in pixels
% Iterating through the frames
for k = 1:VideoLength
videoFrame = read(v, 30*k); % reads every 30th frame in v, so that we get two samples per second (or 600 samples in 5 minutes)
% Create the trace using software that you have mentioned above. This
% can also be done using Edge Detection. Now the frame dimensions
% become H-by-W-by-3
H = size(videoFrame, 1);
W = size(videoFrame, 2); % == length(firstFrame)
% Assuming the color of the trace is known
colorTrace = [0, 255, 255]; % Replace with the color of trace in your case.
TraceVal = zeros(1, length(firstFrame));
% Iterate through each image and find the pixels with the color colorTrace
for y = 1:H
for x = 1:W
if videoFrame(H, W, :) == colorTrace
TraceVal(x) = y;
break;
end
end
end
runningAverage = runningAverage+TraceVal;
end
runningAverage = runningAverage/600;
Using this method an average for the trace over multiple beats can be created. Further this can be plotted to visualize the average. Also, you can refer to the following documentations for more information on the functions used:
  1. "VideoReader": https://www.mathworks.com/help/matlab/ref/videoreader.html
  2. "read": https://www.mathworks.com/help/matlab/ref/videoreader.read.html
Hope this helps in resolving your query!

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by