Rationale

Cardio-pulmonary activity is a source of noise in the BOLD fMRI signal. Physiologic recording obtained at the time of scanning may be used to create covariates to model and remove this noise.

A recent poster presented by Timothy Verstynen (timothyv@gmail.com) at Human Brain Mapping 2009 describes in detail the rationale for pulse-ox regression:

Equipment and Expertise

Pulse oximetry is recorded using a blue-tooth enabled, wireless recording device that clips to the index finger of the subject. The device is stored on a rack behind the monitor of the console station for HUP6.

The information regarding the organization of the physiologic data files was obtained from Gamaliel Isaac (aka "Memo") (Gamaliel.Isaac@uphs.upenn.edu).

Recording

Recording is initiated from the HUP6 control console. The technician first enters "Advanced User" mode (which requires a password). This makes available the Windows "Run…" command from the Start menu. In the "Run…" entry box, type telnet mpcu. This brings up the telnet window. Type fMenu which brings up the text-based MPCU applications menu. Menu selections will then be selected by number. Choose PMU… then Signal Logging… then start PULS. You will be asked to enter a logfile name. Use subject initials surrounding date of study (e.g., L091009B_pulse). Remember to turn off logging when the functional scanning is done using the stop PULS menu item.

When the scanning session is complete, use the PUP6 computer to burn a single DVD that has both the DICOM files from the study as well as the PMU logfile (which is stored in c:\MedCom\log).

Pulse-ox data

The resulting data files are stored in c:\MedCom\log. The log-file will have the name assigned during the set-up process (e.g., L101209B_pulse) with the suffix ".puls". This is a text file, with the following structure:

1 2 40 280 1915 1708 1531 1340 1045 ...
ECG  Freq Per: 0 0
PULS Freq Per: 72 823
RESP Freq Per: 0 0
EXT  Freq Per: 0 0
ECG  Min Max Avg StdDiff: 0 0 0 0
PULS Min Max Avg StdDiff: 355 1646 795 5
RESP Min Max Avg StdDiff: 0 0 0 0
EXT  Min Max Avg StdDiff: 0 0 0 0
NrTrig NrMP NrArr AcqWin: 0 0 0 0
LogStartMDHTime:  36632877
LogStopMDHTime:   39805825
LogStartMPCUTime: 36632400
LogStopMPCUTime:  39804637

The first five values of the first line are the parameters of the acquisition. The third of these is related to the "ticktime", which is the time (in msec) between subsequent measurements, although the exact relationship is still being determined. Starting with the 6th value of the first line are the voltage values themselves that reflect the pulse ox. Note that the output is in voltage, not absolute SpO2 level (e.g., 98% saturation).

The sampling frequency for pulse-ox data is 50 Hz. Equivalently, a sample is acquired every 20 msecs.

Within the vector of voltage values are "trigger" events from the scanner. These are entered as 5000 (for trigger on) and 5003 (for trigger off). These values need to be stripped out of the vector. There will occasionally be extra values at the end of the voltage vector as final values in the buffer will be written to the file after the logging is stopped. This can result in the vector length being slightly longer than would be predicted from the log start and stop times described below.

The subsequent lines provide other parameters. Most relevant are the Log Start and Stop times for the MDH and MPCU. The MPCU values correspond to the time of acquisition start for the physiologic data. That is, the first pulse-ox value in the first line of the data file was acquired at the LogStartMPCUTime. The MDH values record the start and stop of DICOM image acquisition. The time recorded as the MDH value is the start of the DICOM image acquisition.

Time formats for DICOM and MPCU

The DICOM files and the MPCU log file both contain time tags. These time tags are derived from the same clock, but are expressed in different formats.

DICOM time format

Each DICOM file records the time of image acquisition in the DICOM header at (0008,0032), and typically as the file name as well. The time recorded is the middle time-point of the acquisition. For example, an EPI image acquired over 3 seconds will be stamped with a time label corresponding to 1.5 seconds after the beginning of the image acquisition. An example DICOM time stamp is:

