Blame view

main.cpp 1.08 KB
44700501   pranathivemuri   program to genera...
1
2
3
4
  #include <stdlib.h>
  #include <string>
  #include <fstream>
  #include <algorithm>
a0048e31   David Mayerich   added several tes...
5
  #include <stim/biomodels/network.h>
44700501   pranathivemuri   program to genera...
6
7
8
9
10
  
  #include <ANN/ANN.h>
  #include <boost/tuple/tuple.hpp>
  using namespace stim;
  //template <typename T>
03c5492b   pranathivemuri   networks and kd t...
11
12
  network<float>* network1;
  
44700501   pranathivemuri   program to genera...
13
14
15
  
  int main(int argc, char* argv[])
  {
a0048e31   David Mayerich   added several tes...
16
17
18
19
20
  	if(argc < 4){
  		std::cout<<"Please specify a ground truth and test case"<<std::endl;
  		exit(1);
  	}
  
51c0cf6e   David Mayerich   cleaned up the me...
21
22
  	float resample_rate = 0.1;
  
c4dba76e   David Mayerich   added code to tes...
23
  	float sigma = atof(argv[3]);
ed5edb3e   pranathivemuri   added function to...
24
25
  	stim::network<float> GT;stim::network<float> T;
  	// load obj files to 3D network class
a0048e31   David Mayerich   added several tes...
26
  	GT.load_obj(argv[1]);
ed5edb3e   pranathivemuri   added function to...
27
  	T.load_obj(argv[2]);
51c0cf6e   David Mayerich   cleaned up the me...
28
  
ed5edb3e   pranathivemuri   added function to...
29
30
  	// resample the loaded networks
  	stim::network<float> resampled_GT;stim::network<float> resampled_T;
51c0cf6e   David Mayerich   cleaned up the me...
31
32
33
34
  
  	resampled_GT = GT.resample(sigma * resample_rate);
  	resampled_T = T.resample(sigma * resample_rate);
  
ed5edb3e   pranathivemuri   added function to...
35
36
  	// compare ground truth with truth and viceversa
  	float gFPR, gFNR;
51c0cf6e   David Mayerich   cleaned up the me...
37
38
  	gFPR = resampled_GT.compare(resampled_T, sigma);
      gFNR = resampled_T.compare(resampled_GT, sigma);
ed5edb3e   pranathivemuri   added function to...
39
40
41
42
  	// print false alarms and misses
  	std::cout << "False postive rate is " << gFPR << std::endl;
  	std::cout << "False negative rate is " << gFNR << std::endl;
  }