An image analysis pipeline for the semi-automated analysis of clinical fMRI images based on freely available software

An image analysis pipeline for the semi-automated analysis of clinical fMRI images based on freely available software

ARTICLE IN PRESS Computers in Biology and Medicine 40 (2010) 279–287 Contents lists available at ScienceDirect Computers in Biology and Medicine jou...

559KB Sizes 2 Downloads 27 Views

ARTICLE IN PRESS Computers in Biology and Medicine 40 (2010) 279–287

Contents lists available at ScienceDirect

Computers in Biology and Medicine journal homepage: www.elsevier.com/locate/cbm

An image analysis pipeline for the semi-automated analysis of clinical fMRI images based on freely available software Christof Karmonik a,, Michele York b, Robert Grossman a, Ekta Kakkar a, Krutina Patel a, Hani Haykal c, David King c a

Department of Neurosurgery, The Methodist Hospital, Houston, TX, USA Michele York, Department of Neurology, Baylor College of Medicine, Houston, TX, USA c Department of Radiology, The Methodist Hospital, Houston, TX, USA b

a r t i c l e in fo

abstract

Article history: Received 21 October 2008 Accepted 17 December 2009

The technique of functional Magnetic Resonance Imaging (fMRI) has evolved in the last 15 years from a research concept into a clinically relevant medical procedure. In this study, an efficient, semiautomated and cost-effective solution for the analysis of fMRI images acquired in a clinical setting is presented relying heavily on open source software. The core of the pipeline is the software Analysis of Functional NeuroImages (AFNI, National Institute of Mental Health (NIMH)) combined with K-PACS and ImageJ. Its application is illustrated with clinical fMRI exams and with a research study involving comparing subjects diagnosed with Parkinson’s disease and age-matched controls. & 2009 Elsevier Ltd. All rights reserved.

Keywords: Functional magnetic resonance imaging Image analysis pipeline Clinical fMRI Brain activation Automated image analysis

1. Introduction Functional Magnetic Resonance Imaging (fMRI) based on blood-oxygenation level-dependent (BOLD) contrast has been established as a non-invasive method to probe brain activation when performing a variety of tasks ranging from simple motor functions to complex cognitive processing [1–4]. fMRI has been accepted as a noninvasive and safe procedure for recording activation maps of the human brain with an excellent spatial resolution (typically, in the order of mm). fMRI is being increasingly used as a preoperative tool for assessing patients undergoing brain surgery, i.e. for the removal of a neoplastic lesion or for treatment of epilepsy seizures [5–14]. In the last 15 years, improvements have occurred in acquisition techniques, including magnetic resonance imaging (MRI) pulse sequence design, in stimulus presentation hardware and in software for analyzing of the acquired MRI images [15–24]. Recent efforts have also focused on combining fMRI with other imaging modalities such as electroencephalography (EEG) [25]. A variety of analysis software exists, either provided by the vendors of the clinical MRI scanners as add-on options, by third parties as commercial implementations (often termed ‘turn-key’ systems) or by academic institutions placed in the public domain or made available as open source, which often only specialize in one aspect of the image analysis process [26–31]. For integration into the clinical workflow, the fMRI image analysis has to be performed in  Corresponding author. Tel.: + 1 713 441 1583.

E-mail address: [email protected] (C. Karmonik). 0010-4825/$ - see front matter & 2009 Elsevier Ltd. All rights reserved. doi:10.1016/j.compbiomed.2009.12.003

a timely manner so that the functional brain activation maps and other types of analyses can be provided to the clinical clinician at the time of the interpretation of the anatomical MRI exam. A seamless and mostly automated implementation of the fMRI image analysis is therefore essential. We report the implementation of a semi-automated image analysis pipeline (IAP) at our institution that uses only open source software or software freely available. Automation of the analysis steps enabled us to provide the results minutes after the completion of the fMRI exam. While this IAP was designed for the analysis of clinical studies, it has also shown to be effective for a clinical research study of subjects with Parkinson’s disease [32]. Many steps of the analysis process are automated, therefore the radiologist or other imaging professionals do not need to be involved in executing the IAP. The procedure was designed to work with a commercial clinical MRI scanner, to minimize user interaction time and to be easily transferable.

