Metrics

Metric tracking and analysis tools

source

SSIM

 SSIM (x, y, spatial_dims=2)

Fourier Ring Correlation

Radial mask


source

radial_mask

 radial_mask (r, cx=128, cy=128, sx=256, sy=256, delta=1)

*Generate a radial mask.

Parameters:

  • r (int or float): Radius of the circular mask.
  • cx (int, optional): X-coordinate of the center of the circular mask. Defaults to 128.
  • cy (int, optional): Y-coordinate of the center of the circular mask. Defaults to 128.
  • sx (int, optional): Array of x-coordinates forming a grid. Defaults to 256.
  • sy (int, optional): Array of y-coordinates forming a grid. Defaults to 256.
  • delta (int or float, optional): Thickness adjustment for the circular mask. Defaults to 1.

Returns:

  • numpy.ndarray: Radial mask.*
Type Default Details
r Radius of the radial mask
cx int 128 X coordinate mask center
cy int 128 Y coordinate maske center
sx int 256
sy int 256
delta int 1

source

get_radial_masks

 get_radial_masks (width, height)

*Generates a set of radial masks and corresponding to spatial frequencies.

Parameters:

- width (int): Width of the image.
- height (int): Height of the image.

Returns:

tuple: A tuple containing:
    - numpy.ndarray: Array of radial masks.
    - numpy.ndarray: Array of spatial frequencies corresponding to the masks.*

Fourier ring correlation


source

get_fourier_ring_correlations

 get_fourier_ring_correlations (image1, image2)

*Compute Fourier Ring Correlation (FRC) between two images.

Args:

- image1 (torch.Tensor): First input image.
- image2 (torch.Tensor): Second input image.

Returns:

tuple: A tuple containing:
    - torch.Tensor: Fourier Ring Correlation values.
    - torch.Tensor: Array of spatial frequencies.*

source

FRCMetric

 FRCMetric (image1, image2)

*Compute the area under the Fourier Ring Correlation (FRC) curve between two images.

Args:

- image1 (torch.Tensor): The first input image.
- image2 (torch.Tensor): The second input image.

Returns:

- float: The area under the FRC curve.*