snake.core.engine.utils#

Utilities for the MRD format.

Module Contents#

Functions#

get_contrast_gre

Compute the GRE contrast at TE.

get_ideal_phantom

Apply the contrast to the phantom and return volume.

get_phantom_state

Get phantom state after applying temporal variation.

fft

Apply the FFT operator.

get_noise

Generate noise for a given chunk of k-space data.

API#

snake.core.engine.utils.get_contrast_gre(phantom: snake.core.phantom.Phantom, FA: float, TE: float, TR: float) numpy.typing.NDArray[source]#

Compute the GRE contrast at TE.

snake.core.engine.utils.get_ideal_phantom(phantom: snake.core.phantom.Phantom, sim_conf: snake.core.simulation.SimConfig) numpy.typing.NDArray[source]#

Apply the contrast to the phantom and return volume.

snake.core.engine.utils.get_phantom_state(phantom: snake.core.phantom.Phantom, dyn_datas: list[snake.core.phantom.DynamicData], i: int, sim_conf: snake.core.simulation.SimConfig) numpy.typing.NDArray[source]#

Get phantom state after applying temporal variation.

snake.core.engine.utils.fft(image: numpy.typing.NDArray, axis: tuple[int, ...] | int = -1) numpy.typing.NDArray[source]#

Apply the FFT operator.

Parameters:
  • image (array) – Image in space.

  • axis (int) – Axis to apply the FFT.

Returns:

kspace_data – kspace data.

Return type:

array

snake.core.engine.utils.get_noise(chunk_data: numpy.typing.NDArray, cov: numpy.typing.NDArray, rng: numpy.random.Generator) numpy.typing.NDArray[source]#

Generate noise for a given chunk of k-space data.