Initial snark14m import
[snark14.git] / src / snark / DistanceMeasure.h
1 /* 
2  ***********************************************************
3  $SNARK_Header$
4  $HeadURL: svn://dig.cs.gc.cuny.edu/snark/trunk/src/snark/trm6.h $
5  $LastChangedRevision: 122 $
6  $Date: 2014-07-09 18:18:59 -0400 (Wed, 09 Jul 2014) $
7  $Author: agulati $
8  ***********************************************************
9
10  Abstract class for distance measurements
11
12  */
13
14 #ifndef Distance_Measure
15 #define Distance_Measure
16
17 #include "blkdta.h"
18
19 class DistanceMeasure {
20
21 // attributes
22 private:
23         char* distanceName;
24
25 // methods
26 public:
27         DistanceMeasure(char* distanceNameIn);
28         virtual ~DistanceMeasure();
29
30         /**
31          * Calculates the distance for the provided reconstruction.
32          *
33          * input:       recon           the reconstruction, from which the distance should be calculated
34          *                      list            a allocated list with lenght = max pixel intersected by one ray
35          *                      weight          a allocated list with lenght = max pixel intersected by one ray
36          */
37         REAL calculateDistance(REAL* recon, INTEGER* list, REAL* weight);
38
39         /**
40          * Calculates the distance for the provided reconstruction.
41          *
42          * input:       reconPixel      the reconstruction, from which the distance should be calculated
43          *                      list            a allocated list with lenght = max pixel intersected by one ray
44          *                      weight          a allocated list with lenght = max pixel intersected by one ray
45          */
46         virtual REAL calculateDistanceForPixel(REAL* reconPixel, INTEGER* list,
47         REAL* weight) = 0;
48
49         /**
50          * Calculates the distance for the provided reconstruction.
51          *
52          * input:       reconBlob       the reconstruction, from which the distance should be calculated
53          *                      list            a allocated list with lenght = max pixel intersected by one ray
54          *                      weight          a allocated list with lenght = max pixel intersected by one ray
55          */
56         virtual REAL calculateDistanceForBlob(REAL* reconBlob, INTEGER* list,
57         REAL* weight) = 0;
58
59         /**
60          * Returns the name of the distance measure
61          */
62         char* getName();
63 };
64
65 #endif