Skip to main content
NIHPA Author Manuscripts logoLink to NIHPA Author Manuscripts
. Author manuscript; available in PMC: 2024 Nov 1.
Published in final edited form as: Magn Reson Imaging. 2023 Jul 1;103:18–27. doi: 10.1016/j.mri.2023.06.016

Distortion correction of functional MRI without reverse phase encoding scans or field maps

Tian Yu 1,*, Leon Y Cai 2,*, Salvatore Torrisi 10,11, An Thanh Vu 10,11, Victoria L Morgan 2,3,4, Sarah E Goodale 2, Karthik Ramadass 5, Steven L Meisler 15, Jinglei Lv 13,14, Aaron EL Warren 12, Dario J Englot 2,3,4,5,6, Laurie Cutting 7,8,9,3,1, Catie Chang 1,2,4,5, John C Gore 4,5, Bennett A Landman 1,2,3,4,5, Kurt G Schilling 4,5
PMCID: PMC10528451  NIHMSID: NIHMS1915010  PMID: 37400042

Abstract

Functional magnetic resonance images (fMRI) acquired using echo planar sequences typically suffer from spatial distortions due to susceptibility induced off-resonance fields, which may cause geometric mismatch with structural images and affect subsequent quantification and localization of brain function. State-of-the art distortion correction methods (for example, using FSL’s topup or AFNI’s 3dQwarp algorithms) require the collection of additional scans - either field maps or images with reverse phase encoding directions (i.e., blip-up/blip-down acquisitions) - to estimate and correct distortions. However, not all imaging protocols acquire these additional data and thus cannot take advantage of these post-acquisition corrections. In this study, we aim to enable state-of-the art processing of historical or limited datasets that do not include specific sequences for distortion correction by using only the acquired functional data and a single commonly acquired structural image. To achieve this, we synthesize an undistorted image with contrast similar to the fMRI data and use the non-distorted synthetic image as an anatomical target for distortion correction. We evaluate the efficacy of this approach, named SynBOLD-DisCo (Synthetic BOLD contrast for Distortion Correction), and show that this distortion correction process yields fMRI data that are geometrically similar to non-distorted structural images, with distortion correction virtually equivalent to acquisitions that do contain both blip-up/blip-down images. Our method is available as a Singularity container, source code, and an executable trained model to facilitate evaluation and integration into existing fMRI preprocessing pipelines.

Introduction

Functional magnetic resonance imaging (fMRI) based on the blood oxygenation-level dependent (BOLD) contrast has proven a valuable tool for mapping brain activity [1, 2]. A majority of fMRI is acquired using some variation of echo-planar imaging (EPI), which enables the collection of a large number of images in a short time. However, a well-known challenge with EPI is that images suffer from geometric and intensity distortions due to inhomogeneities in the static magnetic field in combination with the low bandwidth of the phase encode (PE) direction, causing spatial distortions along this PE direction [3]. These susceptibility distortions can limit the accuracy of functional MRI investigations by causing misalignment with anatomical images and inaccurate localization of brain function, as well as increased variability due to poor alignment within and across subjects [4–6].

Mitigating or correcting susceptibility distortions typically involves modifications of the acquisition technique (e.g., improved shimming, parallel imaging, minimizing readout time) or post-acquisition image processing. Post-acquisition distortion correction strategies include (1) B0 field mapping by measuring the difference between two gradient echo images with different echo times, and using this field to estimate voxel-wise displacement [3, 7]; (2) using a ‘blip-up/blip-down’ strategy where the phase encoding direction during acquisition is reversed (e.g., the image is phase encoded in the anterior-to-posterior, AP, direction and reverse phase encoded image is in the posterior-to-anterior, PA, direction), resulting in equal but oppositive effects that can be used to estimate and correct distortions [3, 8, 9]; (3) mapping the EPI point-spread function [10, 11]; and (4) non-rigid registration of the distorted EPI to an undistorted anatomical scan [12–15].

Of these, field mapping and the reverse-phase encoding strategies are apparently the most commonly used and have been implemented in various software packages (for example the topup algorithm in the FSL toolkit [16]) and in containerized pipelines. Notably, the reverse phase encode strategy has several advantages over field maps and nonlinear registrations, including direct image-based estimates of distortion, appropriate signal intensity corrections, and are agnostic to vendor [17, 18]. For this reason, we consider topup-like algorithms as being state-of-the art within this context.

Unfortunately, not all functional imaging protocols include a reverse phase encode scan or field map and thus cannot take advantage of state-of-the art distortion correction methods. For example, despite their current popularity, many historical datasets were not collected with these sequences [19–21], and adoption may be hindered due to limited compatibility with best-practices. Additionally, time constraints may preclude collection of these scans, particularly in clinical settings. Hence, it would be desirable to be able to perform distortion correction on these datasets using processing techniques that do not require such acquisitions.

We aimed to enable topup-like processing with historical and/or limited fMRI datasets without reverse phase encoding scans or field maps. Towards this end, we had two novel insights. First, nearly all functional studies include a structural image in addition to the BOLD fMRI contrasts, and this image generally does not suffer from significant geometric distortions. Second, progress in computer vision has enabled image synthesis from one contrast/modality to another [22]. While the validity of contrast ‘hallucination’ for clinical interpretation is controversial [23], its ability to act as an image processing intermediate, or a substrate for distortion correction, may have complementary utility. In fact, image synthesis has already proven effective in distortion correction for diffusion MRI [24, 25] and fMRI datasets [26].

We propose to use these insights to enable the use of topup (or any distortion correction algorithm) with the collected functional MRI data and only a single structural image. We leverage deep learning to synthesize an undistorted BOLD image from the acquired distorted BOLD image and a T1-weighted (T1w) structural scan. This undistorted synthetic image with BOLD contrast (i.e., T2* weighted contrast of the acquired fMRI) can be used as a calibration scan within the topup (or other distortion correction) algorithm by informing the algorithm that the synthesized image has an infinite bandwidth in the phase encoding direction (i.e., it is undistorted). We name this pipeline SynBOLD-DisCo (Synthetic BOLD images for Distortion Correction). We show that this pipeline corrects image geometry in regions most susceptible to distortions, resulting in better matching to the structural image, and is practically equivalent to running a topup-like approach with both forward and reverse phase encoded data.

Methods

A high-level overview of the SynBOLD-DisCo pipeline is shown in Figure 1. The aim is to synthesize an undistorted fMRI image from a distorted fMRI image and an anatomical T1w image. The distorted and undistorted images act as inputs to topup, informing topup that the synthesized image has an infinite bandwidth, and provides topup with the necessary information to correct the acquired dataset.

Figure 1.

Figure 1.

Overall pipeline. The goal is to generate an undistorted fMRI dataset from a single blip (distorted) fMRI dataset and an anatomical T1w image through a deep learning approach. The undistorted image can then be concatenated with the distorted fMRI and run through FSL’s topup using a simulated infinite phase encode bandwidth. This enables topup to estimate the susceptibility field and subsequently correct distortion in the acquired fMRI dataset.

Data

Our goal was to ensure that our synthesis network will generalize to unseen datasets. To achieve this, we trained our network using a range of datasets, acquired on different scanners and vendors, with varying resolutions, contrasts, and distortion magnitudes. For learning and training, we used de-identified data from 9 different datasets (Table 1), each with varying number of subjects, sessions, and contrasts. Eight of the datasets are open-source and downloaded directly from OpenNeuro.org [19], while one dataset was acquired at the Vanderbilt University Institute of Imaging Science (VUIIS) under Institutional Review Board (IRB) 182089 and 181231. Importantly, these datasets were selected based on an exhaustive review of datasets available on OpenNeuro.org that contain the necessary complementary phase encoded BOLD data (searching for gradient echo pairs only) to train and validate our model against gold standard distortion correction. The digital object identifier (DOI) for each dataset is given in Table 1.

Table 1.

Datasets used for learning and testing, as well as external validation of SynBOLD-DisCo.

DATASET VERSION SUBJECTS SESSIONS RUNS TOTAL DATASETS VENDOR T1w FMRI DOI
TE/TR (ms) resolution TE/TR (ms) resolution
Learning & Testing ds002603 1.0.0 23 1 4 92 Philips 3.7/8.1 1mm iso 25–35/2000 2–3mm iso 10.18112/openneuro.ds002603.vl.0.0
ds002606 1.1.0 10 2 1 20 Siemens 3.4/2.5 0.8mm iso 22/1228 1.6mm iso 10.18112/openneuro.ds002606.vl.l.0
ds002655 1.0.1 35 1 1 35 Siemens 2.26/1900 0.97x0.97x1 45.2/2200 1.8mm iso 10.18112/openneuro.ds002655.vl.0.1
ds002685 1.3.1 12 2–14 1–4 363 Siemens 3.16/2300 1mm iso 27/2000 1.5mm iso 10.18112/openneuro.ds002685.vl.3.1
ds002738 1.0.2 33 1 1 33 GE -/- 0.9mm iso 30/680 2.2mm iso 10.18112/openneuro.ds002738.vl.0.2
ds002878 2.0.0 35 1 1 35 Siemens 2.1/- 0.875 iso 30/1400 2.5mm iso 10.18112/openneuro.ds002878.v2.0.0
ds003037 1.0.1 53 1–6 1 138 Philips 3.5/7 1mm iso 30/2000 3x3x3.33 10.18112/openneuro.ds003037.vl.0.1
ds003752 1.0.1 3 1 5 15 Siemens 2.2/2A 0.8mm iso 37/800 2mm iso 10.18112/openneuro.ds003752.vl.0.0
VUIIS - 61 1–2 1 74 Philips 3.0/8 1mm iso 23/1300 2.5mm iso N/A
External Validation ds001796 1.7.0 20 1 1 20 Siemens 2.4/2400 0.7mm iso 30/1500 2mm iso 10.18112/openneuro.ds001796.vl.7.0
ds003507 1.0.1 21 1 1 21 Siemens 4.1/2250 1mm iso 34/1000 3x3x2.7 10.18112/openneuro.ds003507.vl.0.1
ds004158 1.0.4 20 1 1 20 Siemens 2.3/2300 0.8mm iso 35/800 2mm iso 10.18112/openneuro.ds004158.vl.0.4
ds004215 1.0.2 36 1 1 36 GE 2.9/6.9 1mm iso 16.9/3000 3.4mm iso 10.18112/openneuro.ds004215.vl.0.2

In addition, to validate SynBOLD-DisCo on datasets that were not included in the training/testing/validation cohort, we leveraged four additional datasets also available on OpenNeuro.org (Table 1). This ‘external validation’ cohort was again composed of different cohorts from different scanners with different structural and functional imaging parameters. Importantly, three of these cohorts allowed us to compare against state-of-the art correction using reverse PE pairs (ds003507, ds004158, and ds004215) while the last let us compare against state-of-the art correction using acquired field maps (ds001796).

Preprocessing

Given a T1w and distorted (acquired) BOLD image, the goal of the network was to synthesize a BOLD image with the geometry of the T1w, but contrast of original BOLD image. For this, it was necessary to prepare 5 sets of data for each subject: (1) the structural 3D T1w image, (2) the mean distorted BOLD image from the forward phase encoding (3) the mean distorted BOLD image from the reverse phase encoding (4) the mean undistorted BOLD image from the forward encoding after state of the art correction using topup; and (5) the mean undistorted BOLD image from the reverse encoding after state of the art correction using topup. These images were registered and transformed to Montreal Neurological Institute (MNI) atlas space (6th generation MNI ICBM 152 asymmetric template) [27]. Here, #1, #2, and #3 acted as inputs to the network, while #4 and #5 acted as training targets.

First, each image in the complementary phase encoded pair was motion corrected and averaged with FSL’s mcflirt [28], generating distorted complementary mean BOLD (T2*) images. Second, we utilized topup to take these complementary mean BOLD images and generate a distortion correction field map [9, 16]. Undistorted mean BOLD images (i.e., the training targets) were obtained by applying the correction field maps to the original complementary phase encoded images and taking the average of the 4D time series, producing two corrected images from each complementary BOLD image pair.

Next, N3 bias field correction and intensity normalization were performed on the input T1w MRI image using the FreeSurfer library (v7.2) [29, 30]. To ensure the network inputs (i.e., the distorted mean BOLD image and normalized T1w MRI) and target (i.e., the undistorted mean BOLD image) were in the same space, FSL’s epi_reg (a rigid-body 6 degree of freedom transformation) was used to register both BOLD images to the T1w MRI [16]. The T1w MRI was then affine registered using the Advanced Normalization Tools (ANTs) library (v2.4.1) [31] to the 1.0 mm isotropic MNI ICBM 152 asymmetric template. Subsequently, all images were transformed to MNI space at 2.5 mm isotropic resolution.

Next, the intensities of the normalized T1w MRI and the undistorted and distorted mean BOLD signals were scaled. We mapped the intensity-normalized T1w MRI intensities which were between 0 and 150 to have a minimum/maximum intensity range between −1 and 1. Similarly, distorted and undistorted BOLD contrasts were scaled such that values within the 0 and 99th percentiles were mapped between −1 and 1.

Network/training loss

Following our work in diffusion MRI image synthesis [24, 25], a 3D U-net was used to generate a synthetic, undistorted image with BOLD contrast in 2.5 mm atlas space from the distorted mean BOLD signal and the T1w MRI, leveraging the topup undistorted mean BOLD images as targets (Figure 2).

Figure 2.

Figure 2.

Training logic and loss calculation. Each U-net has 2 input channels (a T1w image and distorted BOLD image) and a single output channel (synthesized undistorted BOLD image). Three losses are computed: (1) the MSE between the synthesized and topup-corrected undistorted image from the forward PE dataset, (2) the MSE between the synthesized and topup-corrected undistorted image from the reverse PE dataset, and (3) the MSE between the synthesized undistorted images in the forward and reverse directions. This forces the synthesized images to be similar to their undistorted targets, and also that the forward and reverse images produce similar synthetic (undistorted) volumes.

The network is based on a 3D U-net implementation [32, 33] with a dual channel input, leaky ReLU activations, and instance normalization instead of batch normalization layers. For training purposes, the data were partitioned across subjects for test, validation, and training sets. The data set was first partitioned into a test set of 30 random subjects (12% of subjects, 81 total image pairs) and a “learning” set of 235 subjects (724 total image pairs). The test set was completely withheld during training. The learning set was partitioned using 5-fold cross validation into training and validation sets.

The network was trained for 120 epochs with a learning rate of 0.0001. Beta values of 0.9 and 0.999 were used with the Adam optimizer. A weight decay rate of 1×10−5 was applied. After each epoch, the validation loss was computed, and the weights of the model were saved if it improved. This resulted in five trained networks, one for each fold. Training was performed on NVIDIA GeForce GTX 1080 Ti and Quadro RTX 5000 GPUs, requiring approximately 9GB of memory.

During each iteration, the following losses were computed (Figure 2). First, both the forward and reverse distorted mean BOLD signals were passed through the network with the associated normalized T1w MRI to produce two synthetic, undistorted images with BOLD contrast. Next, we computed three losses: (1) the mean squared error (MSE) across all image voxels between the synthesized and topup-corrected undistorted images from the forward PE, (2) the MSE between the synthesized and topup-corrected undistorted images from the reverse PE, and (3) the MSE between the synthesized undistorted images in the forward and reverse directions. The rationale behind this was to enforce (1) that the synthesized images be similar to their respective undistorted targets and (2) that the forward and reverse images produced similar synthetic scans, similar to Siamese [34] and null space network designs [35].

Distortion correction leveraging the synthetic volume

