Table of Contents

NAME

QccIMGImageCubeMSE, QccIMGImageCubeShapeAdaptiveMSE, QccIMGImageCubeMAE, QccIMGImageCubeShapeAdaptiveMAE - mean squared error and maximum absolute error between image cubes

SYNOPSIS

#include "libQccPack.h"

double QccIMGImageCubeMSE(const QccIMGImageCube *image_cube1, const QccIMGImageCube *image_cube2);
double QccIMGImageCubeShapeAdaptiveMSE(const QccIMGImageCube *image_cube1, const QccIMGImageCube *image_cube2, const QccIMGImageCube *alpha_mask);

double QccIMGImageCubeMAE(const QccIMGImageCube *image_cube1, const QccIMGImageCube *image_cube2);
double QccIMGImageCubeShapeAdaptiveMAE(const QccIMGImageCube *image_cube1, const QccIMGImageCube *image_cube2, const QccIMGImageCube *alpha_mask);

DESCRIPTION

QccIMGImageCubeMSE() returns the mean squared error (MSE) between image_cube1 and image_cube2. The MSE is calculated by taking the difference between a voxel in image_cube1 and its corresponding voxel in image_cube2, squaring this difference, and finally averaging all the squared differences over the entire image cube. image_cube1 and image_cube2 must have the same size.

QccIMGImageCubeShapeAdaptiveMSE() performs an MSE calculation similar to that of QccIMGImageCubeMSE(), except that alpha_mask is assumed to denote regions that are "transparent" in both image_cube1 and image_cube2 and thus contain no valid voxel data. That is, QccIMGImageCubeShapeAdaptiveMSE() skips over voxels in the MSE calculation for which QccAlphaTransparent(3) returns non-zero when applied to alpha_mask at the current voxel location. If alpha_mask is NULL, the usual, full-cube MSE is calculated via QccIMGImageCubeMSE(). image_cube1, image_cube2, and alpha_mask (if it is non-NULL) must all have the same size.

QccIMGImageCubeMAE() returns the maximum absolute error (MAE) between image_cube1 and image_cube2. The MAE is calculated by taking the difference between a voxel in image_cube1 and its corresponding voxel in image_cube2, and then calculating the absolute value of this difference using fabs(3) . The largest absolute value encountered in this fashion over the entire image cube is returned by QccIMGImageCubeMAE(). image_cube1 and image_cube2 must have the same size.

QccIMGImageCubeShapeAdaptiveMAE() performs an MAE calculation similar to that of QccIMGImageCubeMAE(), except that alpha_mask is assumed to denote regions that are "transparent" in both image_cube1 and image_cube2 and thus contain no valid voxel data. alpha_mask is NULL, the usual, full-cube MAE is calculated via QccIMGImageCubeMAE(). image_cube1, image_cube2, and alpha_mask (if it is non-NULL) must all have the same size.

RETURN VALUES

These routines return the value of the MSE or MAE quantity they calculate; in the case of an error, these routines return 0.0.

SEE ALSO

fabs(3) , QccAlphaTransparent(3) , QccIMGImageCube(3) , QccPackIMG(3) , QccPack(3)

AUTHOR

Copyright (C) 1997-2021 James E. Fowler


Table of Contents



Get QccPack at SourceForge.net. Fast, secure and Free Open Source software downloads