This Spectral Spatial RF Pulse Design toolbox provides numerous advanced tools for designing these powerful types of RF pulses for MRI applications.
NOTEBOOK is not working - requires migration of some toolbox functions to Octave that is not complete!
see spectral_spatial/examples folder for MATLAB based demos
This notebook includes examples of
To run this code you will need to clone the hyperpolarized MRI toolbox repository from github and add it to your matlab path. This can be done with the following command: 'git clone https://github.com/LarsonLab/hyperpolarized-mri-toolbox/'
Then run the 'startup' function to setup the appropriate paths
% setup hyperpolarized-mri-toolbox
cd ../
startup
loading optim warning: isdir is obsolete; use isfolder or dir_in_loadpath instead loading image loading io loading statistics loading signal
% options with their default values
ss_opt([])
ans = { [1,1] = Nucleus [2,1] = Max Grad [3,1] = Max Slew [4,1] = Sample Time [5,1] = Max B1 [6,1] = Max Duration [7,1] = Num Lobe Iters [8,1] = Equal Lobes [9,1] = Verse Fraction [10,1] = Num Fs Test [11,1] = Spect Correct [12,1] = Spect Correct Reg [13,1] = SLR [14,1] = Min Order [15,1] = B1 Verse [16,1] = Slew Penalty [1,2] = Hydrogen [2,2] = 5 [3,2] = 20 [4,2] = 0.0000040000 [5,2] = 0.20000 [6,2] = 0.020000 [7,2] = 10 [8,2] = 0 [9,2] = 0.80000 [10,2] = 100 [11,2] = 0 [12,2] = 0 [13,2] = 0 [14,2] = 1 [15,2] = 0 [16,2] = 0 }
First, here's an example of a water-only spectral-spatial RF pulse that will not excite fat. This is a great way to eliminate artifacts from fat, particularly when using EPI for diffusion and fMRI.
% SPECTRAL PULSE PARAMETERS
% Water/fat chemical shifts
%
df = 0.5e-6;% Conservative shim requirement
water = 4.7e-6;
fat2 = 1.3e-6;
fat1 = 0.9e-6;
% Convert to frequency
%
B0 = 1.5e4; % G
gamma_h = 4258; % Hz/G
fspec = B0 * ([(fat1-df) (fat2+df) (water-df) (water+df)]-water) * gamma_h; % Hz
water_ctr = (fspec(3) + fspec(4))/2;
fat_ctr = (fspec(1) + fspec(2))/2;
% SPATIAL PULSE PARAMETERS
z_thk = 1; % thickness (cm)
z_tb = 4; % time-bandwidth, proportional to profile sharpness
z_ftype='ls'; % least-squares filter design, Use this to get rid of "Conolly Wings"
z_d1 = 0.01; z_d2 = 0.01; % slice profile pass and stop-band ripples, respectively
ang = pi/6; % flip angle
% Set up spectral/spatial specifications
a = [0 1];
d = [0.02 0.005];
ptype = 'ex';
f_ctr = [];
s_ftype = 'min';% min-phase spectral
ss_type = 'Flyback Whole'; % Flyback, symmetric frequency
dbg = 0;% debug level
% 0 -none, 1 - little, 2 -lots, ...
default_opt = {'Max Duration', 16e-3, ...
'Num Lobe Iters', 5, ...
'Min Order', 1, ...
'Spect Correct', 0, ...
'SLR', 0, ...
'Verse Fraction', 0.9};
opt = ss_opt(default_opt);
% Not working in Octave
%[g,rf,fs,z,f,mxy] = ss_design(z_thk, z_tb, [z_d1 z_d2], fspec, a*ang, d, ptype, ...
% z_ftype, s_ftype, ss_type, f_ctr, dbg);
fprintf(1, 'The frequency spec includes a passband at [%3f,%3f]\n',fspec(3),fspec(4));
fprintf(1, 'and stopbands at [%3f,%3f]\n',fspec(1),fspec(2));
Iterating on spectral sampling frequency to reduce B1 Error caught in cfirpm: 'cfirpm' undefined near line 175 column 18 Failed to get filter Band: 1/1 Iter: 1/5 Fs: 1131.2 *** No Soln *** Error caught in cfirpm: 'cfirpm' undefined near line 175 column 18 Failed to get filter Band: 1/1 Iter: 2/5 Fs: 915.8 *** No Soln *** Error caught in cfirpm: 'cfirpm' undefined near line 175 column 18 Failed to get filter Band: 1/1 Iter: 3/5 Fs: 714.3 *** No Soln *** Error caught in cfirpm: 'cfirpm' undefined near line 175 column 18 Failed to get filter Band: 1/1 Iter: 4/5 Fs: 513.3 *** No Soln *** Error caught in cfirpm: 'cfirpm' undefined near line 175 column 18 Failed to get filter Band: 1/1 Iter: 5/5 Fs: 310.9 *** No Soln *** No solution found! Trying to increase band ripples to determine limiting frequency specifications... Error caught in cfirpm: 'cfirpm' undefined near line 175 column 18 Failed to get filter Error caught in cfirpm: 'cfirpm' undefined near line 175 column 18 Failed to get filter Error caught in cfirpm: 'cfirpm' undefined near line 175 column 18 Failed to get filter Error caught in cfirpm: 'cfirpm' undefined near line 175 column 18 Failed to get filter Error caught in cfirpm: 'cfirpm' undefined near line 175 column 18 Failed to get filter Error caught in cfirpm: 'cfirpm' undefined near line 175 column 18 Failed to get filter Error caught in cfirpm: 'cfirpm' undefined near line 175 column 18 Failed to get filter Error caught in cfirpm: 'cfirpm' undefined near line 175 column 18 Failed to get filter Error caught in cfirpm: 'cfirpm' undefined near line 175 column 18 Failed to get filter Error caught in cfirpm: 'cfirpm' undefined near line 175 column 18 Failed to get filter Error caught in cfirpm: 'cfirpm' undefined near line 175 column 18 Failed to get filter Error caught in cfirpm: 'cfirpm' undefined near line 175 column 18 Failed to get filter Error caught in cfirpm: 'cfirpm' undefined near line 175 column 18 Failed to get filter Error caught in cfirpm: 'cfirpm' undefined near line 175 column 18 Failed to get filter Error caught in cfirpm: 'cfirpm' undefined near line 175 column 18 Failed to get filter Error caught in cfirpm: 'cfirpm' undefined near line 175 column 18 Failed to get filter error: No solution found! Try reducing bandwidths, increasing ripple, increasing max duration, increasing slice thickness... error: called from ss_design at line 475 column 13 The frequency spec includes a passband at [-31.935000,31.935000] and stopbands at [-274.641000,-185.223000]