mrpro.utils.slice_profiles.SliceInterpolate

class mrpro.utils.slice_profiles.SliceInterpolate[source]

Bases: SliceProfileBase

slice profile based on interpolation of measured profile.

__init__(positions: Tensor, values: Tensor)[source]

Initialize the interpolated slice profile.

Parameters:
  • positions (Tensor) – Positions of the measured profile.

  • values (Tensor) – Intensities of the measured profile.

forward(x: Tensor) Tensor[source]

Evaluate the interpolated slice profile at a position.

Parameters:

x (Tensor) – Position at which to evaluate the profile.

Returns:

Value of the profile / intensity at the given position.

random_sample(size: Sequence[int]) Tensor[source]

Sample n random positions from the profile.

Use the profile as a probability density function to sample positions.

Parameters:

size (Sequence[int]) – Number of positions to sample

Returns:

Sampled positions, shape will be size.