libtpcimgp
 All Data Structures Files Functions Variables Typedefs Defines
Functions
imgmatch.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <string.h>
#include <float.h>
#include "img.h"
#include "imgfile.h"
#include "include/imgmatch.h"
Include dependency graph for imgmatch.c:

Go to the source code of this file.

Functions

int imgMatch (IMG *img1, IMG *img2, float accuracy)
int imgMatchMatrix (IMG *img1, IMG *img2, double accuracy)
int imgMatchHeader (IMG *img1, IMG *img2)
int imgMatchFrames (IMG *img1, IMG *img2)
int imgMatchPlanes (IMG *img1, IMG *img2)
int imgMaxDifference (IMG *img1, IMG *img2, VOXEL_4D *absdiff, float *abs_max, VOXEL_4D *reldiff, float *rel_max)

Function Documentation

int imgMatch ( IMG *  img1,
IMG *  img2,
float  accuracy 
)

Checks if two IMG data contents are similar (header information, frame times, data dimensions, matrix contents inside specified accuracy).

Returns:
Returns 0 if match was found, and >0 if not.
Parameters:
img1Pointer to the first IMG data
img2Pointer to the second IMG data to be compared against the first one
accuracyPixel values must satisfy condition abs(x1-x2)/abs(mean(x1,x2))<=0.01. If you want exact match, set accuracy=0.0.

Definition at line 55 of file imgmatch.c.

References imgMatchFrames(), imgMatchHeader(), imgMatchMatrix(), and imgMatchPlanes().

Here is the call graph for this function:

int imgMatchFrames ( IMG *  img1,
IMG *  img2 
)

Checks if the frame times of two IMG data do match: return Returns 0 if match was found, and >0 if they do not match.

Definition at line 221 of file imgmatch.c.

Referenced by imgMatch().

int imgMatchHeader ( IMG *  img1,
IMG *  img2 
)

Checks if two image headers match.

Returns:
Returns 0 if headers match, 1 if headers do not match.

Definition at line 112 of file imgmatch.c.

Referenced by imgMatch().

int imgMatchMatrix ( IMG *  img1,
IMG *  img2,
double  accuracy 
)

Checks if two image matrixes match in the accuracy of argument "accuracy". (set e.g. accuracy=0.99 and you will get match if all matrix values satisfy abs(x1-x2)/abs(mean(x1,x2))<=0.01) If you want exact match, set accuracy=0.0.

Returns:
Returns 0 if matrixes match, 1 if matrixes do not match.

Definition at line 83 of file imgmatch.c.

Referenced by imgMatch().

int imgMatchPlanes ( IMG *  img1,
IMG *  img2 
)

Checks if the planes of two IMG data do match: plane numbers.

Returns:
Returns 0 if match was found, and >0 if no match.

Definition at line 238 of file imgmatch.c.

Referenced by imgMatch().

int imgMaxDifference ( IMG *  img1,
IMG *  img2,
VOXEL_4D absdiff,
float *  abs_max,
VOXEL_4D reldiff,
float *  rel_max 
)

Checks if pixel values in two image matrices are similar withing specified allowed absolute difference.

Returns:
Returns 0 if successful, and difference was found, -1 if no difference was found, and >0 in case of an error.
Parameters:
img1Pointer to the first IMG
img2Pointer to the second IMG, with the same dimensions as img1
absdiffVoxel where absolute difference was found largest; enter NULL if not needed; returns [0,0,0,0] if no difference was found
abs_maxPointer where max absolute difference is written; NULL if not needed
reldiffVoxel where relational difference was found largest; enter NULL if not needed; returns [0,0,0,0] if no difference was found
rel_maxPointer where max relational difference is written; NULL if not needed

Definition at line 254 of file imgmatch.c.

References VOXEL_4D::t, VOXEL_4D::x, VOXEL_4D::y, and VOXEL_4D::z.