mrpro.utils.slice_profiles.SliceSmoothedRectangular

class mrpro.utils.slice_profiles.SliceSmoothedRectangular(fwhm_rect: float | Tensor, fwhm_gauss: float | Tensor)[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 – Full width at half maximum of the rectangular profile

  • fwhm_gauss – Full width at half maximum of the Gaussian profile. Set to zero to disable smoothing.

Return type:

Value of the profile / intensity at the given position

forward(x: Tensor) Tensor[source]

Evaluate the Gaussian Slice Profile at a position.

Parameters:

x – Position at which to evaluate the profile

Return type:

Value of the profile / intensity at the given position

random_sample(size: Sequence[int]) Tensor

Sample n random positions from the profile.

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

Parameters:

size – Number of positions to sample

Return type:

Sampled positions, shape will be size.