Topic: Blood Pressure Triggering System for MRI
I'm an engineering student working in collaboration with a group of scientists in a major Canadian hospital. The goal of this project is to build an open-source triggering system for retrospective gating in fetal MRI. I think that this project will be of interest here, so I've decided to keep an build log here.
The data collection rate of MRI is very slow. This means that when imaging the heart, the image will be subject to substantial motion artifact. The solution to this problem is a technique known as retrospective gating. In retrospective gating, MR compatible ECG leads connect the patient directly to the scanner. This allows the scanner to synchronize it's data collection with the cardiac cycle, and the result is a video of the heart with reasonable quality.
ECG signals are well suited to being used for cardiac gating, because they are highly consistent, easy to collect in a non-invasive manner, they're an electrical signal, so they propagate quickly, and they have nice sharp points that lend themselves well to digital signal processing. By comparison, blood pressure is relatively inconsistent, propagates slowly, and is substantially more difficult to process in real time.
For our upcoming experiments in the MR lab, we are attempting to image fetal hearts prenatal (first in animals). It is essentially impossible to acquire an ECG signal of sufficient quality from a fetal heart, so we're going to be using blood pressure wave-forms instead.
My goal is to design a system with Arduino due which will collect this waveform from an instrumentation pathway, process the signal in real time, and send a 5V TTL signal in real time to scanner at consistent point in the pressure waveform after every heartbeat.
The pressure waveform is collected by an MR compliant pressure catheter, amplified and converted into a 625Hz digital signal by a proprietary signal conditioning unit.
Triggering the MRI requires a 5V TTL pulse signal applied for >2ms through an audio style connector
The unit's pulse detection sensitivity must be manually adjustable by the experimenter to ensure that it doesn't fire too often or miss beats.
The Arduino must send sample values and the precise timing of its trigger pulses to an attached computer in near real time, so that the scanner operator can tell whether or not the system is operating properly. This data is also useful for diagnostic and algorithm testing purposes, so it must be permanently saved.
The system must be sufficiently robust that it will continue to operate properly without code modification or rewiring after I leave my research position.
My code for this project is stored here: https://github.com/JoshBradshaw/mriTriggering/
WHAT I'VE ACCOMPLISHED SO FAR
Low pass filter of the input signal using a modified version of the arduino signal filtering library.
Detection of the pressure peaks on the waveform using a modified version of the slope-sum function algorithm (developed at MIT, paper named in my code) and a naive peak detection algorithm. This algorithm detects the peaks with ~20ms delay, which is acceptable for our application because that the latency is consistent. This software was tested against the pressure waveforms in the SLPDB: http://physionet.org/physiobank/database/slpdb/slpdb.shtml
TODO: provide an image representing the output of the algorithm in response to standard blood pressure pulses
- A working prototype in which I run the peak detection code on the Arduino, and simulate the pressure waveform using a digital arbitrary waveform generator connected to Analog Input 1.
WHAT I'M WORKING ON NOW
Adding a level shifter to the 3.3V digital output to amplify it to 5V.
Using a USB host shield to read in the digital pressure values from our signal conditioning module (the output is very similar to the digial scale in this tutorial: http://www.circuitsathome.com/mcu/adding-a-display-to-a-digital-scale-using-arduino-and-usb-host-shield so that will be my starting place)
Collecting some more data to test the system with in collaboration with the cardiology department of the hospital.
Attaching connectors to the Arduino so that lab techs will be able to connect and switch cables easily.
Building a housing to store the finalized device in that will make it easy to transport the setup and connect everything to it very quickly. Time in the scan room is costs many thousands of dollars, so its important that everything is professionally labelled and assembled nicely.
Writing a small real time plotting application using python's matplotlib library so that the experimenter can watch the blood pressure waveform in real time and see the triggering signal fire.
Please excuse the messiness of my code. I'm pretty new to this platform and the C++ programming language. Any suggestions are welcome.
If anyone has any questions about the science/experiments I will happily provide further readings.