Application of the SynBOLD-DisCo network/pipeline to an fMRI dataset followed 3 basic steps (Figure 3). First, T1w and the 4D Distorted fMRI were preprocessed as described above resulting in a preprocessed T1w and 3D Distorted fMRI (Figure 3, Preprocessing). These acted as inputs to the 3D U-net, which resulted in a 3D Synthetic (undistorted) fMRI volume (Figure 3, Network). For the final network, the five networks trained during cross validation were used and the ensemble average of the result was taken to create the synthesized undistorted fMRI volume in MNI space. The inverse transforms were used to transform the generated undistorted fMRI volume from MNI-space back to native subject space. The distorted and undistorted volumes were merged and passed into topup (Figure 3, Distortion correction) with an acquisition parameters file (acqparamst.txt, in FSL nomenclature) that informs topup that the second volume (i.e., the undistorted volume) contains no susceptibility distortion (specifically, the total readout time is set to 0, indicating an infinite PE bandwidth). Finally, the field map estimated through the topup algorithm can now be applied to the raw (distorted) fMRI dataset to mitigate and correct susceptibility distortion.

Figure 3.

Figure 3.

The SynBOLD-DisCo pipeline. (Preprocessing) A distorted fMRI BOLD series and a T1w MRI were preprocessed and transformed to atlas space, (Network) where a 3D U-net synthesizes a synthetic, undistorted fMRI BOLD image. (Distortion Correction) This synthetic image can be used with existing state-of-the-art distortion correction methods, like FSL’s topup, to compute field maps that allow the entire fMRI BOLD sequence to be corrected.

Qualitative evaluation in withheld dataset

Qualitative evaluation was performed to visually inspect results of the pipeline on the withheld test set. The goals of qualitative evaluation were threefold: (1) verify that the synthesized image was geometrically similar to T1w and also with contrast that would be expected of the imaging conditions, (2) validate that application of the pipeline resulted in correction/mitigation of susceptibility artifacts in the final fMRI volumes, and (3) validate that the results were visually similar to that of state-of-the art processing when reverse PE data are available.

Quantitative evaluation with external validation

It was critical that our algorithm generalized to datasets not used in testing, training, nor validation. To do this, we validated our algorithm on fMRI datasets different from those it was trained on. Here, our goal was to show that our algorithm results in images that were geometrically similar to the undistorted T1w, and also to show that our algorithm resulted in images with geometry and contrast similar to that when full reverse PE data are available.

While several metrics were available to compare geometric similarity to T1w, we chose to calculate the mutual information (MI) between the T1w and all BOLD images as a measure of geometric fidelity of the BOLD images. The BOLD images assessed included those with (1) no distortion correction applied, (2) distortion correction applied with reverse phase encode (or field map) scans using the FSL toolbox [36], (3) distortion correction applied with reverse phase encode (or field map) scans using the 3dQwarp-based programs within the AFNI toolbox [37], (4) the synthesized BOLD image, and (5) the final output of the SynBOLD-DisCo pipeline. For all cases, images were rigidly registered to the T1w images using the epi_reg function in FSL. Pair-wise Wilcoxon signed-rank tests with Bonferroni correction at 0.05 significance were used to determine whether images were more geometrically similar to the T1w than when not performing distortion correction at all. Note, it was not our intention to compare algorithms against each other (see Discussion), so statistical tests were used only to compare each corrected BOLD image to the “no correction” dataset. Similarity metrics and statistical evaluation were performed in MATLAB (2021b, The MathWorks Inc.).

To show that our algorithm resulted in images with geometry and contrast similar to state-of-the art methods, we additionally compared all images above directly to the output when using the FSL software package [36]. We chose to use both voxel-wise mean squared error (MSE) and correlation coefficients (CC) to assess similarity to state-of-the art results.

Results

Results with cross-validation on withheld test set

The resulting training/validation and test results are shown in Figure 4 for all 5 folds of analysis. A fast decrease in training loss was observed over the first 30 epochs with small improvement afterwards. Over the final 30 epochs a continued decrease in training loss was observed with no improvement in validation loss, suggesting appropriate generalizability. Additionally, because the plotted loss is a combination of three MSE loses, an observed loss of ~0.1 for testing and validation error is ~5% or less of the total image range, suggests that our network can accurately synthesize images that match the desired output.

Figure 4.

Figure 4.

Training, validation, and withheld testing set losses. The mean and standard deviation of the losses for each dataset across the 5-folds are plotted and suggest network convergence and appropriate generalizability to withheld data by the end of training (120 epochs). Each of the five folds fulfilled early stopping criteria and the final models were saved between the 90th and 120th folds. The testing loss was computed once at the end of training.

Figure 5 shows results from the withheld test set, including the T1w, the distorted BOLD image, synthetic image, SynBOLD image (final output from our pipeline), and the BOLD image processed using state-of-the art pipelines (e.g., FSL’s topup). Three observations are apparent. First, the network can synthesize an image that is geometrically similar to the T1w but with BOLD contrast. Second, the SynBOLD-corrected images are more geometrically similar to their paired T1ws than to the distorted image, with reduced distortions most visually apparent in anterior regions of the brain, temporal lobes, and mid-brain areas. And third, the SynBOLD-corrected output is qualitatively very similar to those obtained using topup with full sets of forward/reverse PE data.

Figure 5.

Figure 5.

Qualitative visualization of example data from the withheld test set. The figure includes the “Distorted” image, “Synthetic” image, “SynBOLD” or final output of our pipeline, and “State-of-the art” (i.e., topup-corrected) image, and a corresponding structural T1w scan. The network synthesizes an image with geometry similar to T1w but with BOLD contrast; the SynBOLD output shows reduced image distortion with corrected signal intensities; and the SynBOLD output is visually similar to that obtained when full reverse PE scans are available.

