linumpy.gpu.image_quality#
GPU-accelerated image quality assessment functions.
This module provides CuPy-accelerated versions of quality assessment functions. All functions automatically fall back to CPU if GPU is not available.
Usage:
from linumpy.gpu.image_quality import (
compute_ssim_2d_gpu,
compute_ssim_3d_gpu,
compute_edge_score_gpu,
assess_slice_quality_gpu,
)
# All functions accept numpy arrays and return numpy scalars
ssim = compute_ssim_3d_gpu(vol1, vol2)
Attributes#
Functions#
|
Normalize image to [0, 1] range on GPU. |
|
Compute SSIM between two 2D images using GPU. |
|
Compute mean SSIM between two 3D volumes using GPU. |
|
Compute edge preservation score using GPU. |
|
Compute variance score using GPU. |
|
Assess overall quality of a slice volume using GPU acceleration. |
Clear GPU memory pools. |
Module Contents#
- linumpy.gpu.image_quality.normalize_image_gpu(img)[source]#
Normalize image to [0, 1] range on GPU.
- Parameters:
img (cp.ndarray) – Input image on GPU.
- Returns:
Normalized image.
- Return type:
cp.ndarray
- linumpy.gpu.image_quality.compute_ssim_2d_gpu(img1, img2, win_size=7)[source]#
Compute SSIM between two 2D images using GPU.
Falls back to CPU if GPU is not available.
- linumpy.gpu.image_quality.compute_ssim_3d_gpu(vol1, vol2, win_size=7, sample_depth=0)[source]#
Compute mean SSIM between two 3D volumes using GPU.
- linumpy.gpu.image_quality.compute_edge_score_gpu(vol, reference, sample_z=None)[source]#
Compute edge preservation score using GPU.
- linumpy.gpu.image_quality.compute_variance_score_gpu(vol, reference)[source]#
Compute variance score using GPU.
- Parameters:
vol (np.ndarray) – Input volume.
reference (np.ndarray) – Reference volume.
- Returns:
Variance score (0 to 1).
- Return type: