RARE_PyPulseq - josalggui/MaRGE GitHub Wiki
MRI Sequence Documentation: 3D Imaging with RARE
Overview
This sequence is designed to acquire 3D images using the Rapid Acquisition with Relaxation Enhancement (RARE) technique. The sequence involves multiple echo trains. The acquisition process includes noise measurement before each excitation to ensure optimal signal-to-noise ratio (SNR).

Sequence Description
The sequence generates 3D images by acquiring data in the k-space for all three spatial dimensions (x, y, z). The scan is repeated multiple times and averaged to improve image quality. The acquisition involves both a pre-excitation and inversion recovery pulse, with refocusing pulses interleaved in each repetition.
Input Parameters
RF Parameters
-
Larmor frequency offset (
freqOffset, kHz): Frequency offset applied to the RF carrier relative to the system Larmor frequency.- example:
0.0
- example:
-
Excitation flip angle (
rfExFA, º): Flip angle of the excitation RF pulse.- example:
90
- example:
-
Refocusing flip angle (
rfReFA, º): Flip angle of the refocusing RF pulses.- example:
180
- example:
-
Excitation RF duration (
rfExTime, µs): Duration of the excitation RF pulse.- example:
50.0
- example:
-
Refocusing RF duration (
rfReTime, µs): Duration of the refocusing RF pulses.- example:
100.0
- example:
Sequence Timing
-
Echo spacing (
echoSpacing, ms): Time between consecutive echoes in the echo train.- example:
10.0
- example:
-
Echo selection mode (
echoMode): Defines which echoes are acquired.- example:
All - options:
All,Odd,Even
- example:
-
Pre-excitation time (
preExTime, ms): Delay before the excitation pulse.- example:
0.0
- example:
-
Inversion time (
inversionTime, ms): Delay between inversion pulse and excitation pulse (0 disables inversion).- example:
0.0
- example:
-
Repetition time (
repetitionTime, ms): Time between consecutive sequence repetitions (TR).- example:
300.0
- example:
-
Echo train length (
etl): Number of echoes acquired per excitation.- example:
4
- example:
-
Acquisition time (
acqTime, ms): Duration of the readout window per echo.- example:
4.0
- example:
Imaging Parameters
-
Number of scans (
nScans): Number of repetitions used for signal averaging.- example:
1
- example:
-
Field of view (
fov, cm): Imaging field of view along readout, phase, and slice directions.- example:
[12.0, 12.0, 12.0]
- example:
-
Displacement field of view (
dfov, mm): Offset of the imaging volume relative to the gradient isocenter.- example:
[0.0, 0.0, 0.0]
- example:
-
Number of points (
nPoints): Number of samples in readout, phase, and slice directions.- example:
[40, 40, 10]
- example:
-
Axes orientation (
axesOrientation): Mapping of readout, phase, and slice axes.- example:
[2, 1, 0] - note:
0 = x,1 = y,2 = z
- example:
Gradient and Readout
-
Sweep mode (
sweepMode): Ordering of k-space traversal in phase encoding.- example:
1 - options:
0: −kmax → +kmax1: 0 → +kmax2: +kmax → 0
- example:
-
Readout gradient duration (
rdGradTime, ms): Duration of the readout gradient.- example:
5.0
- example:
-
Readout dephasing time (
rdDephTime, ms): Duration of the readout dephasing gradient.- example:
1.0
- example:
-
Phase gradient duration (
phGradTime, ms): Duration of the phase encoding gradient.- example:
1.0
- example:
-
Readout preemphasis (
rdPreemphasis): Scaling factor applied to the readout gradient.- example:
1.0
- example:
-
Readout direction (
rd_direction): Direction of the readout gradient polarity.- example:
1 - options:
1(positive),-1(negative)
- example:
Calibration and Noise
-
Dummy pulses (
dummyPulses): Number of dummy excitations applied before acquisition.- example:
1
- example:
-
Noise acquisitions (
nNoise): Number of noise-only acquisitions.- example:
1
- example:
-
Shimming (
shimming): Static shimming values applied to the system (*×1e4).- example:
[0.0, 0.0, 0.0]
- example:
Reconstruction and Processing
-
Partial Fourier fraction (
parFourierFraction): Fraction of k-space acquired along the slice direction.- example:
0.7
- example:
-
Echo time shift (
echo_shift, µs): Temporal shift between gradient echo and spin echo.- example:
0.0
- example:
-
Unlock image orientation (
unlock_orientation): Disable automatic image reorientation.- example:
0 - options:
0(standard orientation),1(raw orientation)
- example:
-
Full plot (
full_plot): Plot odd and even echoes separately.- example:
False
- example:
-
K-space filling method (
k_fill): Method used to complete missing k-space data.- example:
ZP - options:
ZP,POCS
- example:
-
Tyger reconstruction (
tyger_recon): Enable Tyger reconstruction.- example:
0
- example:
-
Tyger denoising (
tyger_denoising): Enable SNRAware denoising using Tyger.- example:
0
- example:
-
Reconstruction type (
recon_type): Reconstruction algorithm used.- example:
cp - options:
cp,artpk
- example:
-
B₀ fit file (
boFit_file): File used for B₀ inhomogeneity correction.- example:
boFit_default.txt
- example:
Sampling Control
-
Oversampling factor (
oversampling_factor): Oversampling applied during readout.- example:
6
- example:
-
Decimation factor (
decimation_factor): Decimation factor applied after acquisition.- example:
3
- example:
-
Additional readout points (
add_rd_points): Extra points added to the readout to avoid filter artifacts.- example:
10
- example:
Important Notes:
- nPoints must always be even numbers for consistency in the Fourier transform process.
- The echo train length (etl) should be chosen such that the number of phases divided by etl is an even number.
- An exception occurs when the etl equals the number of phases.
- A schematic of the sweep modes along the phase direction can be seen in the image above.
Output and Results
The final output consists of 3D images that represent the scanned object. These images are saved in standard formats like DICOM, which include detailed metadata such as slice thickness, field of view, and other scanning parameters. Additionally, intermediate data like k-space matrices and reconstruction logs may be stored for further analysis.
Visualization outputs are returned as a list of dictionaries output:
-
1D Acquisition (Signal & Spectrum):
result_1: Signal amplitude vs. time.result_2: Frequency spectrum magnitude.
-
3D Acquisition (Images):
result_1: Magnitude image in i-space (corrected orientation if unlocked).result_2: Logarithmic or linear k-space image for acquisition inspection.
Each result contains metadata for plotting: xLabel, yLabel, title, legend, and GUI position (row, col).
Raw Data
- seqName: Sequence name
- dfov: Displacement of the fov
- fov: Field of View [x,y,z] (cm)
- nScans: Number of scans
- freqOffset: Larmor frequency offset (kHz)
- rfExFA: Excitation flip angle (º)
- rfReFA: Refocusing flip angle (º)
- rfExTime: RF excitation time (us)
- rfReTime: RF refocusing time (us)
- echoSpacing: Echo spacing (ms)
- echoMode: Echoes used for k-space filling. Options:
'All','Odd','Even' - preExTime: Pre-excitation time (ms)
- inversionTime: Inversion time (ms)
- repetitionTime: Repetition time (ms)
- nPoints: Number of points, nPoints[rd, ph, sl]
- etl: Echo train length
- acqTime: Acquisition time (ms)
- axesOrientation: Axes[rd,ph,sl]
- axes_enable: Axes enable. Use 0 for directions with matrix size 1, use 1 otherwise
- sweepMode: Sweep mode, 0: sweep from -kmax to kmax. 1: sweep from 0 to kmax. 2: sweep from kmax to 0, val=1
- rdGradTime: Rd gradient time (ms)
- rdDephTime: Rd de-phasing time (ms)
- phGradTime: Ph gradient time (ms)
- rdPreemphasis: Rd pre-emphasis
- rfPhase: Phase of the
- dummyPulses: Number of dummy pulses.
- nNoise: Number of noise readouts acquired in the first batch.
- shimming: Shimming values used along the sequence to homogenize magnetic field, val=[0.0, 0.0, 0.0]
- parFourierFraction: Partial fourier fraction. Fraction of k planes acquired in slice direction
- echo_shift: Echo time shift (us), Shift the gradient echo time respect to the spin echo time
- unlock_orientation:
0or1that indicates how to display image. 0: Nativexyzdisplay; 1: radiological convention. - full_plot: Show the image withing the fov determined by the decimation and oversamplnig factors.
- k_fill: Parameter indicating how the missing k-space is filled.
- tyger_recon: Boolean parameter indicating if reconstruction is done through Tyger.
- tyger_denoising: Boolean parameter indicating if denoising is done through Tyger TEP.
- recon_type: Indicates the type of reconstruction run in Tyger
- boFit_file: Path indicating where the b0 map is located.
- rd_direction: Polarity of the gradient readout.
- oversampling_factor: Oversampling factor used during readout.
- decimation_factor: Decimation factor used during decimation.
- add_rd_points: Additional readout points in each acquisition windows.
- input_keys: keys indicating the input fileds.
- input_strings: list of input strings.
- rf_ex_amp: Amplitude of the excitation rf pulse in a.u. of red pitaya.
- rf_re_amp: Amplitude of the rf refocusing pulse in a.u. of red pitaya.
- resolution: Nominal pixel size along readout, phase and slice direction
- grad_rise_time: Gradient Rise Time (s)
- larmorFreq: Larmor frequency (MHz)
- partialAcquisition: While doing partial acquisition, this is the number of extra slices acquired next to half nSlices / 2
- rd_grad_amplitude: Amplitude of the readout gradient in T/m
- ph_grad_amplitude: Máximum applied gradient along phase direction in T/m
- sl_grad_amplitude: Máximum applied gradient along slice direction in T/m
- rd_deph_amplitude: Amplitude of the de-phasing gradient applied along readout direction in T/m
- sweepOrder: Array with the index representing the order of acquired phase lines.
- ph_gradients: List of applied phase gradient along the sequence in T/m
- sl_gradients: List of applied slice gradient along the sequence in T/m
- bw_MHz: Acquisition bandwidth (MHz)
- sampling_period_us: Sampling period (us)
- sampling_time_s: Sampling time (s)
- n_readouts: list containing the number of readout windows for each batch.
- n_batches: number of batches.
- data_over: oversampled data as acquired from the red pitaya according to the decimation factor.
- data_decimated: decimated data according to the decimation factor.
- data_noise: noise acquisitions.
- data_dummy: Datas acquired along one echo train after first dummy pulse.
- data_signal: data acquired withing the pulse sequence. without noise or dummy acquisitions with dimension
- data_full: numpy array with dimensions [nScans, nSlices * partialFourierFraction, nPhases, nReadouts]. It contains acquired data properly reorganized.
- kSpace3D: numpy array with the acquired k-space with dimensions [nSlices, nPhases, nReadouts]
- image3D: numpy array with the resulting image with dimensions [nSlices, nPhases, nReadouts]
- kMax_1/m: numpy array with the maximum k value for readout, phase and slice.
- sampled numpy array with four columns for [k_readout, k_phase, k_slices, data] (1/m, 1/m, 1/m, mV).
- sampledCartesian: numpy array with four columns resampled to cartesian grid.
- fileName: File name (.mat).