zea.metrics

Quality metrics for ultrasound images.

Functions

cnr(x, y)

Calculate contrast to noise ratio

contrast(x, y)

Contrast ratio

fwhm(img)

Resolution full width half maxima

gcnr(x, y[, bins])

Generalized contrast-to-noise-ratio

get_metric(name)

Get metric function given name.

image_entropy(image)

Calculate the entropy of the image

image_sharpness(image)

Calculate the sharpness of the image

l1loss(x, y)

L1 loss

l2loss(x, y)

L2 loss

ncc(x, y)

Normalized cross correlation

psnr(x, y)

Peak signal to noise ratio

snr(img)

Signal to noise ratio

speckle_res(img)

TODO: Write speckle edge-spread function resolution code

wopt_mae(ref, img)

Find the optimal weight that minimizes the mean absolute error

wopt_mse(ref, img)

Find the optimal weight that minimizes the mean squared error

zea.metrics.cnr(x, y)[source]

Calculate contrast to noise ratio

zea.metrics.contrast(x, y)[source]

Contrast ratio

zea.metrics.fwhm(img)[source]

Resolution full width half maxima

zea.metrics.gcnr(x, y, bins=256)[source]

Generalized contrast-to-noise-ratio

zea.metrics.get_metric(name)[source]

Get metric function given name.

zea.metrics.image_entropy(image)[source]

Calculate the entropy of the image

Parameters:

image (ndarray) – The image for which the entropy is calculated

Returns:

The entropy of the image

Return type:

float

zea.metrics.image_sharpness(image)[source]

Calculate the sharpness of the image

Parameters:

image (ndarray) – The image for which the sharpness is calculated

Returns:

The sharpness of the image

Return type:

float

zea.metrics.l1loss(x, y)[source]

L1 loss

zea.metrics.l2loss(x, y)[source]

L2 loss

zea.metrics.ncc(x, y)[source]

Normalized cross correlation

zea.metrics.psnr(x, y)[source]

Peak signal to noise ratio

zea.metrics.snr(img)[source]

Signal to noise ratio

zea.metrics.speckle_res(img)[source]

TODO: Write speckle edge-spread function resolution code

zea.metrics.wopt_mae(ref, img)[source]

Find the optimal weight that minimizes the mean absolute error

zea.metrics.wopt_mse(ref, img)[source]

Find the optimal weight that minimizes the mean squared error