nrtk.impls.image_metric.snr_image_metric
Defines SNRImageMetric, an ImageMetric implementation that computes signal-to-noise ratio for a single image.
- Classes:
SNRImageMetric: Calculates the Signal-to-Noise Ratio (SNR) of an image using specified parameters for axis and degrees of freedom.
- Functions:
_signal_to_noise: A helper function for computing the SNR of an image based on its mean and standard deviation along a given axis and degrees of freedom.
- Dependencies:
numpy for image processing and statistical calculations.
- Usage:
Instantiate SNRImageMetric and call the compute method with an image to obtain the SNR. Optional parameters for axis and ddof (degrees of freedom) can be specified in additional_params.
- Example:
snr_metric = SNRImageMetric() snr_value = snr_metric.compute(image_data, additional_params={“axis”: 0, “ddof”: 0})
- Notes:
SNR calculations are only supported for single images; attempting to pass a second image to compute will raise an error.
The optional axis parameter controls the dimensions over which the mean and standard deviation are computed. This affects the SNR calculation but defaults to None, which includes all axes and channels.
Classes
Implementation of the |