mrpro.data.traj_calculators.KTrajectoryCartesian
- class mrpro.data.traj_calculators.KTrajectoryCartesian[source]
Bases:
KTrajectoryCalculatorCartesian trajectory.
- __init__()
- classmethod fullysampled(encoding_matrix: SpatialDimension[int]) KTrajectory[source]
Generate fully sampled Cartesian trajectory.
- Parameters:
encoding_matrix (
SpatialDimension[int]) – Encoded K-space size.- Returns:
Cartesian trajectory.
- classmethod gaussian_variable_density(encoding_matrix: SpatialDimension[int] | int, acceleration: float = 2.0, n_center: int = 10, fwhm_ratio: float = 1.0, n_other: Sequence[int] = (1,), seed: int | None = None) KTrajectory[source]
Generate k-space Gaussian weighted variable density sampling.
- Parameters:
encoding_matrix (
Union[SpatialDimension[int],int]) – Encoded K-space size, must haveencoding_matrix.z=1. If a single integer, a square k-space is considered.acceleration (
float, default:2.0) – Acceleration factor (undersampling rate).n_center (
int, default:10) – Number of fully-sampled center lines to always include.fwhm_ratio (
float, default:1.0) – Full-width at half-maximum of the Gaussian relative to encoding_matrix.y. Larger values approach uniform sampling. Set to infinity for uniform sampling.n_other (
Sequence[int], default:(1,)) – Batch size(s). The trajectory is different for each batch sample.seed (
int|None, default:None) – Random seed for reproducibility.
- Returns:
Cartesian trajectory.
- Raises:
ValueError – If
n_centerexceeds the total number of lines to keep given the acceleration.NotImplementedError – If called with a 3D encoding matrix.
- __call__(*, n_k0: int, k0_center: int | Tensor, k1_idx: Tensor, k1_center: int | Tensor, k2_idx: Tensor, k2_center: int | Tensor, reversed_readout_mask: Tensor | None = None, **_) KTrajectory[source]
Calculate Cartesian trajectory for given KHeader.
- __eq__(value, /)
Return self==value.
- __new__(**kwargs)