2. Methods The work has been approved by the appropriate ethical committees related to the institution in which it was performed. 2.1. Image analysis software The software package called Analysis of Functional NeuroImages (AFNI) [27] was chosen as the core of the IAP. This decision was motivated by the free distribution of AFNI (as open-source

ARTICLE IN PRESS 280

C. Karmonik et al. / Computers in Biology and Medicine 40 (2010) 279–287

software) by the NIMH as part of the NIH and its application by a variety of groups and individuals since its first publication from the Medical College of Wisconsin in 1994. AFNI is available for several operating systems and for our implementation, we chose the Linux gcc32 compilation as offered at the AFNI website (http://afni.nimh.nih.gov/afni/download/afni/releases/latest). AFNI was installed on dual processor 32-bit Centos 5 (http:// www.centos.org/) workstation. 2.2. Image transfer software Clinical MRI images are readily available for transfer from the MRI scanner via the Digital Imaging and Communications in Medicine (DICOM) standard transfer protocol [33]. DICOM is managed by the Medical Imaging and Technology Alliance a division of The Association of Electrical and Medical Imaging Equipment Manufacturers (NEMA, (http://medical.nema.org/). To enable image data transfer to a dedicated imaging workstation, the freely available software K-PACS (www.k-pacs.de) was chosen and installed at Windows XP x64 (Microsoft Inc.)-based PC (PC workstation) as the DICOM client. MRI scanner and the PC workstation were connected via the institutional 1 GBit/s intranet. Communication between the Centos 5 workstation and the PC workstation was established using Xming X Windows server (http://sourceforge.net/projects/xming). Data was stored on a shared network drive mapped at the PC workstation and the Centos 5 workstation via Samba (for a schematic overview of this configuration, see Fig. 1a). 2.3. Clinical fMRI imaging protocol The clinical fMRI imaging protocol was used as implemented by Thulborn Associates, Inc on a 3T GE Excite HD human scanner. The rational for the use of high field 3T MR scanners is based on

the BOLD mechanism, and the use of fMRI on 3T for clinical purposes has been demonstrated [34]. The clinical fMRI protocol consisted of four tasks or paradigms in block-design alternating between stimuli every 45 s where slices covering the whole brain were acquired every 3 s. Since its implementation, eight patients have been scanned with this protocol. In task 1, the subjects performed alternate fist clenching of the left and right hands guided by visual written instructions visible on a projection screen located in front of the subjects eyes. In task 2, the subjects were instructed to follow the horizontal saccadic motion of a dot on the projection screen. In task 3, written statements and questions were presented to the subjects and in task 4, the subjects had to recall pictures presented during the first part of this paradigm. Stimuli in tasks 2–4 were interspaced by periods of rest (fixation on a cross hair). All paradigms followed the block design and varied in length from 412 min to 812 min (gradient EPI, matrix 64  64, isotropic spatial resolution about 3 mm). Typically during such a clinical fMRI exam, about 14,500 images were acquired. For anatomical reference, a high resolution MRI scan (3D FSPGR, isotropic spatial resolution 1 mm) was acquired.

2.4. Research fMRI imaging protocol The event-related paradigm consisted of 256 visual globallocal stimuli presented in 12 min and 48 s with switches randomly distributed. The number of images acquired for this fMRI task was in the order of 12,000. The visual paradigm for the research study was created with Adobe Audition 3 and Adobe Premiere CS 3 (Adobe Systems Inc.) as an AVI video file to achieve the necessary temporal accuracy. We report here preliminary data of an interim analysis including 6 subjects with Parkinson’s disease (PD) and 6 age-matched healthy controls (HC). Average age in the PD group was 68 74 and in the HC group 6377 [32].

Fig. 1. (a) Schematics of the interconnection of the computer network created for the analysis of the fMRI image data. The MRI scanner is connected via a 1 GBit/s network with the PC workstation. The images are transferred using the K-PACS DICOM client. The Centos 5 workstation (with AFNI) and the PC workstation share a network drive on which all data is stored. The output of the data analysis is stored on that network drive and can be accessed with Matlab and PowerPoint to create the final report. (b) Illustration of functional brain activation maps overlaid on the images from the high-resolution anatomical dataset (upper row). Representative for all 118 areas analyzed, the Brodmann areas 2–3 are marked on high-resolution anatomical images (lower row). The high correlation coefficient in these areas (as expected from a motor task) can be appreciated in these areas in the functional brain activation maps.

ARTICLE IN PRESS C. Karmonik et al. / Computers in Biology and Medicine 40 (2010) 279–287

2.5. Talairach-based fMRI analysis A batch script analysis without user interaction was created with a set of Unix shell scripts (see Appendix A). The MRI images were transformed from DICOM to the NIfTI-1, a new Analyze-style format, proposed by the NIH Neuroimaging Informatics Technology Initiative (NIfTI) Data Format Working Group (DFWG) and then into the AFNI image format, motion corrected and spatially smoothed. Correlation coefficients of the ideal time course (as determined by the paradigm) and the temporal variation of the image intensity in each voxel of the fMRI was then calculated. All images were then automatically transferred into Talairach space using AFNI. Functional brain activation maps and average correlation coefficient profiles displaying the average values of the correlation coefficient in 118 brain areas extracted from the AFNI TTatlas datasets were calculated. For the research fMRI study, a t-test was employed to obtain intergroup variations between subjects with Parkinson’s disease and the control group. Details for each analysis steps can be found in Appendix A.

3. Results 3.1. Clinical fMRI 3.1.1. Functional brain activation maps Functional brain activation maps were created by overlaying the calculated values of the correlation coefficient onto the highresolution anatomical images after transformation into Talairach

281

space (Fig. 1b). These activation maps were included into the final report created with Microsoft PowerPoint made available to the clinician at the end of the analysis. Instead of choosing a cut-off threshold for the display of the values of the correlation coefficient, these values were overlaid on the anatomical images in a semi-transparent mode. In this way, all the information of the fMRI analysis was provided to the clinician without the need of interactively reviewing functional brain activation maps with different cut-off thresholds at the AFNI workstation.

3.1.2. Average correlation coefficient profiles (ACC profiles) Average correlation coefficient (ACC) profiles were calculated for each task (motor, visual, language and memory) displaying the average values of the correlation coefficients for the 118 areas extracted from the AFNI TTatlas dataset. Areas with elevated values for the ACC in the majority of cases included Brodmann areas 2–3 corresponding to postcentral gyrus and Brodmann area 4 corresponding to primary motor cortex bilaterally for the motor task. In the visual and language task, large activation was observed in the cerebellum (pyramis, tuber and declive of Vermis) and in the primary visual cortex V1 (Brodmann area 17). Only in the language task (but not in the visual task), elevated average correlation coefficient values were observed in Brodmann areas 39 and 40 (Wernicke’s area) and Brodmann area 44 and 45 (Broca’s area). The memory task revealed a large network of activation, including deep brain structures (such as the lateral dorsal nucleus, midline nucleus and geniculum body) but also areas of the parahippocampal gyrus (Fig. 2).

Fig. 2. Average correlation coefficient values for the 118 areas of the TT atlas. Legend in figure illustrates color coding for different brain regions (temporal, frontal, parietal, occipital, limbic and cerebellar). Brodmann areas are shown after limbic regions (gray) and cerebellar regions (magenta). Upper left: motor task (alternate fist clenching paradigm), upper right: VGS (saccadic eye motion), lower left: language task (reading and understanding of written phrases), lower right: memorizing of pictures. Black arrow point to Brodmann areas 2–3 (postcentral gyrus) and 4 (primary motor cortex). Green arrows mark pyramis, tuber and declive of Vermis (cerebellum). Red arrows mark Brodmann area 17 (primary visual cortex V1). Blue arrows mark Brodmann areas 39 and 40 (Wernicke’s area) and Brodmann area 44 and 45 (Broca’s area) (from left to right). Purple arrows point to areas of the parahippocampal gyrus and the gray arrow denotes lateral dorsal nucleus, midline nucleus and geniculum body. (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.)

ARTICLE IN PRESS 282

C. Karmonik et al. / Computers in Biology and Medicine 40 (2010) 279–287

Fig. 3. (a) Comparison of ideal (red) time course and time course of the image intensity for a representative voxel of high correlation. Visual inspection reveals similarities in both time courses, in particular in areas with fast succession of events (arrows). (b) Averaged functional activation maps for the patient group (PD) and the control group (HC) overlaid on high-resolution anatomical images. Differences in the activation maps between both groups can be appreciated. Areas exhibiting stronger activations are visible in the control group compared to the patient group. (c) ACC profiles for left and right brain regions. Similarly to the functional activation maps in (b), larger correlation coefficient values are observed for many regions in the control group (hollow symbols) compared to the patient group (filled symbols) Color-scheme denotes different brain regions as introduced in Fig. 2. (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.)

3.2. fMRI research study Visual inspection of time courses of the voxel intensities in selected voxels revealed qualitative agreement between these time courses and the ideal timecourse (Fig. 3a). Averaged functional brain activation maps showed subtle differences between the PD group and the HC group (Fig. 3b). In this preliminary analysis, the shape of the ACC profiles were of similar appearance in general. Statistically significant differences (p-valueo0.1)were found between the PD and HC groups for several regions: The ACC values were higher in the PD than in the HC group for the left orbital gyrus, the left Brodmann area 43, the right nucleus accumbens and lower for the left red nucleus, the left ventral lateral nucleus, the left declive of Vermis, the right uncus, the right superior frontal gyrus, the right Brodmann areas 8, 23, 29, and 38, the right dentate and the right cerebrellar lingual (Fig. 3c).

4. Discussion Since its conception, fMRI imaging has gradually evolved from a time and labor intensive research procedure to a semiautomated clinical procedure. Various image acquisition and image analysis methods have been developed and are available either as commercial, as public-domain or open source software packages. In this study, we report on an image analysis pipeline (IAP) almost entirely composed of freely available software that is capable of (i) image transfer from the scanner to the analysis workstation, (ii) image conversion between different image formats (in particular from the medical DICOM standard into the NIfTI-1 and AFNI formats) and (iii) fMRI image analysis

creating functional brain activation maps and average correlation coefficient profiles. AFNI, the package of choice for this study, has been constantly refined and tested in 14 years since its first version appeared in 1994. Its widespread use, its active maintenance by members of NIMH, its automation capability through UNIX shell scripts and its flexibility were major factors for our choice. Centos 5 as an UNIX operating system was found to be easy to install and to maintain. While UNIX operating systems are arguably best suited for complex tasks in a research environment, widespread use of this system has diminished over the last decade. Most users, in particular non-computer experts, today rely heavily on Microsoft Windows. For this reason, a Microsoft Windows workstation (PC workstation) was chosen as the main user interface, seamless integration of the Centos 5 workstation was achieved by an X Windows server (Xming) installed on the PC workstation and by the remote storage of the image data onto a network drive accessible by both workstations. Images of the functional brain activation maps and the average correlation coefficient data files stored from the Centos 5 workstation onto the network drive could then be easily accessed by software available on the PC workstation. which is familiar to the general user such a MS PowerPoint, MS Excel and Matlab. In our experience, a final report created with MS PowerPoint for the clinician including the functional brain activation maps and the average correlation coefficient profiles could be interfaced easily with the clinical workflow providing the needed information in a timely manner. Overlaying all values of the correlation coefficient in a pseudo-color representation onto the highresolution anatomical images was particularly effective, as an interactive inspection of the results of the fMRI analysis on the PC workstation with different threshold was then unnecessary. The ACC profiles were found to be a compact way of presenting the fMRI results for the different tasks. Regions with elevated

ARTICLE IN PRESS C. Karmonik et al. / Computers in Biology and Medicine 40 (2010) 279–287

activations could be easily detected. Each task was found to have a characteristic profile, which however, varied amongst clinical subjects. The analysis of the fMRI images of the research fMRI study involving PD patients with the same IAP was found to be equally effective for a preliminary analysis. In a first step, ACC profiles for each subject were visually inspected before averaging to reveal potential complications caused by image artifacts. If large deviations from the general appearance in an individual ACC profile was visible, the functional brain activation maps and the acquired fMRI images of that particular subject were further inspected. Group-averaged ACC profiles can be used together with the group-averaged functional brain activation maps to present preliminary results. A final, more rigouros group analysis should include a voxel-wise comparison between the PD and HC group. Such an analysis can be performed within the AFNI software using the program ‘3dttest’ which takes as input all individual functional datasets ordered into two groups and establishes statistical significance by performing a student t-test of the group means. Regional averages such as presented in the ACC profiles may be less sensitive than voxel-based averages, in particular if only a few voxels in a brain region are activated (i.e. hand region in the motor cortex). The applicability of the IAP as described possesses certain limitations. First, it involves the transfer of the MRI images through the institutional intranet to an off-line computer. It is therefore not suited for real-time application where functional activation maps are obtained in the MRI control room (often at the MRI scanner control computer), while the subject is performing the task. Second, the fMRI analysis capabilities of the IAP are limited by those of AFNI. As AFNI is well maintained, new concepts in fMRI image analysis may be included once they become widely accepted, also AFNI can be extended by userwritten software plugins. Third, the ACC profiles rely on a successful transformation of the MRI images into the Talairach space. This transformation is performed within the AFNI software package by an affine transformation with the implicit assumption that all brain structures scale equally with the overall size of the brain. While this assumption may be acceptable in many cases, it is certainly inadequate for many pathologies, in particular neoplastic lesions that deform the brain tissue due to its mass effect and in neurodegenerative diseases, such as Alzheimer’s disease, which leads to an atrophy of selected brain structures. Individual ACC profiles therefore have to be interpreted with caution, in particular, the results for brain structures at the cortical surface or bordering the ventricles. In PD patients, brain atrophy due to disease is of lesser concern, however, atrophy may still be present due to the advanced age of the subjects. Non-affine brain transformation algorithms, albeit still time and labor intensive, are available and a future integration into the IAP is feasible, once they can be applied in a semi-automated fashion. The IAP as yet does not take into account the individual behavioral data collected on each trial of complex cognitive tasks. The integration of this data, especially for fMRI tasks which require individual accuracy responses to each stimuli is currently being evaluated.

5. Conclusion We present an image processing pipeline for the semiautomated analysis of functional MRI images based on freely available software packages such as K-PACS, AFNI and ImageJ. This pipeline is successfully used for the analysis of fMRI images acquired in a clinical setting and for clinical research studies. The concept of one-dimensional profiles for displaying brain

283

activation in selected areas of the standard Talairach space is discussed and applied.

6. Summary The technique of functional magnetic resonance imaging (fMRI) has evolved in the last 15 years from a research concept into a clinically relevant medical procedure. fMRI is noninvasive, safe and has been demonstrated to record brain activation maps when performing tasks of varying complexity involving basic motor functions or complex cognitive processes. With the widespread distribution of the fMRI technique, also a variety of analysis software packages have been developed, either by the vendors of the MRI scanners, by third party companies or by academia, the latter available mostly as public domain or open source software. For integration into the clinical workflow, the fMRI image analysis has to be performed in a timely manner so that the functional brain activation maps and any other kind of analysis results can be provided to the clinical clinician at the time of the interpretation of the anatomical MRI exam. A seamless and mostly automated implementation of the fMRI image analysis is therefore essential. In this study, we describe an image analysis pipeline (IAP) for the semi-automated analysis of clinical fMRI images that relies heavily on freely available software. The core of the pipeline is the software package Analysis of Functional NeuroImages (AFNI) software, available from the National Institute of Mental Health (NIMH). Combined with K-PACS (a freely available DICOM client) and ImageJ (an image analysis program freely downloadable from the website of the National Institutes of Health (NIH)), and efficient, semi-automated and cost-effective solution for the analysis of fMRI images acquired in a clinical setting has been created. Automation of the analysis steps enabled us to provide the results minutes after the end of the fMRI exam. Many steps of the analysis process are automated, therefore the radiologist or other imaging professionals do not need to be involved in executing the IAP. The procedure was designed to work with a commercial clinical MRI scanner, to minimize user interaction time and to be easily transferable. The application of the IAP is illustrated with images obtained from clinical fMRI exams and from a clinical research study involving a set-shifting paradigm performed by subjects diagnosed with Parkinson’s disease and age-matched controls. A detailed description of the analysis steps is provided and the corresponding UNIX shell scripts are provided. Typical results are shown in the form of functional brain activation maps and as average correlation coefficient (ACC) profiles. The latter were derived from an automated whole brain analysis of the image data transferred into Talairach space and concisely visualized the strength of activation in 118 separate brain regions thereby facilitating inter-subject or inter-group comparisons.

Conflict of interest statement None declared.

Acknowledgments Funding support from the Methodist Hospital Research Institute in form of a Scholarship grant for the Neuroimaging research study is gratefully acknowledged.

ARTICLE IN PRESS 284

C. Karmonik et al. / Computers in Biology and Medicine 40 (2010) 279–287

Appendix A A.1. Processing steps In detail, the following steps were performed for the Talairachbased fMRI analysis (in parenthesis, the AFNI program employed in each step is listed). 1. Transfer of DICOM images (manually initiated) After completion of the fMRI exam, the technician initiates the transfer of the DICOM images by selecting the DICOM node of the dedicated PC workstation and then transfering all acquired images. As in the second step below, the relevant images series are extracted automatically, no user-based selection of DICOM images is necessary at this point which helps to save scanner time and to reduce errors or image losses in the transfer process. 2. Conversion from DICOM format into NIfTI-1 format (automated) The NIfTI-1 format is a new Analyze-style data format, proposed by the NIfTI-DWFG as a short-term measure to facilitate inter-operation of fMRI data analysis software packages (http:// nifti.nimh.nih.gov/). The program dcm2nii (http://www.sph.sc. edu/comd/rorden/mricron/dcm2nii.html) was applied for this conversion. In contrast to other software programs that convert DICOM into Analyze format, image location is preserved by the transformation using dcm2nii. To automatically find the directory containing the DICOM images for a particular study, an in-house written ImageJ (Version 1.40 g, NIH) plugin (Fig. 4, created with the software development kit Eclipse Version 3.2.2 (www.eclipse. org) was utilized to extract this information from K-PACS. 2. Conversion of NIfTI-1 image format into AFNI image format (3dcalc) For consistency, the NIfTI was converted into the AFNI format prior to any further data manipulation. 3. Motion correction (3dvolreg, automated) Rotational head motion (along three perpendicular axes oriented inferior to superior (roll), right to left (pitch) and anterior

to posterior (yaw) as well as translational head motion (increment superiorly, left and posteriorly) were determined and corrected for. 4. Calculation of ideal time course from block (on/off) design (waver) (automated) The time course of the stimulus presentation (30 s on followed by 30 s off) was convoluted with the approximate shape of the hemodynamic response function to obtain the ideal time course for correlation with the temporal signal change in each image voxel. 5. Spatial smoothing (3dmerge, automated) The fMRI images were smoothed by convolution with a Gaussian kernel (full width of half maximum 5 mm) to reduce noise artifacts. 6. Correlation coefficient analysis (3dfim, automated) For each voxel in the smoothed fMRI images, the correlation coefficient between the ideal time course and the temporal change of the image intensity was calculated. These correlation coefficient values were then displayed in pseudo-color overlaid on the high-resolution anatomical images. 7. Conversion into Talairach space (@auto_tlrc, automated) The high-resolution anatomical images was automatically converted into Talairach space using the TT_N27+ tlrc template provided with AFNI. The fMRI datasets were then converted with geometry of the high-resolution anatomical images as parent geometry. 8. Average correlation coefficient profiles (3dmaskave, automated) From the TT_atlas + tlrc dataset (available from the AFNI website), mask datasets were created for each of its areas (Fig. 1b) separated by left and right brain halves. With these mask datasets, the average values of the correlation coefficient for each area was calculated and stored in a text file. The files were then visualized as one-dimensional plots (Matlab, Math works Inc.) yielding a characteristic profiles for each paradigm.

Fig. 4. Schematic illustration of the ImageJ plugin. Based on user input (patient ID and output directory), the corresponding DICOM images for each task and the high-resolution anatomical images (based on unique strings in each image series name (‘‘DTI’’, ‘‘FSPGR’’, ‘‘MOTOR’’, ‘‘VGS’’, ‘‘LANGUAGE’’, ‘‘MEMORY’’) are extracted from the KPACS database and stored as NIfTI images in the output directory.

ARTICLE IN PRESS C. Karmonik et al. / Computers in Biology and Medicine 40 (2010) 279–287

A.2. Unix shell scripts 1. Image conversion #!/bin/sh rm anatomical+orig* 3dcalc -a anatomical.nii -prefix anatomical -expr ‘a’ 3drefit -markers anatomical+orig rm motor+orig* 3dcalc -a motor.nii -prefix motor -expr ‘a’ rm vgs+ orig* 3dcalc -a vgs.nii -prefix vgs -expr ‘a’ rm language+ orig* 3dcalc -a language.nii -prefix language -expr ‘a’ rm memory+orig* 3dcalc -a memory.nii -prefix memory -expr ‘a’ 2. Motion correction rm $1_motionCorrected+ orig* rm $1_motionFile.dat 3dvolreg -prefix $1_motionCorrected -tshift Fourier -verbose -base ‘‘$1+orig[0]’’ -dfile $1_motionFile.dat ‘‘$1+orig’’ 3. Create ideal waveforms from block design as input waver -GAM -input IdealWaveform_motor.1D -TR 3.0 4IdealWaveform_leftHand_convoluted.1D waver -GAM -input IdealWaveform_vgs.1D -TR 3.0 4IdealWaveform_vgs_convoluted.1D waver -GAM -input IdealWaveform_language.1D -TR 3.0 4IdealWaveform_language_convoluted.1D waver -GAM -input IdealWaveform_memory.1D -TR 3.0 4IdealWaveform_memory_convoluted.1D 4. Spatial smoothing rm $1_smoothed* echo Performing spatial smoothing 3dmerge -1blur_fwhm 5 -doall -session . -prefix $1_smoothed $1_motionCorrected +orig $1_smoothed $1_resampled+orig

285

k= ‘echo ${p/_/ }‘ r= ‘echo $k | cut -d’ ‘ -f1’ s= ‘echo $k | cut -d’ ‘ -f2’ t= ‘echo $k | cut -d’ ‘ -f3’ echo brick –$r– echo number –$s– echo name –${t}– rm TTLeft${t}* printf ‘‘%s’’Left${t} >> $1_LeftBrainAnalysis.dat ms =‘3dmaskave -mask /mnt/win/newTTDatasets/ TTLeft${t}+tlrc -dindex 0 -sigma -q $1_masked_CC+tlrc[1]’ max=‘3dmaskave -mask /mnt/win/newTTDatasets/ TTLeft${t}+tlrc -dindex 0 -max -q $1_masked_CC+tlrc[1]’ min=‘3dmaskave -mask /mnt/win/newTTDatasets/ TTLeft${t}+tlrc -dindex 0 -min -q $1_masked_CC+tlrc[1]’ printf printf printf printf

‘‘%s ‘‘%s ‘‘%s ‘‘’’

’’ $ms >>$1_LeftBrainAnalysis.dat ’’ $max >>$1_LeftBrainAnalysis.dat ’’ $min >>$1_LeftBrainAnalysis.dat >>$1_LeftBrainAnalysis.dat

rm TTRight${t}* printf "%s " Right${t} >> $1_RightBrainAnalysis.dat ms =‘3dmaskave -mask /mnt/win/newTTDatasets/ TTRight${t}+tlrc -dindex 0 -sigma -q $1_masked_CC+tlrc[1]’ max=‘3dmaskave -mask /mnt/win/newTTDatasets/ TTRight${t}+tlrc -dindex 0 -max -q $1_masked_CC+tlrc[1]’ min=‘3dmaskave -mask /mnt/win/newTTDatasets/ TTRight${t}+tlrc -dindex 0 -min -q $1_masked_CC+tlrc[1]’ printf printf printf printf done

"%s " $ms >>$1_RightBrainAnalysis.dat "%s " $max >>$1_RightBrainAnalysis.dat "%s " $min >>$1_RightBrainAnalysis.dat "$1_RightBrainAnalysis.dat

A.3. List of Talairach regions

5. Convert anatomical and fMRI images into Talairach space @Align_Centers -base /usr/AFNI/linux_gcc32/ TT_N27+tlrc -dset anatomical+orig -child ./ *.HEAD rm anatomical_shft +tlrc* @auto_tlrc -base TT_N27+ tlrc -suffix none -input anatomical_shft+orig 6. Automated atlas-based analysis #!/bin/sh rm $1_LeftBrainAnalysis.dat rm $1_RightBrainAnalysis.dat for i in ‘grep’.’ /mnt/win/TT_Files/ TTatlasNumbers.txt | sed -e ‘s/ /_/g’ | sed -e ‘s/// g’ ‘ do p =‘echo ${i/_/ }‘

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

Hippocampus Amygdala Posterior Cingulate Anterior Cingulate Subcallosal Gyrus Transverse Temporal Gyrus Uncus Rectal Gyrus Fusiform Gyrus Inferior Occipital Gyrus Inferior Temporal Gyrus Insula Parahippocampal Gyrus Lingual Gyrus Middle Occipital Gyrus Orbital Gyrus Middle Temporal Gyrus

ARTICLE IN PRESS 286

18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83

C. Karmonik et al. / Computers in Biology and Medicine 40 (2010) 279–287

Superior Temporal Gyrus Superior Occipital Gyrus Inferior Frontal Gyrus Cuneus Angular Gyrus Supramarginal Gyrus Cingulate Gyrus Inferior Parietal Lobule Precuneus Superior Parietal Lobule Middle Frontal Gyrus Paracentral Lobule Postcentral Gyrus Precentral Gyrus Superior Frontal Gyrus Medial Frontal Gyrus Lentiform Nucleus Hypothalamus Red Nucleus Substantia Nigra Claustrum Thalamus Caudate Caudate Tail Caudate Body Caudate Head Ventral Anterior Nucleus Ventral Posterior Medial Nucleus Ventral Posterior Lateral Nucleus Medial Dorsal Nucleus Lateral Dorsal Nucleus Pulvinar Lateral Posterior Nucleus Ventral Lateral Nucleus Midline Nucleus Anterior Nucleus Mammillary Body Medial Globus Pallidus Lateral Globus Pallidus Putamen Nucleus Accumbens Medial Geniculum Body Lateral Geniculum Body Subthalamic Nucleus Brodmann area 1 Brodmann area 2 Brodmann area 3 Brodmann area 4 Brodmann area 5 Brodmann area 6 Brodmann area 7 Brodmann area 8 Brodmann area 9 Brodmann area 10 Brodmann area 11 Brodmann area 17 Brodmann area 18 Brodmann area 19 Brodmann area 20 Brodmann area 21 Brodmann area 22 Brodmann area 23 Brodmann area 24 Brodmann area 25 Brodmann area 27 Brodmann area 28

84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 1187

Brodmann area 29 Brodmann area 30 Brodmann area 31 Brodmann area 32 Brodmann area 33 Brodmann area 34 Brodmann area 35 Brodmann area 36 Brodmann area 37 Brodmann area 38 Brodmann area 39 Brodmann area 40 Brodmann area 41 Brodmann area 42 Brodmann area 43 Brodmann area 44 Brodmann area 45 Brodmann area 46 Brodmann area 47 Uvula of Vermis Pyramis of Vermis Tuber of Vermis Declive of Vermis Culmen of Vermis Cerebellar Tonsil Inferior Semi-Lunar Lobule Fastigium Nodule Uvula Pyramis Culmen Declive Dentate Tuber Cerebellar Lingual

A.4. Creation of Talairach region datasets for i in ‘grep ’\n’ /cygdrive/e/afni/bin/ TTatlasNumbers.txt | sed -e ’s/ /_/g’ ‘ do p= ‘echo $i/_/ ’ k= ‘echo $p/_/ ’ r= ‘echo $k | cut -d’ ‘ -f1’ s= ‘echo $k | cut -d’ ‘ -f2’ t= ‘echo $k | cut -d’ ‘ -f3’ echo brick –$r– echo number –$s– echo name –$t– rm TTLeft$t* printf "%s " Left$t >> LeftResultsOfAreaBasedAnalysis.dat /cygdrive/e/afni/bin/3dcalc -a "/cygdrive/e/afni/ bin/TTatlas_padded+ tlrc[$r]" -prefix TTLeft$t expr "equals(a,$s)*ispositive(x)" done

References [1] N.K. Logothetis, et al., Neurophysiological investigation of the basis of the fMRI signal, Nature 412 (6843) (2001) 150–157.

ARTICLE IN PRESS C. Karmonik et al. / Computers in Biology and Medicine 40 (2010) 279–287

[2] S. Ogawa, et al., Functional brain mapping by blood oxygenation leveldependent contrast magnetic resonance imaging. A comparison of signal characteristics with a biophysical model, Biophys. J. 64 (3) (1993) 803–812. [3] M.A. Just, et al., Brain activation modulated by sentence comprehension, Science 274 (5284) (1996) 114–116. [4] K.R. Thulborn, et al., High-resolution echo-planar fMRI of human visual cortex at 3.0 tesla, NMR Biomed. 10 (4–5) (1997) 183–190. [5] M. Baciu, et al., Presurgical fMRI evaluation of cerebral reorganization and motor deficit in patients with tumors and vascular malformations, Eur. J. Radiol. 46 (2) (2003) 139–146. [6] L. Ding, et al., 3D source localization of interictal spikes in epilepsy patients with MRI lesions, Phys. Med. Biol. 51 (16) (2006) 4047–4062. [7] Y.C. Ho, et al., Functional magnetic resonance imaging in adult craniopagus for presurgical evaluation, J. Neurosurg. 103 (5) (2005) 910–916. [8] T. Krings, et al., Functional MRI for presurgical planning: problems, artefacts, and solution strategies, J. Neurol. Neurosurg. Psychiatry 70 (6) (2001) 749–760. [9] T. Krings, et al., Functional MRI and 18F FDG-positron emission tomography for presurgical planning: comparison with electrical cortical stimulation, Acta Neurochir. (Wien) 144 (9) (2002) 889–899 discussion 899. [10] S. Larsen, et al., Quantitative comparison of functional MRI and direct electrocortical stimulation for functional mapping, Int. J. Med. Robot. 3 (3) (2007) 262–270. [11] H. Laufs, J.S. Duncan, Electroencephalography/functional MRI in human epilepsy: what it currently can and cannot do, Curr. Opin. Neurol. 20 (4) (2007) 417–423. [12] C.C. Lee, et al., Assessment of functional MR imaging in neurosurgical planning, AJNR Am. J. Neuroradiol. 20 (8) (1999) 1511–1519. [13] S. Sunaert, Presurgical planning for tumor resectioning, J. Magn. Reson. Imaging 23 (6) (2006) 887–905. [14] J. Xie, et al., Preoperative blood oxygen level-dependent functional magnetic resonance imaging in patients with gliomas involving the motor cortical areas, Chin. Med. J. (Engl.) 121 (7) (2008) 631–635. [15] E. Gallasch, et al., Contact force- and amplitude-controllable vibrating probe for somatosensory mapping of plantar afferences with fMRI, J. Magn. Reson. Imaging 24 (5) (2006) 1177–1182. [16] H.G. Hoffman, et al., A magnet-friendly virtual reality fiberoptic image delivery system, Cyberpsychol. Behav. 6 (6) (2003) 645–648. [17] R.S. Huang, M.I. Sereno, Visual stimulus presentation using fiber optics in the MRI scanner, J. Neurosci. Methods 169 (1) (2008) 76–83.

287

[18] V. Jousmaki, N. Nishitani, R. Hari, A brush stimulator for functional brain imaging, Clin. Neurophysiol. 118 (12) (2007) 2620–2624. [19] M.J. McKeown, et al., Deterministic and stochastic features of fMRI data: implications for analysis of event-related experiments, J. Neurosci. Methods 118 (2) (2002) 103–113. [20] V.L. Morgan, et al., Comparison of fMRI statistical software packages and strategies for analysis of images containing random and stimulus-correlated motion, Comput. Med. Imaging Graph 31 (6) (2007) 436–446. [21] C.J. Scarff, et al., Simultaneous 3-T fMRI and high-density recording of human auditory evoked potentials, Neuroimage 23 (3) (2004) 1129–1142. [22] J.T. Voyvodic, Real-time fMRI paradigm control, physiology, and behavior combined with near real-time statistical analysis, Neuroimage 10 (2) (1999) 91–106. [23] C. Wienbruch, et al., A portable and low-cost fMRI compatible pneumatic system for the investigation of the somatosensensory system in clinical and research environments, Neurosci. Lett. 398 (3) (2006) 183–188. [24] Y. Yang, et al., A silent event-related functional MRI technique for brain activation studies without interference of scanner acoustic noise, Magn. Reson. Med. 43 (2) (2000) 185–190. [25] T. Warbrick, A.P. Bagshaw, Scanning strategies for simultaneous EEG-fMRI evoked potential studies at 3 T, Int. J. Psychophysiol. 67 (3) (2008) 169–177. [26] J. Hart Jr., S.M. Rao, M. Nuwer, Clinical functional magnetic resonance imaging, Cogn. Behav. Neurol. 20 (3) (2007) 141–144. [27] R.W. Cox, AFNI: software for analysis and visualization of functional magnetic resonance neuroimages, Comput. Biomed. Res. 29 (3) (1996) 162–173. [28] S. Gold, et al., Functional MRI statistical software packages: a comparative analysis, Hum. Brain Mapp. 6 (2) (1998) 73–84. [29] T.R. Oakes, et al., Comparison of fMRI motion correction software tools, Neuroimage 28 (3) (2005) 529–543. [30] Z.S. Saad, et al., Functional imaging analysis contest (FIAC) analysis according to AFNI and SUMA, Hum. Brain Mapp. 27 (5) (2006) 417–424. [31] V. Della-Maggiore, et al., An empirical comparison of SPM preprocessing parameters to the analysis of fMRI data, Neuroimage 17 (1) (2002) 19–28. [32] C. Karmonik, R. Grossman, M.K. York, Brain activation in Parkinson’s disease during a functional magnetic resonance imaging set shifting task: preliminary findings, in ANN N Y Acad, Abstracts, Chicago, 2008. [33] J.T. Shiroma, An introduction to DICOM, Veterinary Medicine (2006) 19–20. [34] K.R. Thulborn, Clinical rationale for very-high-field (3.0 Tesla) functional magnetic resonance imaging, Top Magn. Reson. Imaging 10 (1) (1999) 37–50.