mri.reconstructors.utils.extract_sensitivity_maps#

This module contains tools to extract sensitivity maps from undersampled MR acquisition with high density in the k space center.

extract_k_space_center_and_locations(data_values, samples_locations, thr=None, img_shape=None, window_fun=None, is_fft=False, density_comp=None)[source]#

This class extract the k space center for a given threshold and extracts the corresponding sampling locations

Parameters
  • data_values (numpy.ndarray) – The value of the samples

  • samples_locations (numpy.ndarray) – The samples location in the k-sapec domain (between [-0.5, 0.5[)

  • thr (tuple or float) – The threshold used to extract the k_space center

  • img_shape (tuple) – The image shape to estimate the cartesian density

  • is_fft (bool default False) – Checks if the incoming data is from FFT, in which case, masking can be done more directly

  • density_comp (numpy.ndarray default None) – The density compensation for kspace data in case it exists and we use density compensated adjoint for Smap estimation

  • window_fun ("Hann", "Hanning", "Hamming", or a callable, default None.) – The window function to apply to the selected data. It is computed with the center locations selected. Only works with circular mask. If window_fun is a callable, it takes as input the array (n_samples x n_dims) of sample positions and returns an array of n_samples weights to be applied to the selected k-space values, before the smaps estimation.

Returns

  • The extracted center of the k-space, i.e. both the kspace locations and

  • kspace values. If the density compensators are passed, the corresponding

  • compensators for the center of k-space data will also be returned. The

  • return stypes for density compensation and kspace data is same as input

Notes

The Hann (or Hanning) and Hamming windows of width \(2\theta\) are defined as: .. math:

w(x,y) = a_0 - (1-a_0) * cos(pi * sqrt{x^2+y^2}/theta), sqrt{x^2+y^2} le theta

In the case of Hann window \(a_0=0.5\). For Hamming window we consider the optimal value in the equiripple sense: \(a_0=0.53836\). .. Wikipedia:: https://en.wikipedia.org/wiki/Window_function#Hann_and_Hamming_windows

get_Smaps(k_space, img_shape, samples, thresh, min_samples, max_samples, mode='NFFT', method='linear', window_fun=None, density_comp=None, n_cpu=1, fourier_op_kwargs={})[source]#

Get Smaps for from pMRI sample data.

Estimate the sensitivity maps information from parallel mri acquisition and for variable density sampling scheme where the k-space center had been heavily sampled.

Reference : Self-Calibrating Nonlinear Reconstruction Algorithms for Variable Density Sampling and Parallel Reception MRI https://ieeexplore.ieee.org/abstract/document/8448776

Parameters
  • k_space (numpy.ndarray) – The acquired kspace of shape (M,L), where M is the number of samples acquired and L is the number of coils used

  • img_shape (tuple) – The final output shape of Sensitivity Maps.

  • samples (numpy.ndarray) – The sample locations where the above k_space data was acquired

  • thresh (tuple) – The value of threshold in kspace for thresholding k-space center

  • min_samples (tuple) – The minimum values in k-space where gridding must be done

  • max_samples (tuple) – The maximum values in k-space where gridding must be done

  • mode (string 'FFT' | 'NFFT' | 'gridding' , default='NFFT') – Defines the mode in which we would want to interpolate, NOTE: FFT should be considered only if the input has been sampled on the grid

  • method (string 'linear' | 'cubic' | 'nearest', default='linear') – For gridding mode, it defines the way interpolation must be done

  • window_fun ("Hann", "Hanning", "Hamming", or a callable, default None.) – The window function to apply to the selected data. It is computed with the center locations selected. Only works with circular mask. If window_fun is a callable, it takes as input the n_samples x n_dims of samples position and would return an array of n_samples weight to be applied to the selected k-space values, before the smaps estimation.

  • density_comp (numpy.ndarray default None) – The density compensation for kspace data in case it exists and we use density compensated adjoint for Smap estimation

  • n_cpu (int default=1) – Number of parallel jobs in case of parallel MRI

  • fourier_op_kwargs (dict, default {}) – The keyword arguments given to fourier_op initialization if mode == ‘NFFT’. If None, we choose implementation of fourier op to ‘gpuNUFFT’ if library is installed.

Returns

  • Smaps (numpy.ndarray) – the estimated sensitivity maps of shape (img_shape, L) with L the number of channels

  • SOS (numpy.ndarray) – The sum of Square used to extract the sensitivity maps

Notes

The Hann (or Hanning) and Hamming window of width \(2\theta\) are defined as: .. math:

w(x,y) = a_0 - (1-a_0) * cos(pi * sqrt{x^2+y^2}/theta), sqrt{x^2+y^2} le theta

In the case of Hann window \(a_0=0.5\). For Hamming window we consider the optimal value in the equiripple sens: \(a_0=0.53836\). .. Wikipedia:: https://en.wikipedia.org/wiki/Window_function#Hann_and_Hamming_windows