Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2009 May 29:3:12.
doi: 10.3389/neuro.11.012.2009. eCollection 2009.

Near-Infrared Neuroimaging with NinPy

Affiliations

Near-Infrared Neuroimaging with NinPy

Gary E Strangman et al. Front Neuroinform. .

Abstract

There has been substantial recent growth in the use of non-invasive optical brain imaging in studies of human brain function in health and disease. Near-infrared neuroimaging (NIN) is one of the most promising of these techniques and, although NIN hardware continues to evolve at a rapid pace, software tools supporting optical data acquisition, image processing, statistical modeling, and visualization remain less refined. Python, a modular and computationally efficient development language, can support functional neuroimaging studies of diverse design and implementation. In particular, Python's easily readable syntax and modular architecture allow swift prototyping followed by efficient transition to stable production systems. As an introduction to our ongoing efforts to develop Python software tools for structural and functional neuroimaging, we discuss: (i) the role of non-invasive diffuse optical imaging in measuring brain function, (ii) the key computational requirements to support NIN experiments, (iii) our collection of software tools to support NIN, called NinPy, and (iv) future extensions of these tools that will allow integration of optical with other structural and functional neuroimaging data sources. Source code for the software discussed here will be made available at www.nmr.mgh.harvard.edu/Neural_SystemsGroup/software.html.

Keywords: NIRS; brain imaging; diffuse optical tomography; near-infrared spectroscopy; python.

PubMed Disclaimer

Figures

Figure 1
Figure 1
Abridged examples of the trial definition (.DEF) file format and the trial order (.ORD) file format. Each trial named in the .ORD file must be defined in the .DEF file. For the first trial (“Ready”), “timing = −1 keyboard” means wait indefinitely for a keypress (the spacebar is the only allowable key) while displaying the text “Ready …” at position (0,0.2) and height 0.15. The “Fixation” trial involves displaying the image file cross.jpg in the center of the screen for 15 s, with extra frames inserted or removed there if cumulative timing errors have accumulated. The “Left.04” stimulus displays the image file L4.jpg in the center of the screen for exactly 1.5 s.
Figure 2
Figure 2
Screenshot from the NinDAQ device control and data acquisition program. Inset: The NIN recording devices and head probe being controlled by this software.
Figure 3
Figure 3
Graphical depiction of channel by channel SNR, computed as mean signal intensity divided by the SD of signal intensity over time (S = source position, D = detector position). Source–detector pairs with SNR > 50 are connected with green lines, while those with lower SNRs are connected with progressively darker lines. Sources or detectors with few or only bad connections (e.g., S16, D25) could be candidates for pruning. Regions of red colors indicate reduced sensitivity relative to other regions, as seen in the vicinity of sources S4 and S6.
Figure 4
Figure 4
NIN data motion artifact reduction using NinPROC and adaptive filtering. Time courses are: (A) raw NIN data; (B) simultaneously acquired raw piezoelectric motion sensor data; (C) adaptively filtered NIN data, using (A) as the target and (B) as the reference signal; (D) signal in (C) plus a second-order Butterworth high-pass filter using scipy.lfilter() (cutoff = 0.05 Hz); (E) signal in (D) plus a sixth-order Butterworth low-pass filter using scipy.lfilter() (cutoff = 2 Hz).
Code Fragment 1
Code Fragment 1
Three lines to convert raw NIN data to oxygenation concentrations.
Figure 5
Figure 5
Spectroscopic conversion steps of NIN data time series from one source–detector pair. (A) Raw recorded NIN light intensity data from two wavelengths, in arbitrary units. (B) Data from (A) after log transformation to optical density units. (C) Data from (B) after conversion to hemoglobin concentration units (red = oxy-Hb, blue = deoxy-Hb, yellow = period of task activity).
Figure 6
Figure 6
Simulated photon propagation through the head. (A) Typical anatomical MRI scan, with NIN sensor fiducial markers visible above the scalp. (B) Segmentation of the MRI scan in (A) into separate tissue types where Python was used to chain together the MRI segmentation modules. (C) Example photon densities for a single source–detector pair separated by 4 cm, overlaid on the segmented head. The colored areas delimit the region to which many NIN instruments would be sensitive, with a loss of 1 order of magnitude sensitivity per contour line. Images were generated using matplotlib.imshow(), NumPy masked arrays, and matplotlib.contour().
Code Fragment 2
Code Fragment 2
NinSTATS code fragment to perform statistical analysis with functional NIN data as a predictor of outcome.
Figure 7
Figure 7
NIN data visualization. (A) Schematic of the NIN sensor region. (B) Sensor space display, with time series plots positioned at the source (Sx) and detector (Dx) locations. Individual time series plots show time on the x-axes and oxy-hemoglobin (red) and deoxy-hemoglobin (blue) concentrations on the y-axes. Yellow highlights the interval in which the subjects were engaged in a sequence learning task. A scale bar in the center indicates that the task period was 32 s in duration. Concentration is shown in arbitrary units (relative concentration), due to an unknown scattering factor. (C) Example NIN image of task-related oxy-hemoglobin regression parameter Z-scores from (B) corresponding to the rectangular area shown in (A). (D) The same data as (C), masked at a statistical threshold of p < 0.05 corrected for multiple comparisons. Color bar for Z-scores in both (C) and (D) appears in (D). Plots B–D were made with NinDISP using matplotlib.

References

    1. Arridge S. R. (1999). Optical tomography in medical imaging. Inverse Probl. 15, R41–R9310.1088/0266-5611/15/2/022 - DOI
    1. Berkes P., Wilbert N., Zito T. (2008). Modular toolkit for data processing (version 2.3). Available at: http://mdp-toolkit.sourceforge.net (Retrieved September 2, 2008). - PMC - PubMed
    1. Boas D. A. (2004). Photon migration imaging toolbox. Available at: http://www.nmr.mgh.harvard.edu/PMI/resources/tmcimg/index.htm (Retrieved August 25, 2008).
    1. Boas D. A. (2008). Monte Carlo photon transport. Available at: http://www.nmr.mgh.harvard.edu/PMI/resources/tmcimg/index.htm (Retrieved August 25, 2008).
    1. Choi J., Wolf M., Toronov V., Wolf U., Polzonetti C., Hueber D., Safonova L. P., Gupta R., Michalos A., Mantulin W., Gratton E. (2004). Noninvasive determination of the optical properties of adult brain: near-infrared spectroscopy approach. J. Biomed. Opt. 9, 221–22910.1117/1.1628242 - DOI - PubMed