snake.core.engine.base
#
Engines are responsible for the acquisition of Kspace.
Module Contents#
Classes#
MetaClass for engines. |
|
Base acquisition engine. |
Data#
API#
- snake.core.engine.base.GenericPath = None#
- class snake.core.engine.base.MetaEngine[source]#
Bases:
snake._meta.MetaDCRegister
MetaClass for engines.
- class snake.core.engine.base.BaseAcquisitionEngine[source]#
Base acquisition engine.
Specific step can be overwritten in subclasses.
- Parameters:
- log: ClassVar[logging.Logger] = None#
- _get_chunk_list(data_loader: snake.mrd_utils.MRDLoader) collections.abc.Sequence[int] [source]#
- static _job_get_T2s_decay(dwell_time_ms: float, echo_idx: int, n_samples: int, phantom: snake.core.phantom.Phantom) numpy.typing.NDArray [source]#
- _acquire_ksp_job(filename: snake.core.engine.base.GenericPath, chunk: collections.abc.Sequence[int], tmp_dir: str, shared_phantom_props: tuple[str, snake.core.parallel.ArrayProps, snake.core.parallel.ArrayProps, snake.core.parallel.ArrayProps, snake.core.parallel.ArrayProps | None] | None = None, **kwargs: collections.abc.Mapping[str, Any]) str [source]#
Entry point for worker.
This handles the io part (Read dataset, write partial k-space), and dispatch to specialized functions for getting the k-space.
- __call__(filename: snake.core.engine.base.GenericPath, sampler: snake.core.sampling.BaseSampler, phantom: snake.core.phantom.Phantom, sim_conf: snake.core.simulation.SimConfig, handlers: list[snake.core.handlers.AbstractHandler] | snake.core.handlers.HandlerList | None = None, coil_cov: numpy.typing.NDArray | None = None, worker_chunk_size: int = 0, n_workers: int = 0, **kwargs: Any)[source]#
Perform the acquisition and fill the dataset.
- Parameters:
filename (GenericPath) β The path to the MRD file.
sampler (BaseSampler) β The sampler to use.
phantom (Phantom) β The phantom to use.
sim_conf (SimConfig) β The simulation configuration.
handlers (list[AbstractHandler] | HandlerList | None, optional) β The handlers to use, by default None.
coil_cov (NDArray | None, optional) β The coil covariance matrix, by default None.
worker_chunk_size (int, optional) β The size of the chunk to process for each worker, by default 0 (auto). Each worker w
n_workers (int, optional) β The number of workers to use, by default 0 (auto). Half of CPU count will be used (This usually corresponds to the number of physical cores on the machine).
resample_early (bool, optional) β Whether to resample the phantom early, by default False
kwargs (Any) β Additional keyword arguments, passed down to internal implementation.
Notes
This function is the main entry point for the acquisition engine. It will create the base dataset, and then dispatch the work to the workers.
Specific modeling steps are implemented in subclassesβ methods _job_model_T2s and _job_model_simple.