gs_recon

Geometric solution to the elliptical signal model.

mr_utils.recon.ssfp.gs_recon.complex_sum(I1, I2, I3, I4)[source]

Complex sum image combination method.

Parameters:
  • I0 (array_like) – First of the first phase-cycle pair (0 degrees).
  • I1 (array_like) – First of the second phase-cycle pair (90 degrees).
  • I2 (array_like) – Second of the first phase-cycle pair (180 degrees).
  • I3 (array_like) – Second of the second phase-cycle pair (270 degrees).
Returns:

CS – Complex sum image.

Return type:

array_like

mr_utils.recon.ssfp.gs_recon.compute_Iw(I0, I1, Id, patch_size=None, mode='constant', isophase=3.141592653589793)[source]

Computes weighted sum of image pair (I0,I1).

Parameters:
  • I0 (array_like) – 1st of pair of diagonal images (relative phase cycle of 0).
  • I1 (array_like) – 2nd of pair of diagonal images (relative phase cycle of 180 deg).
  • Id (array_like) – result of regularized direct solution.
  • patch_size (tuple, optional) – size of patches in pixels (x, y). Defaults to (5, 5).
  • mode ({'contant', 'edge'}, optional) – mode of numpy.pad. Probably choose ‘constant’ or ‘edge’.
  • isophase (float) – Only neighbours with isophase max phase difference contribute.
Returns:

Iw – The weighted sum of image pair (I0,I1), equation [14]

Return type:

array_like

Notes

Image pair (I0,I1) are phase cycled bSSFP images that are different by 180 degrees. Id is the image given by the direct method (Equation [13]) after regularization by the complex sum. This function solves for the weights by regional differential energy minimization. The ‘regional’ part means that the image is split into patches of size patch_size with edge boundary conditions (pads with the edge values given by mode option). The weighted sum of the image pair is returned.

The isophase does not appear in the paper, but appears in Hoff’s MATLAB code. It appears that we only want to consider pixels in the patch that have similar tissue properties - in other words, have similar phase. The default isophase is pi as in Hoff’s implementation.

This function implements Equations [14,18], or steps 4–5 from Fig. 2 in [1].

mr_utils.recon.ssfp.gs_recon.get_max_magnitudes(I1, I2, I3, I4)[source]

Find max magnitudes for each pixel over all four input images.

Parameters:
  • I0 (array_like) – First of the first phase-cycle pair (0 degrees).
  • I1 (array_like) – First of the second phase-cycle pair (90 degrees).
  • I2 (array_like) – Second of the first phase-cycle pair (180 degrees).
  • I3 (array_like) – Second of the second phase-cycle pair (270 degrees).
Returns:

I_mag – Maximum magnitude image at each pixel.

Return type:

array_like

mr_utils.recon.ssfp.gs_recon.get_max_magnitudes_for_loop(I1, I2, I3, I4)[source]

Find max magnitudes for each pixel over all four input images.

Parameters:
  • I0 (array_like) – First of the first phase-cycle pair (0 degrees).
  • I1 (array_like) – First of the second phase-cycle pair (90 degrees).
  • I2 (array_like) – Second of the first phase-cycle pair (180 degrees).
  • I3 (array_like) – Second of the second phase-cycle pair (270 degrees).
Returns:

I_mag – Maximum magnitude image at each pixel.

Return type:

array_like

Notes

This one loops over each pixel as verification for get_max_magnitudes().

mr_utils.recon.ssfp.gs_recon.gs_recon(Is, pc_axis=0, isophase=3.141592653589793, second_pass=True, patch_size=None)[source]

Full 2D Geometric Solution following Xiang, Hoff’s 2014 paper.

Parameters:
  • Is (array_like) – 4 phase-cycled images: [I0, I1, I2, I3]. (I0, I2) and (I1, I3) are phase-cycle pairs.
  • pc_axis (int, optional) – Phase-cycle dimension, default is the first dimension.
  • isophase (float) – Only neighbours with isophase max phase difference contribute.
  • second_pass (bool, optional) – Compute the second pass solution, increasing SNR by sqrt(2).
  • patch_size (tuple, optional) – Size of patches in pixels (x, y).
Returns:

  • I (array_like) – Second pass GS solution to elliptical signal model.
  • Id (array_like, optional) – If second_pass=False, GS solution to the elliptical signal model (without linear weighted solution).

Notes

Is is an array of 4 2D images: I0, I1, I2, and I3. I0 and I2 make up the first phase-cycle pair, that is they are 180 degrees phase-cycled relative to each other. I1 and I3 are also phase-cycle pairs and must be different phase-cycles than either I0 or I2. Relative phase-cycles are assumed as follows:

  • I0: 0 deg
  • I1: 90 deg
  • I2: 180 deg
  • I3: 270 deg

Implements algorithm shown in Fig 2 of [1].

References

[1](1, 2) Xiang, Qing‐San, and Michael N. Hoff. “Banding artifact removal for bSSFP imaging with an elliptical signal model.” Magnetic resonance in medicine 71.3 (2014): 927-933.
mr_utils.recon.ssfp.gs_recon.gs_recon3d(I1, I2, I3, I4, slice_axis=-1, isophase=3.141592653589793)[source]

Full 3D Geometric Solution following Xiang, Hoff’s 2014 paper.

Parameters:
  • I0 (array_like) – First of the first phase-cycle pair (0 degrees).
  • I1 (array_like) – First of the second phase-cycle pair (90 degrees).
  • I2 (array_like) – Second of the first phase-cycle pair (180 degrees).
  • I3 (array_like) – Second of the second phase-cycle pair (270 degrees).
  • slice_axis (int, optional) – Slice dimension, default is the last dimension.
  • isophase (float) – Only neighbours with isophase max phase difference contribute.
Returns:

recon – GS solution to elliptical signal model.

Return type:

array_like

Raises:

AssertionError – When phase-cycle images have different numbers of slices.

Notes

For more info, see mr_utils.recon.ssfp.gs_recon.

mr_utils.recon.ssfp.gs_recon.gs_recon_for_loop(I1, I2, I3, I4)[source]

GS recon implemented using a straightfoward loop.

Parameters:
  • I0 (array_like) – First of the first phase-cycle pair (0 degrees).
  • I1 (array_like) – First of the second phase-cycle pair (90 degrees).
  • I2 (array_like) – Second of the first phase-cycle pair (180 degrees).
  • I3 (array_like) – Second of the second phase-cycle pair (270 degrees).
Returns:

I – GS solution to elliptical signal model.

Return type:

array_like

Notes

For verification, probably don’t use this, it’s slow.

mr_utils.recon.ssfp.gs_recon.mask_isophase(numerator_patches, patch_size, isophase)[source]

Generate mask that chooses patch pixels that satisfy isophase.

Parameters:
  • numerator_patches (array_like) – Numerator patches from second pass solution.
  • patch_size (tuple) – size of patches in pixels (x,y).
  • isophase (float) – Only neighbours with isophase max phase difference contribute.
Returns:

mask – same size as numerator_patches, to be applied to numerator_patches and den_patches before summation.

Return type:

array_like