snake.core.sampling.samplers
#
Samplers generate kspace trajectories.
Module Contents#
Classes#
Base class for non-cartesian acquisition samplers. |
|
Load a trajectory from a file. |
|
Spiral 2D Acquisition Handler to generate k-space data. |
|
Spiral 2D Acquisition Handler to generate k-space data. |
|
Sampling pattern for EPI-3D. |
|
SAmpler for EVI acquisition. |
Functions#
Compute the directional cosine of the vector from beg to end point. |
API#
- class snake.core.sampling.samplers.NonCartesianAcquisitionSampler[source]#
Bases:
snake.core.sampling.base.BaseSampler
Base class for non-cartesian acquisition samplers.
- Parameters:
- __engine__ = 'NUFFT'#
- add_all_acq_mrd(dataset: ismrmrd.Dataset, sim_conf: snake.core.simulation.SimConfig) ismrmrd.Dataset [source]#
Generate all mrd_acquisitions.
- class snake.core.sampling.samplers.LoadTrajectorySampler[source]#
Bases:
snake.core.sampling.samplers.NonCartesianAcquisitionSampler
Load a trajectory from a file.
- Parameters:
- __sampler_name__ = 'load-trajectory'#
- __engine__ = 'NUFFT'#
- _single_frame(sim_conf: snake.core.simulation.SimConfig) numpy.typing.NDArray [source]#
Load the trajectory.
- class snake.core.sampling.samplers.StackOfSpiralSampler[source]#
Bases:
snake.core.sampling.samplers.NonCartesianAcquisitionSampler
Spiral 2D Acquisition Handler to generate k-space data.
- Parameters:
acsz (float | int) – Number/ proportion of lines to be acquired in the center of k-space.
accelz (int) – Acceleration factor for the rest of the lines.
directionz (Literal["center-out", "random"]) – Direction of the acquisition. Either “center-out” or “random”.
pdfz (Literal["gaussian", "uniform"]) – Probability density function of the sampling. Either “gaussian” or “uniform”.
obs_ms (int) – Time spent to acquire a single shot
nb_revolutions (int) – Number of revolutions of the spiral.
in_out (bool) – If true, the spiral is acquired with a double join pattern from/to the periphery
**kwargs – Extra arguments (smaps, n_jobs, backend etc…)
- __sampler_name__ = 'stack-of-spiral'#
- orderz: str | snake.core.sampling.factories.VDSorder = None#
- pdfz: str | snake.core.sampling.factories.VDSpdf = None#
- rotate_angle: snake.core.sampling.factories.AngleRotation = None#
- _single_frame(sim_conf: snake.core.simulation.SimConfig) numpy.typing.NDArray [source]#
Generate the sampling pattern.
- class snake.core.sampling.samplers.RotatedStackOfSpiralSampler[source]#
Bases:
snake.core.sampling.samplers.StackOfSpiralSampler
Spiral 2D Acquisition Handler to generate k-space data.
- Parameters:
rotate_frame_angle (AngleRotation | int) – Angle of rotation of the frame.
frame_index (int) – Index of the frame.
**kwargs – Extra arguments (smaps, n_jobs, backend etc…)
- __sampler_name__ = 'rotated-stack-of-spiral'#
- rotate_frame_angle: snake.core.sampling.factories.AngleRotation | int = 0#
- fix_angle_rotation(frame: collections.abc.Generator[numpy.ndarray, None, None], angle: snake.core.sampling.factories.AngleRotation | float = 0) collections.abc.Generator[numpy.ndarray, None, None] [source]#
Rotate the trajectory by a given angle.
- get_next_frame(sim_conf: snake.core.simulation.SimConfig) numpy.typing.NDArray [source]#
Generate the next rotated frame.
- class snake.core.sampling.samplers.EPI3dAcquisitionSampler[source]#
Bases:
snake.core.sampling.base.BaseSampler
Sampling pattern for EPI-3D.
- __sampler_name__ = 'epi-3d'#
- __engine__ = 'EPI'#
- in_out = True#
- orderz: snake.core.sampling.factories.VDSorder = None#
- pdfz: snake.core.sampling.factories.VDSpdf = None#
- _single_frame(sim_conf: snake.core.simulation.SimConfig) numpy.typing.NDArray [source]#
Generate the sampling pattern.
- add_all_acq_mrd(dataset: ismrmrd.Dataset, sim_conf: snake.core.simulation.SimConfig) ismrmrd.Dataset [source]#
Create the acquisitions associated with this sampler.
- class snake.core.sampling.samplers.EVI3dAcquisitionSampler[source]#
Bases:
snake.core.sampling.base.BaseSampler
SAmpler for EVI acquisition.
- __sampler_name__ = 'evi'#
- __engine__ = 'EVI'#
- in_out = True#
- _single_frame(sim_conf: snake.core.simulation.SimConfig) numpy.typing.NDArray [source]#
Generate the sampling pattern.
- add_all_acq_mrd(dataset: ismrmrd.Dataset, sim_conf: snake.core.simulation.SimConfig) ismrmrd.Dataset [source]#
Create the acquisitions associated with this sampler.