Results with external validation

Qualitative results from the external validation datasets are shown in Figure 6. For one example subject from each external dataset we show the T1w, distorted, topup-corrected, 3dQwarp-based AFNI-corrected, synthetic, and SynBOLD-corrected BOLD images. It is important to note that while these data were chosen because they have reverse PE or field map data, the SynBOLD algorithm was run without their inclusion to replicate a scenario where they may not exist in real experimental conditions. First, these datasets are visually different from each other and from training sets, with varying quality and contrast (note that contrast for all images is automatically scaled for visualization from the minimum to the maximum intensity value). Second, the synthetic image is visually similar to state-of-the art AFNI and topup-corrected images in both contrast and geometry, with edges that well-align with the T1w weighted image. Third, the final SynBOLD output similarly matches state-of-the art, suggesting that the full pipeline indeed corrects distorted data to best match the synthetic image. In all cases, areas of large distortions are clearly corrected, with significantly improved alignment of both the pial surfaces and white/gray matter boundaries.

Figure 6.

Figure 6.

Visualization of a single subject from each of the external validation datasets. For each, a T1w image is shown along with the distorted, topup-corrected, AFNI-corrected, synthetic, and final SynBOLD image (all registered independently to the T1w image). Edges from the structural image are overlaid on each to draw attention to areas of alignment/misalignment. In agreement with the withheld datasets, the network synthesizes an image with geometry similar to T1w but with BOLD contrast; the SynBOLD output shows reduced image distortion with corrected signal intensities; and the SynBOLD output is qualitatively similar to that obtained when full reverse PE scans are available. “Afni_proc” refers to the script afni_proc.py which wraps the 3dQwarp nonlinear registration tools.

Quantitative comparisons to the T1w are shown in Figure 7 where MI between the T1w and each of the BOLD contrasts are quantified. As expected, the use of field maps and reverse PE data significantly improves MI with T1w (i.e. the geometry better matches the undistorted T1w). Next, the synthetic image consistently shows increased MI. Unsurprisingly, because this is indeed a hallucinated image, this synthetic image often better replicates the geometry of the structural image than other state-of-the art methods that are susceptible to noise and other image imperfections (i.e., dropout, zipper artifacts). Finally, the final output of the SynBOLD pipeline also consistently shows increased MI with the structural image, indicating correction of geometric distortions.

Figure 7.

Figure 7.

SynBOLD results in images that are geometrically similar to T1w. For the 4 external validation datasets, MI between the BOLD images and T1w are calculated for the distorted (DIST), topup-corrected, AFNI-corrected, synthetic, and SynBOLD-corrected volumes. Statistically significant improvements compared to the distorted volumes are indicated with an asterisk.

Figure 8 shows comparisons of algorithms to FSL’s topup. Note that AFNI’s implementation of reverse PE or field maps could similarly be considered state-of-the art and would not change the general conclusions based on the results presented in this figure. In most cases (with one exception, dataset ds001796), correction using the SynBOLD method decreases MSE and increased CC when compared to the distorted dataset, suggesting this pipeline results in outputs that closely match state-of-the art correction methods. Interestingly, the synthetic image does not always completely match the topup-corrected image, and in fact increases MSE. This aligns with results of Figure 7 and is possibly due to the network hallucinating a ‘perfect’ geometry and contrast whereas even state-of-the art methods are susceptible to imperfections and signal dropout.

Figure 8.

Figure 8.

SynBOLD results in images that are more similar to state-of-the art correction methods than the original distorted data. For the 4 external validation datasets, MSE (top) and CC (bottom) between topup-corrected images and each of the distorted (DIST), AFNI-corrected, synthetic, and SynBOLD datasets are calculated.

Discussion

In this study, we have implemented a distortion correction technique, SynBOLD-DisCo, that can be implemented in the absence of field maps or reverse PE scans and requires only a standard T1-weighted acquisition. We have shown qualitatively that SynBOLD-DisCo results in reasonable distortion correction, largely similar to state-of-the art methods that require additional acquisitions. Quantitative analysis suggests that the algorithm performs nearly as well as state-of-the art topup at correcting distortion artifacts in fMRI data. These methods were applied to >80 datasets from 9 different studies in the withheld test set and applied to 97 datasets from 4 different studies from an external validation set, showing consistent correction of observable distortions, and brain geometry more similar to the structural images than prior to correction.

Comparison to state-of-the-art

It is important to emphasize that correction without modern/supplementary sequences is not a first choice for study design: if reverse PE or field map data (of good quality) can be acquired, we highly suggest using these data to correct distortions within a generally accepted best-practices preprocessing pipeline [38]. However, a large amount of fMRI data have been acquired, and are still acquired, with sequences and scanners that do not include these supplementary acquisitions. A quick search of platforms for validating and sharing data (OpenNeuro.org in our case) shows a high proportion of datasets where state-of-the art corrections are not possible. Thus, it is important to develop alternative distortion correction strategies for these data.

SynBOLD performs nearly as well as algorithms that use this additional information – particularly when comparing the resulting fMRI geometry with the structural images. There are several possible reasons for this. First, image synthesis has proven [26] to be a powerful tool in medical imaging, and it is well known that networks can produce new image contrast but maintain geometry of the original content. Thus, it is not surprising that the synthesized image shares strong geometric similarity to the T1w image, and acts as a well-behaved substrate for algorithms to estimate the appropriate field that warps the distorted to this undistorted image (or alternatively, the field that caused this distortion). Second, field maps and reverse PE scans can be unstable, are sensitive to subject motion, rely on accurate alignment/registration, require specific header information, and are thus susceptible to errors. Thus, while we do not recommend our technique over these state-of-the art methods, it can be used when these additional data exist but are corrupted or sub-optimal.

