# reconstruction of MRI signal

I have written a small simulator where I am trying to simulate the MRI signal generation process. I have a SINC RF Pulse to excite the spins and a readout gradient and k-space sampling during the readout. The k-space is sampled at equidistant points in time and the signal is inverse fourier transformed to give the image.

The synthetic image phantom for which I am trying to generate the signal is completely homogeneous. So, I have spin objects which have identical T1 and T2 relaxation times and density.

So, when I do the reconstruction, I was expecting the same intensity at each of these sample points. Instead what I get is something as follows:

Now, I am not sure if this is because of an error I made or simply because of numerical issues or the fact that the SINC RF pulse is terminated. I also changed the RF pulse to simulate a perfect flip i.e. all spins end up along the Y-axes perfectly, but this effect is still seen.

I wonder if this is due to Gibbs artefacts? I have a feeling this has something to do with how the fourier transform works but I am not sure.

I increased the number of k-space samples and also increased the FOV to 0.5 meters and then I get the following plot:

Finally, I did a reconstruction with 128 sampling points and a FOV of 0.128 meters and I got the following image:

P.S: Do not worry about the y-values as I was plotting these with different spin density values.

[EDIT]

Here is some more detail on the simulation. The underlying imaging object constitutes a single k-space line for simplicity. All the spins have the same T1, T2 and spin density with values 0.833, 0.083 and 1 respectively.

The FOV of the underlying object os 0.128 m. The constitutes a k-space matrix of 128 elements, 1 mm apart.

The RF excitation was done for 2 ms and the centre frequency was set to 0 Hz and a bandwidth of 2000 Hz. The flip angle was 90 degrees.

Immediately after the RF pulse a rewinder gradient was applied to dephase the spins. This was done to ensure the echo happens in the centre of the k-space line. The rewinder gradient had the peak amplitude of -0.022 T/m. The duration of this was 0.000816 sec and the area under the gradient was about -1.3934e-05.

Immediately after the rewinder, the readout gradient was applied with a duration of 0.0014 seconds and the area under the gradient was 2.7868e-05. The area of this gradient was twice that of the rewinder gradient to allow for the echo to form in the middle.

During the readout gradient, the k-space was sampled at uniform intervals. The transverse magnetisation over all spins was summed together at each sampling time point to yield one complex k-space value.

This was inverse fourier transformed using the scipy python package as:

np.abs(fftpack.ifftshift(fftpack.ifftn(signal)))


So, it shows the absolute value of the signal.

Also, more specifically, there is no spoiling performed as only one k-space line is read and only one RF-excitation is performed.

The simulation is performed by solving the Bloch equations using a fourth order Runge-Kutta method with a step size of 10e-6 sec. I see the same behaviour when I decreased the step size.

So, once I perform the simulation, I detect an echo as follows:

and the reconstructed image is the plot here:

Note that because the object is only simulated in one-dimensional, the image is just a 1-D plot.

My issue is I was expecting a k-space line which was close to a spike in the middle since the object is completely uniform.

[EDIT 2]

I figured out that I had made a small mistake in the readout part (I was not sampling at the correct time). Fixing this makes the echo less zagged but it is still not perfect. The echo and the reconstruction is below:

• Hm, hard to say what is going on there. It could be a problem in the FFT or the data. Is this the absolute value or a real part? Also, be a bit more specific what you show in the diagrams (axis labels help alot. Is this a profile through the phantom? If so, is it in RO or PE direction?). How does the whole reconstructed image look? Please also provide the MR parameters (such as sequence type (spoiled GRE I assume. How was the spoiling implemented?), TR, TE, T1, T2, T2*, RF-SINC duration, flip angle, BWTP, FOV, slice thickness).
– M529
Jun 7, 2016 at 18:36
• @M529 Thanks for your reply. I have edited the question. Hopefully it is more clear.
– Luca
Jun 7, 2016 at 23:03
• Then I assume that the problem has to do with your FFT/number of sampling points, since also your echo looks quite jagged. Do you simulate 1 spin/mm? Try simulating more spins, e.g. 1000 spins/mm. Does this give you a smoother echo/recon?
– M529
Jun 8, 2016 at 8:08
• @M529 Thank you for the suggestion. I will give this a try and keep the thread updated. At the moment, I simulate one spin per voxel, yes. I guess I could just scale the magnetisation per spin by a 1000? Or should I really simulate the spins with positions varying by 1/1000 of millimetres?
– Luca
Jun 8, 2016 at 8:17
• You should definitely have 1000 spins. It is not the magnitude that concerns me, but the phase of the complex sum.
– M529
Jun 8, 2016 at 8:54