RF Pulse Simulator
rf_tools has an RF pulse simulator that computes the rotations produced by your rf pulses.
It does this using spinors, and the Cayley-Klein parameters $\alpha$ and $\beta$. These two complex numbers completely define a rotation.
Once the rotation has been computed, any RF profile can be computed.
First, we need to open the RF toolbox code directory and load the Octave signal toolbox
%use octave
try
cd rf_tools_octave
catch
try
cd ../rf_tools_octave
catch
try
cd ../rf_tools_octave
catch
cd ../../rf_tools_octave
end
end
end
pkg load signal
Now let’s create an RF pulse
%use octave
rf = msinc(256,2);
This is just a Hamming windowed sinc.
Normalize to $\pi/2$, and plot it. cplot() takes a complex signal and plots both the real and imaginary parts.
%use octave
rf = rf*(pi/2)/sum(rf);
re_rf = real(rf);
im_rf = imag(rf);
(View plot code)
Next we need a vector of spatial locations. By default the simulator assumes that the gradient area integrates to 2 pi over the pulse, so the spatial locations are multiples of 2 pi.
%use octave
x = [-64:64]/4;
Then we simulate the result with abr(rf,x). This stands for “alpha-beta rotator”,
%use octave
[a b] = abr(rf,x);
re_a = real(a);
im_a = imag(a);
re_b = real(b);
im_b = imag(b);
The $\alpha$ slice profile mostly characterizes the phase of the profile.
(View plot code)
The $\beta$ profile looks like the slice profile we expect, and has an amplitude of $\sin(\phi/2)$ if $\phi$ is the flip angle. This is a $\pi/2$ pulse so the amplitude is $\sin(\pi/4) = \sqrt{2}/{2}$, or about 0.707. It is negative because we are using right hand rotations, while protons rotate in the negative sense,
(View plot code)
This is the $\beta$ slice profile. $\alpha$ and $\beta$ determine the rotation produced by the RF pulse for any initial magnetization. We can then compute any slice profile we’d like.
The excitation profile is $M_{xy} = 2 \alpha^*\beta$, and this is computed by ab2ex(a,b),
%use octave
mxy_ex = ab2ex(a,b);
mxy_ex_abs = abs(mxy_ex);
(View plot code)
The inversion profile is $M_z = 1-2\beta\beta^*$, and is computed by ab2inv(a,b),
%use octave
mz_inv = ab2inv(a,b);
re_mz_inv = real(mz_inv);
(View plot code)
The spin echo profile is $M_{xy} = -i \beta^2$, and is computed by ab2se(a,b),
%use octave
mxy_se = ab2se(a,b);
re_mxy_se = real(mxy_se);
(View plot code)
Not too surprising, a $\pi/2$ pulse is not a great spin echo pulse.
Now we just need better RF pulses to simulate! That is next.