Commit 18fad6bce9cf0bb911490e35c807a3ff6090770e

Authored by David Mayerich
1 parent 51c0cf6e

big fixes and changes to stim::network

Showing 2 changed files with 16 additions and 4 deletions   Show diff stats
1 -#Specify the version being used aswell as the language 1 +#Specify the version being used as well as the language
2 cmake_minimum_required(VERSION 2.8.11) 2 cmake_minimum_required(VERSION 2.8.11)
3 3
4 #Name your project here 4 #Name your project here
5 -project(netMets) 5 +project(netmets)
6 6
7 #set the module directory 7 #set the module directory
8 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}") 8 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}")
9 9
10 #find the STIM library 10 #find the STIM library
11 -find_package(STIM REQUIRED) 11 +find_package(STIM)
  12 +
  13 +#if the STIM library isn't found, download it
  14 +if(NOT STIM_INCLUDE_DIRS)
  15 + file(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/stimlib) #remove the stimlib directory if it exists
  16 + set(STIM_GIT "https://git.stim.ee.uh.edu/codebase/stimlib.git")
  17 + execute_process(COMMAND git clone --depth 1 ${STIM_GIT} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
  18 + set(STIM_INCLUDE_DIRS "${CMAKE_BINARY_DIR}/stimlib" CACHE TYPE PATH)
  19 +endif(NOT STIM_INCLUDE_DIRS)
12 20
13 #find BOOST 21 #find BOOST
14 find_package(Boost REQUIRED) 22 find_package(Boost REQUIRED)
@@ -22,6 +30,7 @@ find_package(X11) @@ -22,6 +30,7 @@ find_package(X11)
22 #find the Approximate Nearest Neighbor Library 30 #find the Approximate Nearest Neighbor Library
23 find_package(ANN REQUIRED) 31 find_package(ANN REQUIRED)
24 32
  33 +#build the executable in the binary directory on MS Visual Studio
25 if ( MSVC ) 34 if ( MSVC )
26 SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIRECTORY}") 35 SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIRECTORY}")
27 SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIRECTORY}") 36 SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIRECTORY}")
@@ -23,11 +23,14 @@ int main(int argc, char* argv[]) @@ -23,11 +23,14 @@ int main(int argc, char* argv[])
23 float sigma = atof(argv[3]); 23 float sigma = atof(argv[3]);
24 stim::network<float> GT;stim::network<float> T; 24 stim::network<float> GT;stim::network<float> T;
25 // load obj files to 3D network class 25 // load obj files to 3D network class
  26 +
  27 + //load the ground truth and test case networks
26 GT.load_obj(argv[1]); 28 GT.load_obj(argv[1]);
27 T.load_obj(argv[2]); 29 T.load_obj(argv[2]);
28 30
29 // resample the loaded networks 31 // resample the loaded networks
30 - stim::network<float> resampled_GT;stim::network<float> resampled_T; 32 + stim::network<float> resampled_GT;
  33 + stim::network<float> resampled_T;
31 34
32 resampled_GT = GT.resample(sigma * resample_rate); 35 resampled_GT = GT.resample(sigma * resample_rate);
33 resampled_T = T.resample(sigma * resample_rate); 36 resampled_T = T.resample(sigma * resample_rate);