APPS Bruker File Conversion - dwong263/MAGIQ GitHub Wiki

Overview

This tab may be used to convert spectroscopy files acquired on the Bruker 9.4T scanner system. You can load a Bruker acquisition, apply either eddy-current correction, QUALITY deconvolution or combined QUALITY + eddy-current correction (QUECC), and save the result as a fitMANSuite compatible *.dat file.

Loading a Bruker Acquisition

File conversion requires you to load two Bruker acquisitions. One is the water suppressed acquisition and one is the water unsuppressed acquisition. The water suppressed acquisition is considered the "Input" and the water unsuppressed acquisition is considered the "Reference".

To load the water suppressed acquisition, first hit the Browse button next to the "Input Filename" field. Navigate to the folder containing the suppressed acquisition. Within the folder there should be files such as method, fid, acqp, spnam0, and others. These files describe the acquisition parameters used on the scanner and also contain the acquired data. Select the folder containing these files, not any of the individual files.

Once a suppressed acquisition is selected, the application will automatically create a folder called converted within the folder containing the suppressed acquisition. It is in this folder that APPS will store all converted *.dat files. For example, if the suppressed acqusition was located in data/BrownRat2_20190627_1/sup/, any *.dat files generated from the conversion process will be stored in data/BrownRat2_20190627_1/sup/converted/.

Next load the water unsuppressed acquisition by hitting the Browse button next to "Reference File" field. Navigate to the folder containing the unsuppressed acquisition and select it.

Post-Processing Options

The raw free-induction decay signal that is acquired may be post-processed in three different ways during the conversion process; with eddy current correction, with QUALITY deconvolution, or with combined QUALITY + eddy-current correction (QUECC). These methods all aim to correct for lineshape distortions caused by various phenomena during acquisition.

Eddy Current Correction (ECC)

One source of lineshape distortion is the rapidly switching magnetic field gradients used during the localization of the 1h-MRS signal. Due to Faraday's Law, the switching gradients induce eddy currents in conductive structures including the main magnet, the shim coil, and the gradient coils themselves, resulting in shifts in B0 and time-dependent variations in the gradient fields. Eddy current effects manifest as time dependent phase changes in the acquired metabolite data signal, leading to lineshape distortions in the frequency domain.

These distortions may be corrected by subtracting the phase of a reference signal, such as the water signal, from the phase of the acquired data. Eddy current correction (ECC) can be applied to the whole data signal without introducing artifacts into the signal. See the original paper for more details.

In APPS, the water unsuppressed acquisition () is treated as the reference signal, while the water suppressed acquisition () is treated as the metabolite data signal. The processed signal () is then calculated as follows:

Select the "ECC" button to use ECC processing.

QUALITY Deconvolution

Another source of lineshape distortions is B0 inhomogeneity within the spectroscopy voxel. Though B0 shimming is typically applied prior to acquisition to ensure that the magnetic field experienced by the spins of interest is as homogeneous as possible, there may still be some remaining B0 inhomogeneity in the spectroscopy voxel, resulting in a Gaussian distribution of precession frequencies for the spins in the voxel. As a result, the acquired metabolite lineshapes will be more Gaussian than Lorentzian.

This type of lineshape distortion may be corrected using a reference signal from a sample that has experienced the same magnetic inhomogeneities. Assuming that the reference and data signals have the same phase, the contribution of B0 inhomogeneity can be deconvoluted from the acquired metabolite data signal by simply dividing the signals in the time domain. See the original paper for more details.

In APPS, the water unsuppressed acquisition () is treated as the reference signal, while the water suppressed acquisition () is treated as the metabolite data signal. The processed signal () is then calculated as follows.

  • The reference signal is first normalized using the equation ...

where is the maximum magnitude of the first 100 points of .

  • The processed signal is then calculated using the equation ...

Beware: Using the water unsuppressed acquisition as the reference signal complicates the application of QUALITY to the data because the T2 of water is generally shorter than the T2 of most metabolites of interest. Thus, at the end of the time-domain signal, the water unsuppressed signal values are small, and dividing the metabolite data signal by the water unsuppressed signal will result in signal spikes. This can be avoided by simply restricting QUALITY to the beginning of the acquired metabolite data signal and applying ECC to the rest of the data signal.

Select the "QUALITY" button to use QUALITY processing.

Combined QUALITY and ECC (QUECC)

To use QUECC processing, you must select the "QUECC" button and specify the number of "QUALITY points".

The number of "QUALITY points" specifies the "cut-off" point for the QUECC processing. It is the sample number of the complex time-series at which you want to cut-off the QUALITY correction and begin the ECC correction. For example, if you specify 200 "QUALITY points", you are telling APPS to stop QUALITY at sample number 200, and start ECC from sample 200 onwards.

Beware: This definition of the number of "QUALITY points" is different than the definition used by fitMAN. In fitMAN, the number of "QUALITY points" is equal to the number of Real + Imaginary points of the complex time-series on which you want to apply QUALITY. Thus, "200" in APPS is the same as "400" in fitMAN.

One problem with this is that a sharp transition often occurs at the junction where QUALITY ends and ECC begins. To mitigate this problem, APPS automatically applies an exponential filter to the QUALITY processed portion of the signal such that the last QUALITY processed point has the same amplitude as the the first ECC processed point.

Baseline Correction

This corrects for any DC offset present in the acquired spectroscopy signals. In APPS, this is implemented as follows:

  1. The mean of the last eighth of the spectroscopy signal is calculated.
  2. This value is subtracted from the entire spectroscopy signal.

Include a baseline correction during conversion by selecting the "Baseline Correction: Yes" option.

Run Conversion

Run the conversion by hitting the Run Conversion button. After the conversion happens successfully, the raw, uncorrected and the the corrected metabolite signals are plotted in the panel on the right. In the lower panel, you'll find a list of some of the automatically parsed parameters, which you can copy or paste into a document for future reference. You can also find these parameters in the method file located in the folder containing the acquisition.

The converted files are found in the /converted folder. You will see files containing the ...

  • ... corrected water suppressed signal (*.dat format),
  • ... corrected water unsuppressed signal (*.dat format),
  • and the raw, uncorrected water suppressed and unsuppressed signals (*.dat format).

The naming of the *.dat files containing the corrected signals tell you what post-processing options were used. In the above example, corr_sup_bc_quecc200.dat means that this is the corrected (corr), water suppressed signal (sup), with baseline correction (bc), and QUECC correction using 200 QUALITY points (quecc200).

Notes on Conversion Using APPS

  • The file conversion process automatically calculates a "Scale Factor" that scales the resulting signal such that the first point of the free-induction decay signal lies between 0 and 1. It is not yet possible to edit the Scale Factor value in the Post-Processing panel.
  • The file conversion process reads in the acquisition parameters and applies an automatic time delay parameter based on those parameters. It is not yet possible to edit the Time Delay value in the Post-Processing panel.
⚠️ **GitHub.com Fallback** ⚠️