main.cpp 2.04 KB
#include <stdlib.h>
#include <string>
#include <fstream>
#include <algorithm>
#include <stim/biomodels/network.h>

#include <ANN/ANN.h>
#include <boost/tuple/tuple.hpp>
using namespace stim;
//template <typename T>
network<float>* network1;


int main(int argc, char* argv[])
{
	if(argc < 4){
		std::cout<<"Please specify a ground truth and test case"<<std::endl;
		exit(1);
	}

	float sigma = atof(argv[3]);

	stim::network<float> GT;
	GT.load_obj(argv[1]);










	std::cout<<"Network:"<<std::endl<<std::endl;
	std::cout<<GT.str();

	std::cout<<"Fiber:"<<std::endl<<std::endl;
	stim::fiber<float> f;
	f = GT.get_fiber(0);
	std::cout<<f.str()<<std::endl;
	std::cout<<"Fiber length = "<<f.length()<<std::endl;

	std::cout<<"Resampled Fiber:"<<std::endl<<std::endl;
	stim::fiber<float> f2;
	f2 = f.resample(sigma);
	std::cout<<f2.str();
	std::cout<<"Fiber length = "<<f2.length()<<std::endl;

	std::cout<<"Resampled Network:"<<std::endl<<std::endl;
	stim::network<float> resampled_GT;
	resampled_GT = GT.resample(sigma);
	std::cout<<resampled_GT.str();

	std::cout<<"First Fiber from Resampled Network:"<<std::endl<<std::endl;
	stim::fiber<float> f3;
	f3 = resampled_GT.get_fiber(0);
	std::cout<<f3.str();

	//stim::fiber<T> f = e.Resample(25.0);
	//std::cout<<"resampled fiber length"<<std::endl;
	//std::cout<<f.length()<<std::endl;
	//std::cout<<"resampled fiber--"<<std::endl;
	//std::cout<<f.str()<<std::endl;


	/*std::string groundTruth = argv[1];
	std::string truthCase = argv[2];
	float sigma = atof(argv[3]);

	//stim::network<int> network;
	boost::tuple<  ANNkd_tree*, ANNkd_tree*, stim::network<float>, stim::network<float> > networkKdtree;
	networkKdtree = network1->LoadNetworks(groundTruth, truthCase);
	std::cout<<networkKdtree.get< 2>().edges_to_str()<<std::endl;
	networkKdtree.get< 2>().to_obj();
	//networkKdtree.get< 2>()
	boost::tuple< float, float > metrics = network1->compareSkeletons(networkKdtree, sigma);
	std::cout << "False postive rate is " << metrics.get< 0>() << std::endl;
	std::cout << "False negative rate is " << metrics.get< 1>() << std::endl;
	*/
}