Comparison to alternative methods

The use of a synthesized, geometrically accurate image as a substrate for distortion correction is not new. We have done this in diffusion MRI [24, 25], using methods closely resembling those described here, with results on-par with those of traditional or state-of-the art distortion correction [39]. Recently, the use of synthesized images as a substrate for fMRI distortion has also been published [26]. In Montez et al., [26], the authors found an optimal nonlinear mapping between T1/T2 weighted images and BOLD contrasts to generate an undistorted BOLD substrate to be used for distortion correction. One key difference from our approach is how this substrate was used. In [26], distortion is corrected through nonlinear registration procedures of the distorted BOLD to the undistorted synthesized image. Here, we instead employ algorithms (such as topup) which are widely used and validated, and implement a distortion correction based on physical principles of distortion magnitude and distortion direction and accompanying effects on signal intensity (i.e., correcting signal attenuation and/or pileup). In fact, in Montez et al., [26], direct comparisons were made between their algorithm and our diffusion-based distortion correction algorithm [24], Synb0-DisCo. The authors rightly noted that while Synb0-DisCo excelled on some datasets, it was inferior on others (although still better than no correction at all). This was again correctly attributed to the challenges of deep learning networks to generalize to unseen datasets. Indeed, our diffusion algorithm was trained on diffusion b=0 contrast only, and on only 3 diffusion MRI datasets. For this reason, our new algorithm was trained on vastly different fMRI (gradient echo) datasets, from different vendors and with different contrasts, enabling generalization to unseen datasets.

Uniquely, our image synthesis can be used with the registration procedures described in [26], or alternatively our chosen distortion correction (based on topup) can be used on the images synthesized in [26]. There is likely no correct choice for all datasets and all acquisition conditions, as every step in the preprocessing pipeline is known to affect neuroimaging results and vary by experimental decisions and subsequent analysis [40].

Integration into preprocessing packages

There are several distortion correction methods that use additional data in the form of field maps or additional data and subsequent signal and image processing [3, 6, 15, 41]. We have chosen topup as the standard for comparison, as it is available in multiple image processing packages, has arguably seen the most widespread use, and has become the tool of choice for many large neuroimaging initiatives. Thus, while our pipeline is intimately linked to topup, it is easily integrated into other existing packages. For example, one of the outputs of the topup pipeline (and thus an output of our pipeline, see Open-Sourced Code, below) is a field map. This field map can be used in any preprocessing pipeline from any package (for example SPM [42], the epi_b0_correct.py program within AFNI [37], fMRIPrep [43], BrainVoyager [44]) and is already well-aligned with the acquired BOLD images. Alternatively, the distorted + synthesized images can be obtained from our pipeline and integrated into these same software packages or pipelines that can utilize reverse PE information, provided the software is aware that the synthesized image has infinite bandwidth.

Because of this large array of choices for just the distortion correction step, it would be of interest to the field of functional MRI to perform a comprehensive evaluation and comparison of the large number of existing distortion correction algorithms [40], in addition to other artifacts associated with EPI acquisitions. Towards this end, a standardized dataset and evaluation method, using similar measures of intensity similarities and metric variabilities, would provide valuable benchmarking for algorithms and acquisitions (as exists in diffusion MRI [45]).

One possible limitation of our pipeline is that topup is designed to be used for spin echo sequences, whereas typical BOLD contrast uses gradient echoes. Both gradient echo and spin echo show EPI-based spatial distortion. However, while spin-echo signal is ‘moved’ (i.e. compressed or stretched) in areas of distortion, susceptibility distortion and dephasing in gradient echo images causes unrecoverable signal loss. When using reverse phase encoded gradient echo images to calculate the field map via topup, it is ill-defined in regions with little-to-no signal – thus, topup with spin echo images is typically recommend in order to estimate the susceptibility field. However, this is not as a major limitation, as in areas with little-to-no signal there is nothing (signal) to shift anyways. In fact, studies show positive results when using gradient echo reverse phase encode scans [4], and some studies even suggest better results when matching the type of data being collected (i.e. to use reverse phase encode gradient echo data to collect acquired gradient echo BOLD contrast) [18].

Open-Sourced Code

A Singularity virtual machine image has been made available to enable simple evaluation of the proposed techniques at https://github.com/MASILab/SynBOLD-DisCo. The Singularity requires only an fMRI volume (as either 3D or 4D image) and T1w images as inputs, and performs all necessary pre-processing (including T1w bias field correction and normalization and registration to MNI space), image synthesis or model inference, and topup – returning as output the undistorted volumes, topup field coefficients, and all intermediate data. Optional settings include the ability to change topup configuration or acquisition parameters files, as well as to skip topup processing entirely if only the synthesized image is desired for integration into other pipelines. Source code, binaries, and Docker images are additionally available: https://github.com/MASILab/SynBOLD-DisCo. These open-source efforts simplify training or transfer learning with larger datasets.

Acknowledgements