dicomImageTime  = 102907.165000
  • The first digit pair is hours since midnight (in this case: 10)
  • The second digit pair is minutes (in this case: 29)
  • The third digit pair is seconds (in this case: 07)
  • The four digits after the decimal are ticks or, tenths of a millisecond (in this case: 1650). The trailing two zeros are ignored.

MPCU time format

The time stamps in the MPCU log-file are in terms of msecs since midnight. An example time stamp is:

MPCU log time = 37747165

Conversion of time formats

The two example time formats can be shown to be equivalent:

37747165 = (10 hours * 60 mins/hour * 60 secs/min * 1000 msecs/sec) +
           (29 mins  * 60 * 1000) +
           (07 secs  * 1000) +
           (1650 ticks / 10 ticks/msec)

Subsequent measures

In this example, the next point is at 37747165 + 20 and the next one at 37747165 + 2 * 20 and so on.

An alternate timing approach

Another way to relate the physio values to simultaneously collected DICOM images is used by Timothy Verstynen. He uses only the vector of voltage physio values. Within these are the scanner trigger flags (5000) that indicate the start of an image acquisition. He assumes that the first flag corresponds with the time of onset of the first image volume. He then extracts a vector of physio voltage values equal in temporal length (as one knows the sampling frequency) to the length of the time of image acquisition. Therefore, he does not make use of the MPCU, MDH or the DICOM time stamps.

Creation of covariates

Covariates generated from the physiologic data and corresponding to functional image acquisitions may be useful to remove the effects of physiologic noise.

Functional images are typically acquired as a set of slices during a TR. During image processing, slice acquisition correction shifts the time-series data from a set of functional images so that each slice has the functional data that would have been obtained had the image acquisition taken place all at once at the start of the TR.

For this reason, covariates generated from the physiologic data span a period corresponding to the start time of acquisition of the first functional image until the start time of acquisition of the last functional image.

As the time of acquisition recorded in a DICOM image corresponds to the clock at the mid-point of the acquisition (as opposed to the start or conclusion of the acquisition), one half of the image acquisition duration (e.g., the TR for EPI data) needs to be subtracted from the time of acquisition to find the true clock time for the start of image acquisition.

Exvolt

Dongbo Hu (dongbo.hu@gmail.com) has written a C, command-line program to extract the voltage values for a given set of DICOM images. The exvolt software is available for download. Building the executable from scratch requires the VoxBo lib directory, which supports reading DICOM headers and writing out text files. The usage is:

exvolt [--end] <dicom_directory> <physio_log_file> <output_file>
(current path:  /home/dhu/cpp/physio/release/exvolt)
  • The "–end" argument is optional. If it is available, the DICOM scanning time will be calculated from the starting time of the first image acquisition to the END of the last image acquisition. If it is not available, the dicom scanning time will be from the starting time of the first image acquisition to the BEGINNING of the last image acquisition. So the time difference between these two calculations is one TR.
  • dicom_directory is the path to a directory of DICOM images
  • physio_log_file is the path to a .pmu log file produced by the PMU during scanning
  • output_file is the path for saving the extracted voltage values as a VoxBo .ref file (a carriage return-delimited text file of values) with a header that includes the execution parameters

Notes regarding the operation of the code:

  • The "ticktime" is assumed to be 20 msecs.
  • The program will read all files in DICOM directory to make sure all of them have same TR and date fields. If not, the program will exit with an error. A consequence of this behavior is that a scanning acquisition that began before midnight and ended after midnight could not be analyzed with this code.
  • When both DICOM scanning time range and voltage recording time range (between LogStartMPCUTime and LogStopMPCUTime) are retrieved from input files, the program always compares them to make sure that the former is completely covered by the latter. If not, the program will exit with an error.
  • After valid voltage values (not equal to 5000 and 5003) are read into a vector. The index from which the voltage value should be output is calculated like this:
  • dicom_start_time_offset = dicom_start_time - LogStartMPCUTime
    start_idx = ceil( dicom_start_time_offset / ticktime )
    end_idx = floor( (dicom_stop_time - log_start_time) / ticktime )
    

