snake.mrd_utils.writer#

Export data to mrd format.

Module Contents#

Functions#

get_mrd_header

Create a MRD Header for snake-fmri data.

add_dynamic_mrd

Add the dynamic data to the dataset.

add_coil_cov_mrd

Add the Smaps to the dataset.

make_base_mrd

Create a base .mrd file from the simulation configurations.

Data#

log

API#

snake.mrd_utils.writer.log = 'getLogger(...)'[source]#
snake.mrd_utils.writer.get_mrd_header(sim_conf: snake.core.simulation.SimConfig, engine: str, model: str, slice_2d: bool) ismrmrd.xsd.ismrmrdHeader[source]#

Create a MRD Header for snake-fmri data.

snake.mrd_utils.writer.add_dynamic_mrd(dataset: ismrmrd.Dataset, dynamic: snake.core.phantom.DynamicData, sim_conf: snake.core.simulation.SimConfig) ismrmrd.Dataset[source]#

Add the dynamic data to the dataset.

snake.mrd_utils.writer.add_coil_cov_mrd(dataset: ismrmrd.Dataset, sim_conf: snake.core.simulation.SimConfig, coil_cov: numpy.typing.NDArray | None = None) ismrmrd.Dataset[source]#

Add the Smaps to the dataset.

snake.mrd_utils.writer.make_base_mrd(filename: os.PathLike, 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, model: str = 'simple', slice_2d: bool = False) ismrmrd.Dataset[source]#

Create a base .mrd file from the simulation configurations.

Parameters:
  • filename (os.PathLike) – The output filename.

  • sampler (BaseSampler) – The sampling pattern generator.

  • phantom (Phantom) – The phantom object.

  • sim_conf (SimConfig) – The simulation configurations.

  • dynamic_data (list[DynamicData], optional) – The dynamic data, by default None

  • smaps (NDArray, optional) – The coil sensitivity maps, by default None

  • coil_covar (NDArray, optional) – The coil covariance matrix, by default None