This work was conducted in part using the resources of the Advanced Computing Center for Research and Education at Vanderbilt University, Nashville, TN. This work was supported by the National Institutes of Health (NIH) under award numbers R01EB017230, RF1MH123201, R01NS110130, R01NS108445, R01NS112252, K01EB032989, T32EB001628, 1U34DK123895-01, U34DK123894-01, U54HD083211, 5T32DC000038-30, R01NS113832, R01NS078680, and T32GM007347 and by the National Science Foundation (NSF) under award number 2040462. The content is solely the responsibility of the authors and does not necessarily represent the official views of the NIH or NSF. The authors also wish to thank Daniel Glen, Rick Reynolds and Paul Taylor from the AFNI team for feedback on the AFNI processing scripts.

Footnotes

TY (investiation, analysis, writing); LC (investigation, analysis, writing), ST (analysis, validation, writing), ATV (analysis, resources, editing), VLM (analysis, editing, funding, resources), SEG (analysis), KR (analysis), SLM (analysis, editing), JL (analysis, validation), AW (analysis, validation), DJE (funding, resources), LC (funding, resources), CC (funding, resources), JCG (funding, resources), BAL (conceptualization, resources, funding, writing), KGS (supervision)

Publisher's Disclaimer: This is a PDF file of an unedited manuscript that has been accepted for publication. As a service to our customers we are providing this early version of the manuscript. The manuscript will undergo copyediting, typesetting, and review of the resulting proof before it is published in its final form. Please note that during the production process errors may be discovered which could affect the content, and all legal disclaimers that apply to the journal pertain.

