Analysing brain blood flow

In a previous post I described how to use ultrasound to measure brain blood flow. So, the data has been gathered. To recap, this is what it looks like:

tcd

Now what? How do we analyse this? Some ultrasound machines have their own analysis software that can be used to determine whether the blood flow is normal. Usually, it requires training and experience to interpret ultrasound results for diagnostic or healthcare purposes, even with custom software. For research purposes, however, things are a bit different. The custom software may not always be what we are looking for, and diagnosis may not always be the end-game. In my research, I analyse beat-by-beat blood flow velocity in healthy participants, looking how this changes over time. I have used custom Matlab scripts to analyse these, using quite simple steps:

  1. Export the data in .dat or .txt format. This will depend on the software, and I have found it easiest to work with machines that allow direct (during data collection) connection with a computer, feeding into Spike, LabChart or similar programs, as I know how to export data from such software without any fuss.
  2. Read the data file in MATLAB (or similar), then follow these processing steps
    1. Visualise the data. I always look at my data before I start working on it. This helps figuring out the quality, and making sure I’ve measured what I think I have measured.
    2. Smooth the data. No data is perfect, and TCD data can be quite noisy for a number of reasons. While smoothing helps getting rid of some of these issues, I prefer to smooth as little as possible.
    3. Remove any gaps. There may be gaps in the data file where the probe had to be shifted for gel application or similar. These can be removed manually or you can use a threshold (lower and higher, outside of the physiological range). I prefer to automate as much as possible, both because I don’t want the hassle and I want to avoid the potential bias that comes with manual changes. I tend to visualise the datafile whenever using thresholds, to make sure the data looks fine, and I use the same threshold for all subjects.
    4. Remove extra noise? If the data is particularly noisy, a second threshold excluding values that are greater/smaller than e.g. 1 standard deviation from the rest of the window should be helpful in removing noise. This should get rid of peaks arising from shifting the probe or applying more gel.
    5. Find the min and max values. I typically run a for loop for this, tagging all the min and max values (creating vectors for tags, values and time). While it may not be the most elegant method, I prefer to find the values by creating a window moving through the datafile, using an if statement to tag only values that are higher (max) or lower (min) than the other values in the window. I tend to use +/- 40 data points if the acquisition rate is about 50 Hz. I visualise the min/max values superimposed on the raw data to make sure I have correctly identified the values. This is where it is important not to have smoothed too much, because that flattens the wave and you might end up with several similar values and shifted/non-existing peaks/troughs.
    6. Identify the waveforms. I run a for loop to identify full waveforms, using the tags created in the step above. If the min values are tagged ‘0’ and the max values ‘1’, then a waveform would be identified by a 0-1-0 sequence (with an appropriate if statement excluding datapoints that are too far apart in terms of time to avoid any misclassifications across several waveforms).
    7. Calculate what you are looking for. With these vectors, means can be calculated (or systolic values, diastolic values, R-R intervals and so on). Means can be calculated as follows: Mean CBFV = (PSV + [EDV × 2])/3, where CBFV is cerebral blood flow velocity, PSV is peak systolic velocity (the max value of the waveform), and EDV is end-diastolic velocity (the second min value in the waveform). These are highlighted in the figure above. Just for reference, average adult mean flow velocity is 46-86 cm/sec.
  3. Rinse and repeat for all participants

 

Further reading:

Advances in Transcranial Doppler US: Imaging Ahead Jonathan D. Kirsch, et. al. RadioGraphics 2013; 33:E1–E14. Link.

Purkayastha, S. & Sorond, F. (2012) Transcranial Doppler Ultrasound: Technique and Application. Semin Neurol. 32(4): 411–420. Link.

161px-Matlab_Logo

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s