snake.core.simulation#

SImulation base objects.

Module Contents#

Classes#

GreConfig

Gradient Recall Echo Sequence parameters.

HardwareConfig

Scanner Hardware parameters.

FOVConfig

Field of View configuration.

SimConfig

All base configuration of a simulation.

Data#

API#

snake.core.simulation.log = 'getLogger(...)'[source]#
class snake.core.simulation.GreConfig[source]#

Gradient Recall Echo Sequence parameters.

TR: float = None#

TE: Echo Time in ms. This is the time between the RF pulse and the echo.

TE: float = None#

FA: Flip Angle in degrees. This is the angle of the RF pulse to the magnetization.

FA: float = None#
_repr_html_ = None#
__post_init__() None[source]#

Validate the parameters. And create a Effective TR.

class snake.core.simulation.HardwareConfig[source]#

Scanner Hardware parameters.

gmax: float = 40#
smax: float = 200#
n_coils: int = 8#
dwell_time_ms: float = 0.001#
raster_time_ms: float = 0.005#
field: float = 3.0#
_repr_html_ = None#
snake.core.simulation.default_hardware = 'HardwareConfig(...)'#
snake.core.simulation.default_gre = 'GreConfig(...)'#
class snake.core.simulation.FOVConfig[source]#

Field of View configuration.

This class is used to define the FOV of the simulation. It uses the RAS convention and mm units.

Default values are from the BrainWeb dataset.

size: snake._meta.ThreeFloats = (181, 217, 181)#

Size of the FOV in millimeter.

offset: snake._meta.ThreeFloats = ()#

distance (in mm) of the bottom left left voxel to magnet isocenter.

angles: snake._meta.ThreeFloats = (0, 0, 0)#

Euler Rotation Angles of the FOV in degrees

res_mm: snake._meta.ThreeFloats = (1, 1, 1)#

Resolution of the FOV in mm.

_repr_html_ = None#
__post_init__() None[source]#

Validate the parameters.

classmethod from_affine(affine: numpy.typing.NDArray, size: snake._meta.ThreeFloats) snake.core.simulation.FOVConfig[source]#

Create a FOVConfig from an affine matrix.

property affine: numpy.typing.NDArray[numpy.float32]#

Generate an affine matrix from the FOV configuration.

property shape: snake._meta.ThreeInts#

Shape of the associated array in voxels units.

class snake.core.simulation.SimConfig[source]#

All base configuration of a simulation.

max_sim_time: float = 300#
seq: snake.core.simulation.GreConfig = 'field(...)'#
hardware: snake.core.simulation.HardwareConfig = 'field(...)'#
fov: snake.core.simulation.FOVConfig = 'field(...)'#
rng_seed: int = 19290506#
_repr_html_ = None#
__post_init__() None[source]#
property max_n_shots: int#

Maximum number of frames.

property res_mm: snake._meta.ThreeFloats#

Voxel resolution in mm.

property sim_tr_ms: float#

Simulation resolution in ms.

property shape: snake._meta.ThreeInts#

Shape of the simulation.

property fov_mm: snake._meta.ThreeFloats#

Size of the FOV in mm.