Initial snark14m import
[snark14.git] / src / snark / DistanceMeasurePixel.cpp
1 /*
2  ***********************************************************
3  $SNARK_Header$
4  $HeadURL: svn://dig.cs.gc.cuny.edu/snark/trunk/src/snark/trm6.cpp $
5  $LastChangedRevision: 122 $
6  $Date: 2014-07-09 18:18:59 -0400 (Wed, 09 Jul 2014) $
7  $Author: agulati $
8  ***********************************************************
9  */
10
11 #include "DistanceMeasurePixel.h"
12 #include "blob.h"
13 #include "geom.h"
14
15 using namespace std;
16
17 DistanceMeasurePixel::DistanceMeasurePixel(char* distanceNameIn) :
18                 DistanceMeasure(distanceNameIn) {
19 }
20
21 DistanceMeasurePixel::~DistanceMeasurePixel() {
22 }
23
24 REAL DistanceMeasurePixel::calculateDistanceForBlob(REAL* reconBlob,
25 INTEGER* list, REAL* weight) {
26
27         // if input uses blob basis functions --> it needs to be converted to pixel first
28         REAL* reconPixel = new REAL[GeoPar.area];
29         Blob.blob2pix(reconBlob, reconPixel);
30
31         REAL distance = this->calculateDistanceForPixel(reconPixel, list, weight);
32         delete[] reconPixel;
33
34         return distance;
35 }