snake.core.engine.utils#

Utilities for the MRD format.

Module Contents#

Functions#

get_phantom_state

Get phantom state after applying all 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_phantom_state(phantom: snake.core.phantom.Phantom, dyn_datas: list[snake.core.phantom.DynamicData], i: int, sim_conf: snake.core.simulation.SimConfig, aggregate: bool = True) [numpy.typing.NDArray, numpy.typing.NDArray][source]#

Get phantom state after applying all 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.