References

  • 1.Heeger DJ and Ress D, What does fMRI tell us about neuronal activity? Nat Rev Neurosci, 2002. 3(2): p. 142–51. [DOI] [PubMed] [Google Scholar]
  • 2.Logothetis NK, What we can do and what we cannot do with fMRI. Nature, 2008. 453(7197): p. 869–78. [DOI] [PubMed] [Google Scholar]
  • 3.Jezzard P and Balaban RS, Correction for geometric distortion in echo planar images from B0 field variations. Magn Reson Med, 1995. 34(1): p. 65–73. [DOI] [PubMed] [Google Scholar]
  • 4.Abreu R and Duarte JV, Quantitative Assessment of the Impact of Geometric Distortions and Their Correction on fMRI Data Analyses. Front Neurosci, 2021. 15: p. 642808. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 5.Togo H, et al. , Effects of Field-Map Distortion Correction on Resting State Functional Connectivity MRI. Front Neurosci, 2017. 11: p. 656. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 6.Hutton C, et al. , Image distortion correction in fMRI: A quantitative evaluation. Neuroimage, 2002. 16(1): p. 217–40. [DOI] [PubMed] [Google Scholar]
  • 7.Chen NK and Wyrwicz AM, Correction for EPI distortions using multi-echo gradient-echo imaging. Magn Reson Med, 1999. 41(6): p. 1206–13. [DOI] [PubMed] [Google Scholar]
  • 8.Morgan PS, et al. , Correction of spatial distortion in EPI due to inhomogeneous static magnetic fields using the reversed gradient method. J Magn Reson Imaging, 2004. 19(4): p. 499–507. [DOI] [PubMed] [Google Scholar]
  • 9.Andersson JL, Skare S, and Ashburner J, How to correct susceptibility distortions in spin-echo echo-planar images: application to diffusion tensor imaging. Neuroimage, 2003. 20(2): p. 870–88. [DOI] [PubMed] [Google Scholar]
  • 10.Zeng H and Constable RT, Image distortion correction in EPI: comparison of field mapping with point spread function mapping. Magn Reson Med, 2002. 48(1): p. 137–46. [DOI] [PubMed] [Google Scholar]
  • 11.Zaitsev M, Hennig J, and Speck O, Point spread function mapping with parallel imaging techniques and high acceleration factors: fast, robust, and flexible method for echo-planar imaging distortion correction. Magn Reson Med, 2004. 52(5): p. 1156–66. [DOI] [PubMed] [Google Scholar]
  • 12.Kybic J, et al. , Unwarping of unidirectionally distorted EPI images. IEEE Trans Med Imaging, 2000. 19(2): p. 80–93. [DOI] [PubMed] [Google Scholar]
  • 13.Huang H, et al. , Correction of B0 susceptibility induced distortion in diffusion-weighted images using large-deformation diffeomorphic metric mapping. Magn Reson Imaging, 2008. 26(9): p. 1294–302. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14.Chambers MC, et al. , Correcting Inhomogeneity-Induced Distortion in Fmri Using Non-Rigid Registration. Proc IEEE Int Symp Biomed Imaging, 2015. 2015: p. 1364–1367. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 15.Wang S, et al. , Evaluation of Field Map and Nonlinear Registration Methods for Correction of Susceptibility Artifacts in Diffusion MRI. Front Neuroinform, 2017. 11: p. 17. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 16.Smith SM, et al. , Advances in functional and structural MR image analysis and implementation as FSL. Neuroimage, 2004. 23 Suppl 1: p. S208–19. [DOI] [PubMed] [Google Scholar]
  • 17.Gu X and Eklund A, Evaluation of Six Phase Encoding Based Susceptibility Distortion Correction Methods for Diffusion MRI. Front Neuroinform, 2019. 13: p. 76. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 18.Schallmo MP, et al. , Assessing methods for geometric distortion compensation in 7 T gradient echo functional MRI data. Hum Brain Mapp, 2021. 42(13): p. 4205–4223. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 19.Markiewicz CJ, et al. , The OpenNeuro resource for sharing of neuroscience data. Elife, 2021. 10. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 20.Poldrack RA, et al. , Toward open sharing of task-based fMRI data: the OpenfMRI project. Front Neuroinform, 2013. 7: p. 12. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 21.Biswal BB, et al. , Toward discovery science of human brain function. Proc Natl Acad Sci U S A, 2010. 107(10): p. 4734–9. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 22.Svoboda D and Burgos N, Chapter 1 - Introduction to medical and biomedical image synthesis, in Biomedical Image Synthesis and Simulation, Burgos N and Svoboda D, Editors. 2022, Academic Press. p. 1–3. [Google Scholar]
  • 23.Cohen JP, Luck M, and Honari S. Distribution matching losses can hallucinate features in medical image translation. in Medical Image Computing and Computer Assisted Intervention–MICCAI 2018: 21st International Conference, Granada, Spain, September 16–20, 2018, Proceedings, Part I. 2018. Springer. [Google Scholar]
  • 24.Schilling KG, et al. , Synthesized b0 for diffusion distortion correction (Synb0-DisCo). Magn Reson Imaging, 2019. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 25.Schilling KG, et al. , Distortion correction of diffusion weighted MRI without reverse phase-encoding scans or field-maps. PLoS One, 2020. 15(7): p. e0236418. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 26.Montez DF, et al. , Using synthetic MR images for distortion correction. Developmental Cognitive Neuroscience, 2023. 60: p. 101234. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 27.Fonov V, et al. , Unbiased average age-appropriate atlases for pediatric studies. Neuroimage, 2011. 54(1): p. 313–27. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 28.Jenkinson M, et al. , Improved optimization for the robust and accurate linear registration and motion correction of brain images. Neuroimage, 2002. 17(2): p. 825–41. [DOI] [PubMed] [Google Scholar]
  • 29.Sled JG, Zijdenbos AP, and Evans AC, A nonparametric method for automatic correction of intensity nonuniformity in MRI data. IEEE Trans Med Imaging, 1998. 17(1): p. 87–97. [DOI] [PubMed] [Google Scholar]
  • 30.Fischl B, FreeSurfer. Neuroimage, 2012. 62(2): p. 774–81. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 31.Avants BB, et al. , A reproducible evaluation of ANTs similarity metric performance in brain image registration. Neuroimage, 2011. 54(3): p. 2033–44. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 32.Ronneberger O, Fischer P, and Brox T. U-net: Convolutional networks for biomedical image segmentation. in Medical Image Computing and Computer-Assisted Intervention–MICCAI 2015: 18th International Conference, Munich, Germany, October 5–9, 2015, Proceedings, Part III 18. 2015. Springer. [Google Scholar]
  • 33.Çiçek Ö, et al. 3D U-Net: learning dense volumetric segmentation from sparse annotation. in Medical Image Computing and Computer-Assisted Intervention–MICCAI 2016: 19th International Conference, Athens, Greece, October 17–21, 2016, Proceedings, Part II 19. 2016. Springer. [Google Scholar]
  • 34.Liu CF, et al. , Using deep Siamese neural networks for detection of brain asymmetries associated with Alzheimer’s Disease and Mild Cognitive Impairment. Magn Reson Imaging, 2019. 64: p. 190–199. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 35.Nath V, et al. , Inter-Scanner Harmonization of High Angular Resolution DW-MRI using Null Space Deep Learning. Lect Notes Monogr Ser, 2019. 2019: p. 193–201. [PMC free article] [PubMed] [Google Scholar]
  • 36.Jenkinson M, et al. , Fsl. Neuroimage, 2012. 62(2): p. 782–90. [DOI] [PubMed] [Google Scholar]
  • 37.Cox RW, AFNI: software for analysis and visualization of functional magnetic resonance neuroimages. Comput Biomed Res, 1996. 29(3): p. 162–73. [DOI] [PubMed] [Google Scholar]
  • 38.Nichols TE, et al. , Best practices in data analysis and sharing in neuroimaging using MRI. Nat Neurosci, 2017. 20(3): p. 299–303. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 39.Yang JY, et al. , Assessment of intraoperative diffusion EPI distortion and its impact on estimation of supratentorial white mateer tract positions in pediatric epilepsy surgery. Neuroimage Clin, 2022. 35: p. 103097. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 40.Botvinik-Nezer R, et al. , Variability in the analysis of a single neuroimaging dataset by many teams. Nature, 2020. 582(7810): p. 84–88. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 41.Treiber JM, et al. , Characterization and Correction of Geometric Distortions in 814 Diffusion Weighted Images. PLoS One, 2016. 11(3): p. e0152472. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 42.Poline JP, Statistical parametric maps in functional imaging: a general linear approach. Human brain mapping, 1994. 2(4): p. 189–210. [Google Scholar]
  • 43.Esteban O, et al. , fMRIPrep: a robust preprocessing pipeline for functional MRI. Nat Methods, 2019. 16(1): p. 111–116. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 44.Formisano E, Salle F, and Goebel R, Fundamentals of Data Analysis Methods in Functional MRI. 2005. p. 481–503. [Google Scholar]
  • 45.Irfanoglu MO, et al. , Evaluating corrections for Eddy-currents and other EPI distortions in diffusion MRI: methodology and a dataset for benchmarking. Magn Reson Med, 2019. 81(4): p. 2774–2787. [DOI] [PMC free article] [PubMed] [Google Scholar]

RESOURCES