mrpro.utils.slice_profiles.SliceSmoothedRectangular

class mrpro.utils.slice_profiles.SliceSmoothedRectangular[source]

Bases: SliceProfileBase

Rectangular slice profile with smoothed flanks.

Implemented as a convolution of a rectangular profile with a Gaussian.

__init__(fwhm_rect: float | Tensor, fwhm_gauss: float | Tensor)[source]

Initialize the Rectangular slice profile.

Parameters:
  • fwhm_rect (float | Tensor) – Full width at half maximum of the rectangular profile

  • fwhm_gauss (float | Tensor) – Full width at half maximum of the Gaussian profile. Set to zero to disable smoothing.

Returns:

Value of the profile / intensity at the given position

forward(x: Tensor) Tensor[source]

Evaluate the Gaussian 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.