The theory section is taken from Fourier-based-field-estimation.
The "susceptibility-to-fieldmap-fft" code allows one to estimate the magnetic field perturbation that arises when an object is placed within a magnetic field.
When an object is placed within an MRI scanner, it is assumed that the magnetic field experienced by the object is uniform and equal to the applied (
In MRI, the
where the spatial frequency,
If
The first equation can then be rewritten as:
This equation allows us to simulate the magnetic field perturbation arising from a susceptibility distribution
It should be noted that when
Setting the value of $\tilde B_{dz} (\mathbf{k} = 0)$ when the average magnetic field does not equal zero
In order to determine the appropriate value to assign to
The derivation for the analytical solution of the magnetic field arising from a sphere placed within an infinite medium is given in Brown et al. This solution includes the Lorentz sphere correction. If the background material has a susceptibility of
- Internal field:
$\frac{1}{3} \chi_e B_0$ - External field:
$\frac{1}{3} (\chi_i - \chi_e) \cdot \frac{a^3}{r^3} (3 \cos^2(\theta) - 1) \cdot B_0 + \frac{1}{3} \chi_e B_0$
From this the average field value can be derived. For
The derivation for the analytical solution of the magnetic field arising from an infinite cylinder placed within an infinite medium is given in Brown et al. This solution includes the Lorentz sphere correction. If the background material has a susceptibility of
- Internal field:
$\frac{1}{6} (\chi_i - \chi_e) \cdot (3\cos^2(\theta) - 1) B_0 + \frac{1}{3} \chi_e B_0$ - External field:
$\frac{1}{2} (\chi_i - \chi_e) \cdot \frac{a^2}{r^2} \sin^2(\theta) \cos(2\phi) B_0 + \frac{1}{3} \chi_e B_0$
where
If
Setting the value of $\tilde B_{dz} (\mathbf{k} = 0)$ when the average magnetic field is equal to zero (i.e., a "demodulated" field)
Signals arising from an MRI scanner will be "demodulated". A consequence of this is that the average magnetic field within a measured field map is set to zero (here we call this a demodulated field) and any deviation from zero is due to susceptibility differences.
In order to simulate this scenario, we can assume that
These final equations are the ones used in the compute_fieldmap procedure, which calculates the magnetic field offset produced by a susceptibility distribution subject to a uniform external magnetic field
- Clone the repository
git clone https://github.com/shimming-toolbox/susceptibility-to-fieldmap-fft.git
cd susceptibility-to-fieldmap-fft
- Create a virtual environnement
conda create --name <name of your environement> python=3.9
conda activate <name of your environment>
- Install the package
pip install .
You will need to conda activate <name of your environment>
each time you want to use the package.
Once the package is installed, the commands can be run directly from the terminal. Here is the description of the two commands available.
The compute_fieldmap
command allows computation of a
Inputs
- input_file : path to the susceptibility distribution (NIfTI file)
- output_file : path for the fieldmap (NIfTI file)
Output The calculated fieldmap at the specified path.
Example:
compute_fieldmap -i "inpath/susceptibility_distribution.nii.gz" -o "outpath/fieldmap.nii.gz"
The analytical_cases
command allows for comparaison between simulated and analytical results for a spherical and cylindrical phantom.
Inputs
- -t, geometry type : 'spherical' or 'cylindrical'
- -b, buffer (optional, default=2): Buffer value for zero-padding around the phantom
Outputs Plots to visualize the results
Example:
analytical_cases -t "spherical"
The figures generated would be
J.P. MARQUES, R. BOWTELL Concepts in Magnetic Resonance Part B (Magnetic Resonance Engineering), Vol. 25B(1) 65-78 (2005)
BROWN, W.B., CHENG, Y-C.N., HAACKE, E.M., THOMPSON, M.R. and VENKATESAN, R., Magnetic resonance imaging : physical principles and sequence design, chapter 25 Magnetic Properties of Tissues : Theory and Measurement. John Wiley & Sons, 2014.