snake.core.engine.utils
#
Utilities for the MRD format.
Module Contents#
Functions#
Compute the GRE contrast at TE. |
|
Apply the contrast to the phantom and return volume. |
|
Get phantom state after applying temporal variation. |
|
Apply the FFT operator. |
|
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.