Commit a0048e3147823a5e3b76965870a8e8f1d0672ca7
1 parent
03c5492b
added several test cases, implemented a simple test of loading networks from OBJ files
Showing
14 changed files
with
210 additions
and
48 deletions
Show diff stats
00_GT.obj deleted
1 | -v 99 677 | |
2 | -v 229 510 | |
3 | -v 57 347 | |
4 | -v 344 724 | |
5 | -v 581 361 | |
6 | -v 341 199 | |
7 | -v 757 377 | |
8 | -v 981 152 | |
9 | -v 793 508 | |
10 | -v 941 600 | |
11 | -v 647 738 | |
12 | -v 88 563 | |
13 | -v 181 372 | |
14 | -v 316 596 | |
15 | -v 385 425 | |
16 | -v 481 165 | |
17 | -v 574 223 | |
18 | -v 818 229 | |
19 | -v 679 601 | |
20 | -l 1 12 2 | |
21 | -l 3 13 2 | |
22 | -l 2 14 4 | |
23 | -l 2 15 5 | |
24 | -l 6 16 17 5 | |
25 | -l 5 7 | |
26 | -l 8 18 7 | |
27 | -l 7 9 | |
28 | -l 9 10 | |
29 | -l 9 19 11 |
CMakeLists.txt
... | ... | @@ -7,9 +7,6 @@ project(netMets) |
7 | 7 | #set the module directory |
8 | 8 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}") |
9 | 9 | |
10 | -#set up CUDA | |
11 | -find_package(CUDA REQUIRED) | |
12 | - | |
13 | 10 | #find the STIM library |
14 | 11 | find_package(STIM REQUIRED) |
15 | 12 | |
... | ... | @@ -22,36 +19,46 @@ find_package(Threads) |
22 | 19 | #find the X11 package |
23 | 20 | find_package(X11) |
24 | 21 | |
25 | - | |
26 | 22 | #find the Approximate Nearest Neighbor Library |
27 | 23 | find_package(ANN REQUIRED) |
28 | 24 | |
25 | +if ( MSVC ) | |
26 | + SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIRECTORY}") | |
27 | + SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIRECTORY}") | |
28 | +endif ( MSVC ) | |
29 | + | |
29 | 30 | include_directories( |
30 | 31 | ${STIM_INCLUDE_DIRS} |
31 | - ${ANN_INCLUDE_DIR} | |
32 | + ${ANN_INCLUDE_DIR} | |
32 | 33 | ${Boost_INCLUDE_DIR} |
33 | 34 | ) |
34 | 35 | |
35 | 36 | #Assign source files to the appropriate variables |
36 | 37 | file(GLOB SRC_CPP "*.cpp") |
37 | 38 | file(GLOB SRC_H "*.h") |
38 | -file(GLOB SRC_CU "*.cu") | |
39 | -file(GLOB SRC_CUH "*.cuh") | |
40 | 39 | |
41 | 40 | #create an executable file |
42 | -cuda_add_executable(netmets | |
43 | - ${SRC_H} | |
44 | - ${SRC_CPP} | |
45 | - ${SRC_CU} | |
46 | - ${SRC_CUH} | |
41 | +add_executable(netmets | |
42 | + ${SRC_H} | |
43 | + ${SRC_CPP} | |
47 | 44 | ) |
48 | 45 | |
49 | 46 | #set the link libraries |
50 | 47 | target_link_libraries(netmets |
51 | - #${CUDA_cufft_LIBRARY} | |
52 | - #${CUDA_cublas_LIBRARY} | |
53 | 48 | ${CMAKE_THREAD_LIBS_INIT} |
54 | - ${ANN_LIBRARY} | |
49 | + ${ANN_LIBRARY} | |
55 | 50 | ${X11_LIBRARIES} |
56 | 51 | ) |
57 | 52 | |
53 | +#set up copying data files | |
54 | +configure_file(data/00_GT.obj ${CMAKE_CURRENT_BINARY_DIR}/00_GT.obj @ONLY) | |
55 | +configure_file(data/00_T.obj ${CMAKE_CURRENT_BINARY_DIR}/00_T.obj @ONLY) | |
56 | +configure_file(data/01_GT.obj ${CMAKE_CURRENT_BINARY_DIR}/01_GT.obj @ONLY) | |
57 | +configure_file(data/01_T.obj ${CMAKE_CURRENT_BINARY_DIR}/01_T.obj @ONLY) | |
58 | +configure_file(data/02_GT.obj ${CMAKE_CURRENT_BINARY_DIR}/02_GT.obj @ONLY) | |
59 | +configure_file(data/02_T.obj ${CMAKE_CURRENT_BINARY_DIR}/02_T.obj @ONLY) | |
60 | +configure_file(data/03_GT.obj ${CMAKE_CURRENT_BINARY_DIR}/03_GT.obj @ONLY) | |
61 | +configure_file(data/03_T.obj ${CMAKE_CURRENT_BINARY_DIR}/03_T.obj @ONLY) | |
62 | +configure_file(data/04_GT.obj ${CMAKE_CURRENT_BINARY_DIR}/04_GT.obj @ONLY) | |
63 | +configure_file(data/04_Ta.obj ${CMAKE_CURRENT_BINARY_DIR}/04_Ta.obj @ONLY) | |
64 | +configure_file(data/04_Tb.obj ${CMAKE_CURRENT_BINARY_DIR}/04_Tb.obj @ONLY) | ... | ... |
1 | +v 99 677 0 | |
2 | +v 229 510 0 | |
3 | +v 57 347 0 | |
4 | +v 344 724 0 | |
5 | +v 581 361 0 | |
6 | +v 341 199 0 | |
7 | +v 757 377 0 | |
8 | +v 981 152 0 | |
9 | +v 793 508 0 | |
10 | +v 941 600 0 | |
11 | +v 647 738 0 | |
12 | +v 88 563 0 | |
13 | +v 181 372 0 | |
14 | +v 316 596 0 | |
15 | +v 385 425 0 | |
16 | +v 481 165 0 | |
17 | +v 574 223 0 | |
18 | +v 818 229 0 | |
19 | +v 679 601 0 | |
20 | +l 1 12 2 | |
21 | +l 3 13 2 | |
22 | +l 2 14 4 | |
23 | +l 2 15 5 | |
24 | +l 6 16 17 5 | |
25 | +l 5 7 | |
26 | +l 8 18 7 | |
27 | +l 7 9 | |
28 | +l 9 10 | |
29 | +l 9 19 11 | ... | ... |
00_T.obj renamed to data/00_T.obj
1 | +v 334 445 0 | |
2 | +v 370 544 0 | |
3 | +v 549 545 0 | |
4 | +v 681 360 0 | |
5 | +v 484 172 0 | |
6 | +v 469 477 0 | |
7 | +v 484 172 0 | |
8 | +v 469 477 0 | |
9 | +v 370 544 0 | |
10 | +v 549 545 0 | |
11 | +v 469 477 0 | |
12 | +v 484 172 0 | |
13 | +l 1 2 | |
14 | +l 2 3 | |
15 | +l 3 4 | |
16 | +l 4 5 | |
17 | +l 5 7 1 | |
18 | +l 6 8 1 | |
19 | +l 2 9 6 | |
20 | +l 3 10 6 | |
21 | +l 6 11 4 | |
22 | +l 5 12 6 | ... | ... |
1 | +v 212 603 0 | |
2 | +v 365 427 0 | |
3 | +v 125 308 0 | |
4 | +v 457 253 0 | |
5 | +v 654 335 0 | |
6 | +v 578 630 0 | |
7 | +v 565 118 0 | |
8 | +v 813 145 0 | |
9 | +v 801 451 0 | |
10 | +v 949 54 0 | |
11 | +v 276 494 0 | |
12 | +v 208 348 0 | |
13 | +v 284 382 0 | |
14 | +v 404 352 0 | |
15 | +v 381 408 0 | |
16 | +v 414 444 0 | |
17 | +v 492 452 0 | |
18 | +v 554 451 0 | |
19 | +v 602 403 0 | |
20 | +v 662 429 0 | |
21 | +v 648 487 0 | |
22 | +v 617 570 0 | |
23 | +v 633 266 0 | |
24 | +v 614 219 0 | |
25 | +v 594 172 0 | |
26 | +v 705 322 0 | |
27 | +v 747 299 0 | |
28 | +v 796 243 0 | |
29 | +v 855 233 0 | |
30 | +v 825 359 0 | |
31 | +v 884 89 0 | |
32 | +l 1 11 2 | |
33 | +l 3 12 13 2 | |
34 | +l 4 14 15 2 | |
35 | +l 2 16 17 18 19 5 | |
36 | +l 5 20 21 22 6 | |
37 | +l 5 23 24 25 7 | |
38 | +l 5 26 27 28 8 | |
39 | +l 8 29 30 9 | |
40 | +l 8 31 10 | ... | ... |
main.cpp
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | #include <string> |
3 | 3 | #include <fstream> |
4 | 4 | #include <algorithm> |
5 | -#include <stim/visualization/network.h> | |
5 | +#include <stim/biomodels/network.h> | |
6 | 6 | |
7 | 7 | #include <ANN/ANN.h> |
8 | 8 | #include <boost/tuple/tuple.hpp> |
... | ... | @@ -13,15 +13,29 @@ network<float>* network1; |
13 | 13 | |
14 | 14 | int main(int argc, char* argv[]) |
15 | 15 | { |
16 | - std::string groundTruth = argv[1]; | |
16 | + if(argc < 4){ | |
17 | + std::cout<<"Please specify a ground truth and test case"<<std::endl; | |
18 | + exit(1); | |
19 | + } | |
20 | + | |
21 | + stim::network<float> GT; | |
22 | + GT.load_obj(argv[1]); | |
23 | + | |
24 | + std::cout<<GT.str(); | |
25 | + | |
26 | + | |
27 | + /*std::string groundTruth = argv[1]; | |
17 | 28 | std::string truthCase = argv[2]; |
29 | + float sigma = atof(argv[3]); | |
30 | + | |
18 | 31 | //stim::network<int> network; |
19 | 32 | boost::tuple< ANNkd_tree*, ANNkd_tree*, stim::network<float>, stim::network<float> > networkKdtree; |
20 | 33 | networkKdtree = network1->LoadNetworks(groundTruth, truthCase); |
21 | - //std::cout<<networkKdtree.get< 2>().edges_to_str()<<std::endl; | |
34 | + std::cout<<networkKdtree.get< 2>().edges_to_str()<<std::endl; | |
22 | 35 | networkKdtree.get< 2>().to_obj(); |
23 | 36 | //networkKdtree.get< 2>() |
24 | - boost::tuple< float, float > metrics = network1->compareSkeletons(networkKdtree); | |
37 | + boost::tuple< float, float > metrics = network1->compareSkeletons(networkKdtree, sigma); | |
25 | 38 | std::cout << "False postive rate is " << metrics.get< 0>() << std::endl; |
26 | 39 | std::cout << "False negative rate is " << metrics.get< 1>() << std::endl; |
40 | + */ | |
27 | 41 | } | ... | ... |