PMU Manual

From the Siemens Physiological Monitoring Unit (PMU) technical manual: How to save the Siemens Physiologic Monitoring Unit (PMU) data to a file. The actual menu items on the scanner system may have different numbers. (User supplied responses are shown in italics)

  1. Open Windows Command shell window on the MRI console:
    • Choose Menu item "Run…"
    • Type: cmd
    • Enter the following DOS command: telnet mpcu
    • Supply the username and password
    • The VxWorks shell is entered.
  2. Start the signal logging:
    • → fMenu
    • +++++++++++++++++++++++++++++++++++++++++++ Menu V1.2 ++++
      + / MPCU Applikations Menu
      ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +
      + 1 - BGT-MMC Pruefung ...
      + 2 - PCI Karte/Treiber ...
      + 3 - Kommunikation zu den DSPs ...
      + 4 - PMU ...
      + 5 - Trace Utilities ...
      + 6 - VxWorks System Info ...
      +
      ++++++++++++++++++++++++++++++++++++++++++++++ h=Help ++++
      Select number [1-6]:
      
    • enter 4
    • +++++++++++++++++++++++++++++++++++++++++++ Menu V1.2 ++++
      + /4/ PMU
      ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +
      + 1 - Kommandos zum Frontend ...
      + 2 - Debugausgaben steuern ...
      + 3 - Signal Logging ...
      +
      ++++++++++++++++++++++++++++++++++++++++++++++ h=Help ++++
      Select number [1-3]:
      
    • enter 3
    • +++++++++++++++++++++++++++++++++++++++++++ Menu V1.2 ++++
      + /4/3/ Signal Logging
      ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +
      + 1 - start ECG
      + 2 - stop ECG
      + 3 - start RESP
      + 4 - stop RESP
      + 5 - start PULS
      + 6 - stop PULS
      + 7 - start EXT
      + 8 - stop EXT
      + 9 - start all signals
      + 10 - stop all signals
      +
      ++++++++++++++++++++++++++++++++++++++++++++++ h=Help ++++
      Select number [1-10]:
      
    • enter 9
    • Enter log file name (without path and extension): my_pmu_logfile
  3. Run your MRI pulse sequence.
  4. When the MRI sequence is completed, stop the signal logging:
    • +++++++++++++++++++++++++++++++++++++++++++ Menu V1.2 ++++
      + /4/3/ Signal Logging
      ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +
      + 1 - start ECG
      + 2 - stop ECG
      + 3 - start RESP
      + 4 - stop RESP
      + 5 - start PULS
      + 6 - stop PULS
      + 7 - start EXT
      + 8 - stop EXT
      + 9 - start all signals
      + 10 - stop all signals
      +
      ++++++++++++++++++++++++++++++++++++++++++++++ h=Help ++++
      Select number [1-10]:
      
    • enter 10

Notes:

  • Do not forget to stop the signal logging
  • After the logging session: Close the telnet session, please→ logout
  • Within the test menu you get one level up by typing .. (two dots)
  • The resulting logfiles can be found in the directory c:\MedCom\log
    • my_pmu_logfile.ecg
    • my_pmu_logfile.ext
    • my_pmu_logfile.resp
    • my_pmu_logfile.puls
  • The sampling rates for the data files are:
    • 50 Hz - pulse-ox
    • 50 Hz - respiration
    • 200 Hz - external channel (i.e. trigger)
    • 400 Hz - ECG
 
private/pulse-oximetry_during_fmri_scanning.txt · Last modified: 2009/11/17 17:41 by aguirreg
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki