Commit ebb721c7e4788ddc420c63fc3292664ef83ac89e

Authored by David Mayerich
0 parents

new repository for STIM lab

00_GT.obj 0 → 100644
  1 +++ a/00_GT.obj
  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 0 → 100644
  1 +++ a/00_T.obj
  1 +v 119 675 0
  2 +v 343 730 0
  3 +v 59 346 0
  4 +v 577 361 0
  5 +v 347 199 0
  6 +v 756 375 0
  7 +v 588 483 0
  8 +v 789 514 0
  9 +v 676 603 0
  10 +v 652 744 0
  11 +v 933 598 0
  12 +v 105 611 0
  13 +v 126 537 0
  14 +v 227 519 0
  15 +v 294 580 0
  16 +v 319 677 0
  17 +v 165 366 0
  18 +v 192 438 0
  19 +v 234 473 0
  20 +v 294 463 0
  21 +v 375 428 0
  22 +v 441 404 0
  23 +v 510 388 0
  24 +v 419 188 0
  25 +v 492 174 0
  26 +v 551 205 0
  27 +v 567 273 0
  28 +v 572 334 0
  29 +v 645 365 0
  30 +v 695 410 0
  31 +v 633 438 0
  32 +v 776 424 0
  33 +v 788 467 0
  34 +v 742 552 0
  35 +v 702 584 0
  36 +v 663 659 0
  37 +v 649 720 0
  38 +v 839 539 0
  39 +v 882 557 0
  40 +v 804 606 0
  41 +l 1 12 13 14 15 16 2
  42 +l 3 17 18 19 20 21 22 23 4
  43 +l 5 24 25 26 27 28 4
  44 +l 4 29 6
  45 +l 6 30 31 7
  46 +l 6 32 33 8
  47 +l 8 34 35 9
  48 +l 9 36 37 10
  49 +l 8 38 39 11
  50 +l 9 40 11
... ...
01_GT.obj 0 → 100644
  1 +++ a/01_GT.obj
  1 +v 291 412 0
  2 +v 464 251 0
  3 +v 635 405 0
  4 +v 463 602 0
  5 +v 635 405 0
  6 +l 1 2
  7 +l 2 3
  8 +l 3 5 1
  9 +l 3 4
... ...
01_T.obj 0 → 100644
  1 +++ a/01_T.obj
  1 +v 292 411 0
  2 +v 464 252 0
  3 +v 531 312 0
  4 +v 637 404 0
  5 +v 537 405 0
  6 +v 442 408 0
  7 +v 368 409 0
  8 +v 464 603 0
  9 +v 531 312 0
  10 +v 442 408 0
  11 +l 1 2
  12 +l 2 3
  13 +l 3 4
  14 +l 4 5
  15 +l 3 9 5
  16 +l 6 10 5
  17 +l 1 7
  18 +l 4 8
... ...
02_GT.obj 0 → 100644
  1 +++ a/02_GT.obj
  1 +v 485 172 0
  2 +v 681 360 0
  3 +v 548 544 0
  4 +v 300 356 0
  5 +v 372 545 0
  6 +v 481 378 0
  7 +v 372 545 0
  8 +v 481 378 0
  9 +v 481 378 0
  10 +v 481 378 0
  11 +v 481 378 0
  12 +l 1 2
  13 +l 2 3
  14 +l 1 4
  15 +l 4 5
  16 +l 5 7 3
  17 +l 1 6
  18 +l 6 8 3
  19 +l 6 9 2
  20 +l 6 10 5
  21 +l 6 11 4
... ...
02_T.obj 0 → 100644
  1 +++ a/02_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
... ...
03_GT.obj 0 → 100644
  1 +++ a/03_GT.obj
  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
... ...
03_T.obj 0 → 100644
  1 +++ a/03_T.obj
  1 +v 212 604 0
  2 +v 123 310 0
  3 +v 365 427 0
  4 +v 576 631 0
  5 +v 457 253 0
  6 +v 563 116 0
  7 +v 813 144 0
  8 +v 800 450 0
  9 +v 951 57 0
  10 +v 800 450 0
  11 +l 1 2
  12 +l 3 4
  13 +l 5 6
  14 +l 6 7
  15 +l 8 10 4
  16 +l 8 9
... ...
CMakeLists.txt 0 → 100644
  1 +++ a/CMakeLists.txt
  1 +#Specify the version being used aswell as the language
  2 +cmake_minimum_required(VERSION 2.8)
  3 +#Name your project here
  4 +project(netmets)
  5 +
  6 +#set the module directory
  7 +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}")
  8 +
  9 +#find OpenGL
  10 +find_package(OpenGL REQUIRED)
  11 +
  12 +#find GLUT
  13 +set(GLUT_ROOT_PATH $ENV{GLUT_ROOT_PATH})
  14 +find_package(GLUT REQUIRED)
  15 +
  16 +#find GLEW
  17 +find_package(GLEW REQUIRED)
  18 +
  19 +#find BOOST
  20 +find_package(Boost REQUIRED)
  21 +
  22 +#find the Approximate Nearest Neighbor Library
  23 +find_package(ANN REQUIRED)
  24 +
  25 +#set the include directories
  26 +include_directories(
  27 + ${CMAKE_CURRENT_BINARY_DIR}
  28 + ${OPENGL_INCLUDE_DIR}
  29 + ${GLEW_INCLUDE_PATH}
  30 + ${GLUT_INCLUDE_DIR}
  31 + ${ANN_INCLUDE_DIR}
  32 + ${Boost_INCLUDE_DIR}
  33 +)
  34 +
  35 +#Assign source files to the appropriate variables
  36 +file(GLOB SRC_CPP "*.cpp")
  37 +file(GLOB SRC_H "*.h")
  38 +
  39 +#set up copying data files
  40 +configure_file(00_GT.obj ${CMAKE_CURRENT_BINARY_DIR}/00_GT.obj @ONLY)
  41 +configure_file(00_T.obj ${CMAKE_CURRENT_BINARY_DIR}/00_T.obj @ONLY)
  42 +configure_file(01_GT.obj ${CMAKE_CURRENT_BINARY_DIR}/01_GT.obj @ONLY)
  43 +configure_file(01_T.obj ${CMAKE_CURRENT_BINARY_DIR}/01_T.obj @ONLY)
  44 +configure_file(02_GT.obj ${CMAKE_CURRENT_BINARY_DIR}/02_GT.obj @ONLY)
  45 +configure_file(02_T.obj ${CMAKE_CURRENT_BINARY_DIR}/02_T.obj @ONLY)
  46 +configure_file(03_GT.obj ${CMAKE_CURRENT_BINARY_DIR}/03_GT.obj @ONLY)
  47 +configure_file(03_T.obj ${CMAKE_CURRENT_BINARY_DIR}/03_T.obj @ONLY)
  48 +configure_file(SmoothShader_Vertex.glsl ${CMAKE_CURRENT_BINARY_DIR}/SmoothShader_Vertex.glsl @ONLY)
  49 +configure_file(SmoothShader_Fragment.glsl ${CMAKE_CURRENT_BINARY_DIR}/SmoothShader_Fragment.glsl @ONLY)
  50 +configure_file(ErrorMap_Fragment.glsl ${CMAKE_CURRENT_BINARY_DIR}/ErrorMap_Fragment.glsl @ONLY)
  51 +
  52 +#create an executable
  53 +add_executable(netmets ${SRC_CPP} ${SRC_H})
  54 +
  55 +#set the link libraries
  56 +target_link_libraries(netmets ${ANN_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${GLEW_LIBRARY} ${GLUT_glut_LIBRARY})
  57 +
  58 +
  59 +
... ...
DrawingFunctions.h 0 → 100644
  1 +++ a/DrawingFunctions.h
  1 +#include "rtsFiberNetwork.h"
  2 +#include "rts/rts_glShaderProgram.h"
  3 +#include "GL/glut.h"
  4 +#include "rts/rts_glutRenderWindow.h"
  5 +#include <time.h>
  6 +
  7 +extern void ComputeNetMets();
  8 +extern rtsFiberNetwork* goldNetwork;
  9 +extern rtsFiberNetwork* testNetwork;
  10 +extern float sigmaG, sigmaC;
  11 +float network_span;
  12 +CoreGraphList coreGraph;
  13 +vector<point3D<float> > sequenceColors;
  14 +int current_sequence = 0;
  15 +
  16 +//shader variables
  17 +rts_glShaderProgram Edge_ErrorShader;
  18 +rts_glShaderProgram Node_ErrorShader;
  19 +rts_glShaderProgram Smooth_Shader;
  20 +
  21 +//display lists
  22 +GLuint GT_FibersList=0;
  23 +GLuint T_FibersList=0;
  24 +GLuint GT_EndCaps=0;
  25 +GLuint T_EndCaps=0;
  26 +GLuint GT_NodesList=0;
  27 +GLuint T_NodesList=0;
  28 +GLuint T_PathList=0;
  29 +GLuint GT_PathList=0;
  30 +
  31 +//drawing variables
  32 +int tube_subdivisions = 20;
  33 +float node_radius_factor = 0.7;
  34 +float fiber_radius_factor = 0.5;
  35 +float cull_test_case_threshold = 1.0;
  36 +
  37 +#define DISPLAY_GT_NETWORK 1
  38 +#define DISPLAY_T_NETWORK 2
  39 +#define DISPLAY_GT_GRAPH 3
  40 +#define DISPLAY_T_GRAPH 4
  41 +#define DISPLAY_GT_SELECTED 5
  42 +#define DISPLAY_T_SELECTED 6
  43 +
  44 +//menu options
  45 +#define NETCOMP_EXIT 0
  46 +#define DISPLAY_NETWORK 1
  47 +#define DISPLAY_GRAPH 2
  48 +#define DISPLAY_CONNECTED 3
  49 +#define DISPLAY_SELECTED 4
  50 +#define COLORMAP_ISOLUMINANT 5
  51 +#define COLORMAP_BLACKBODY 6
  52 +#define COLORMAP_BREWER 7
  53 +#define COLORMAP_POLAR_CIELAB 8
  54 +#define COLORMAP_RAINBOW 9
  55 +#define CULL_TEST_CASE 10
  56 +#define RECOMPUTE_METRIC 11
  57 +
  58 +
  59 +//fibers to render in Graph Mode
  60 +//list<int> T_DisplayEdges;
  61 +//list<int> GT_DisplayEdges;
  62 +
  63 +int DisplayMode = DISPLAY_NETWORK;
  64 +float L0_pos[3];
  65 +float L1_pos[3];
  66 +//GLuint texColorMap=0;
  67 +rts_glTextureMap texColorMap;
  68 +
  69 +
  70 +
  71 +
  72 +void makeColormap(int ColorMapType = COLORMAP_BREWER)
  73 +{
  74 + //if(texColorMap != 0)
  75 + // glDeleteTextures(1, &texColorMap);
  76 +
  77 + point3D<float>* ctrlPts;
  78 + int num_points = 0;
  79 + if(ColorMapType == COLORMAP_ISOLUMINANT)
  80 + {
  81 + //allocate memory for the colormap
  82 + num_points = 2;
  83 + ctrlPts = new point3D<float>[num_points];
  84 + //memset(ctrlPts, 0, num_points*sizeof(point3D<float>));
  85 +
  86 + ctrlPts[0] = point3D<float>(0.0, 1.0, 0.0);
  87 + ctrlPts[1] = point3D<float>(1.0, 0.0, 0.0);
  88 + }
  89 + else if(ColorMapType == COLORMAP_RAINBOW)
  90 + {
  91 + //allocate memory for the colormap
  92 + num_points = 5;
  93 + ctrlPts = new point3D<float>[num_points];
  94 + //memset(ctrlPts, 0, num_points*sizeof(point3D<float>));
  95 +
  96 + //ctrlPts[0] = point3D<float>(0.7, 0, 0.7);
  97 + ctrlPts[0] = point3D<float>(0, 0, 1);
  98 + ctrlPts[1] = point3D<float>(0, 0.7, 0.7);
  99 + ctrlPts[2] = point3D<float>(0, 1, 0);
  100 + ctrlPts[3] = point3D<float>(0.7, 0.7, 0);
  101 + ctrlPts[4] = point3D<float>(1, 0, 0);
  102 + }
  103 + else if(ColorMapType == COLORMAP_BLACKBODY)
  104 + {
  105 + //allocate memory for the colormap
  106 + num_points = 4;
  107 + ctrlPts = new point3D<float>[num_points];
  108 + //memset(ctrlPts, 0, num_points*sizeof(point3D<float>));
  109 +
  110 + ctrlPts[0] = point3D<float>(0.0, 0.0, 0.0);
  111 + ctrlPts[1] = point3D<float>(1.0, 0.0, 0.0);
  112 + ctrlPts[2] = point3D<float>(1.0, 1.0, 0.0);
  113 + ctrlPts[3] = point3D<float>(1.0, 1.0, 1.0);
  114 + }
  115 + else if(ColorMapType == COLORMAP_BREWER)
  116 + {
  117 + //allocate memory for the colormap
  118 + num_points = 11;
  119 + ctrlPts = new point3D<float>[num_points];
  120 + //memset(ctrlPts, 0, num_points*sizeof(point3D<float>));
  121 +
  122 + ctrlPts[0] = point3D<float>(0.192157, 0.211765, 0.584314);
  123 + ctrlPts[1] = point3D<float>(0.270588, 0.458824, 0.705882);
  124 + ctrlPts[2] = point3D<float>(0.454902, 0.678431, 0.819608);
  125 + ctrlPts[3] = point3D<float>(0.670588, 0.85098, 0.913725);
  126 + ctrlPts[4] = point3D<float>(0.878431, 0.952941, 0.972549);
  127 + ctrlPts[5] = point3D<float>(1, 1, 0.74902);
  128 + ctrlPts[6] = point3D<float>(0.996078, 0.878431, 0.564706);
  129 + ctrlPts[7] = point3D<float>(0.992157, 0.682353, 0.380392);
  130 + ctrlPts[8] = point3D<float>(0.956863, 0.427451, 0.262745);
  131 + ctrlPts[9] = point3D<float>(0.843137, 0.188235, 0.152941);
  132 + ctrlPts[10] = point3D<float>(0.647059, 0, 0.14902);
  133 +
  134 + }
  135 + else if(ColorMapType == COLORMAP_POLAR_CIELAB)
  136 + {
  137 + //allocate memory for the colormap
  138 + num_points = 33;
  139 + ctrlPts = new point3D<float>[num_points];
  140 + //memset(ctrlPts, 0, num_points*sizeof(point3D<float>));
  141 +
  142 + ctrlPts[0] = point3D<float>(0.07514311, 0.468049805,1);
  143 + ctrlPts[1] = point3D<float>(0.247872569, 0.498782363,1);
  144 + ctrlPts[2] = point3D<float>(0.339526309, 0.528909511,1);
  145 + ctrlPts[3] = point3D<float>(0.409505078, 0.558608486,1);
  146 + ctrlPts[4] = point3D<float>(0.468487184, 0.588057293,1);
  147 + ctrlPts[5] = point3D<float>(0.520796675, 0.617435078,1);
  148 + ctrlPts[6] = point3D<float>(0.568724526, 0.646924167,1);
  149 + ctrlPts[7] = point3D<float>(0.613686735, 0.676713218,1);
  150 + ctrlPts[8] = point3D<float>(0.656658579, 0.707001303,1);
  151 + ctrlPts[9] = point3D<float>(0.698372844, 0.738002964,1);
  152 + ctrlPts[10] = point3D<float>(0.739424025, 0.769954435,1);
  153 + ctrlPts[11] = point3D<float>(0.780330104, 0.803121429,1);
  154 + ctrlPts[12] = point3D<float>(0.821573924, 0.837809045,1);
  155 + ctrlPts[13] = point3D<float>(0.863634967, 0.874374691,1);
  156 + ctrlPts[14] = point3D<float>(0.907017747, 0.913245283,1);
  157 + ctrlPts[15] = point3D<float>(0.936129275, 0.938743558, 0.983038586);
  158 + ctrlPts[16] = point3D<float>(0.943467973, 0.943498599, 0.943398095);
  159 + ctrlPts[17] = point3D<float>(0.990146732, 0.928791426, 0.917447482);
  160 + ctrlPts[18] = point3D<float>(1, 0.88332677, 0.861943246);
  161 + ctrlPts[19] = point3D<float>(1, 0.833985467, 0.803839606);
  162 + ctrlPts[20] = point3D<float>(1, 0.788626485, 0.750707739);
  163 + ctrlPts[21] = point3D<float>(1, 0.746206642, 0.701389973);
  164 + ctrlPts[22] = point3D<float>(1, 0.70590052, 0.654994046);
  165 + ctrlPts[23] = point3D<float>(1, 0.667019783, 0.610806959);
  166 + ctrlPts[24] = point3D<float>(1, 0.6289553, 0.568237474);
  167 + ctrlPts[25] = point3D<float>(1, 0.591130233, 0.526775617);
  168 + ctrlPts[26] = point3D<float>(1, 0.552955184, 0.485962266);
  169 + ctrlPts[27] = point3D<float>(1, 0.513776083, 0.445364274);
  170 + ctrlPts[28] = point3D<float>(1, 0.472800903, 0.404551679);
  171 + ctrlPts[29] = point3D<float>(1, 0.428977855, 0.363073592);
  172 + ctrlPts[30] = point3D<float>(1, 0.380759558, 0.320428137);
  173 + ctrlPts[31] = point3D<float>(0.961891484, 0.313155629, 0.265499262);
  174 + ctrlPts[32] = point3D<float>(0.916482116, 0.236630659, 0.209939162);
  175 +
  176 + }
  177 +
  178 + texColorMap.Init(ctrlPts, GL_TEXTURE_1D, num_points, 0, 0, GL_RGB, GL_RGB, GL_FLOAT);
  179 +
  180 + //glGenTextures(1, &texColorMap);
  181 + //glBindTexture(GL_TEXTURE_1D, texColorMap);
  182 + //glTexImage1D(GL_TEXTURE_1D, 0, GL_RGB, num_points, 0, GL_RGB, GL_FLOAT, ctrlPts);
  183 +}
  184 +
  185 +
  186 +
  187 +point3D<float> HSLtoRGB(point3D<float> HSL)
  188 +{
  189 + float H = HSL.x;
  190 + float S = HSL.y;
  191 + float L = HSL.z;
  192 +
  193 + float temp2;
  194 + if(L < 0.5)
  195 + temp2 = L*(1.0+S);
  196 + else
  197 + temp2 = L+S - L*S;
  198 +
  199 + float temp1 = 2.0*L - temp2;
  200 +
  201 + point3D<float> temp3(H+1.0/3.0, H, H-1.0/3.0);
  202 + if(temp3.x < 0.0) temp3.x = temp3.x+1.0;
  203 + if(temp3.y < 0.0) temp3.y = temp3.y+1.0;
  204 + if(temp3.z < 0.0) temp3.z = temp3.z+1.0;
  205 +
  206 + if(temp3.x > 1.0) temp3.x = temp3.x - 1.0;
  207 + if(temp3.y > 1.0) temp3.y = temp3.y - 1.0;
  208 + if(temp3.z > 1.0) temp3.z = temp3.z - 1.0;
  209 +
  210 + point3D<float> result;
  211 + if(6.0*temp3.x < 1.0) result.x = temp1 +(temp2 - temp1)*6.0*temp3.x;
  212 + else if(2.0*temp3.x < 1.0) result.x = temp2;
  213 + else if(3.0*temp3.x < 2.0) result.x = temp1+(temp2-temp1)*((2.0/3.0) - temp3.x)*6.0;
  214 + else result.x = temp1;
  215 +
  216 + if(6.0*temp3.y < 1.0) result.y = temp1 +(temp2 - temp1)*6.0*temp3.y;
  217 + else if(2.0*temp3.y < 1.0) result.y = temp2;
  218 + else if(3.0*temp3.y < 2.0) result.y = temp1+(temp2-temp1)*((2.0/3.0) - temp3.y)*6.0;
  219 + else result.y = temp1;
  220 +
  221 + if(6.0*temp3.z < 1.0) result.z = temp1 +(temp2 - temp1)*6.0*temp3.z;
  222 + else if(2.0*temp3.z < 1.0) result.z = temp2;
  223 + else if(3.0*temp3.z < 2.0) result.z = temp1+(temp2-temp1)*((2.0/3.0) - temp3.z)*6.0;
  224 + else result.z = temp1;
  225 +
  226 + //result.a = 0.0;
  227 + return result;
  228 +}
  229 +void ColorFibers()
  230 +{
  231 + //srand(time(NULL));
  232 + sequenceColors.clear();
  233 + //for each fiber
  234 + for(CoreGraphList::iterator i = coreGraph.begin(); i!=coreGraph.end(); i++)
  235 + {
  236 + float random_hue = (double)rand()/(double)RAND_MAX;
  237 + //cout<<"Random Hue: "<<random_hue<<endl;
  238 + float random_saturation = 1.0;//(double)rand()/(double)RAND_MAX;
  239 + point3D<float> rgb = HSLtoRGB(point3D<float>(random_hue, random_saturation, 0.5));
  240 + //point3D<float> rgb((double)rand()/(double)RAND_MAX, (double)rand()/(double)RAND_MAX, (double)rand()/(double)RAND_MAX);
  241 + sequenceColors.push_back(rgb);
  242 + }
  243 +
  244 +
  245 +}
  246 +void CenterCameraToSelected()
  247 +{
  248 + if(coreGraph.size() == 0)
  249 + return;
  250 +
  251 + //center the fiber in both networks
  252 + point3D<float> min_pt(9999, 9999, 9999);
  253 + point3D<float> max_pt(-9999, -9999, -9999);
  254 +
  255 + //iterate through the first edge sequence
  256 + EdgeSequence::iterator i;
  257 + int node;
  258 + point3D<float> test;
  259 + for(i=coreGraph[current_sequence].first.begin(); i!=coreGraph[current_sequence].first.end(); i++)
  260 + {
  261 + node = testNetwork->FiberList[*i].n0;
  262 + test = testNetwork->NodeList[node].p;
  263 + min_pt.x = min(test.x, min_pt.x);
  264 + min_pt.y = min(test.y, min_pt.y);
  265 + min_pt.z = min(test.z, min_pt.z);
  266 + max_pt.x = max(test.x, max_pt.x);
  267 + max_pt.y = max(test.y, max_pt.y);
  268 + max_pt.z = max(test.z, max_pt.z);
  269 +
  270 + node = testNetwork->FiberList[*i].n1;
  271 + test = testNetwork->NodeList[node].p;
  272 + min_pt.x = min(test.x, min_pt.x);
  273 + min_pt.y = min(test.y, min_pt.y);
  274 + min_pt.z = min(test.z, min_pt.z);
  275 + max_pt.x = max(test.x, max_pt.x);
  276 + max_pt.y = max(test.y, max_pt.y);
  277 + max_pt.z = max(test.z, max_pt.z);
  278 + }
  279 + point3D<float> middle = min_pt+0.5*(max_pt - min_pt);
  280 +
  281 + rts_glut_camera.LookAt(middle);
  282 +
  283 +}
  284 +void IncrementSelectedFiber(int i)
  285 +{
  286 + //get the currently selected fiber id
  287 + if(coreGraph.size() <= 0)
  288 + return;
  289 +
  290 + //get the number of fibers
  291 + int end_id = coreGraph.size();
  292 +
  293 + current_sequence+=i;
  294 + if(current_sequence >= end_id)
  295 + current_sequence = 0;
  296 + if(current_sequence < 0)
  297 + current_sequence = coreGraph.size()-1;
  298 +
  299 + //print the selected edges
  300 + EdgeSequence::iterator EdgeI;
  301 +
  302 + for(EdgeI = coreGraph[current_sequence].first.begin(); EdgeI != coreGraph[current_sequence].first.end(); EdgeI++)
  303 + cout<<*EdgeI<<" ";
  304 + cout<<"--->";
  305 + for(EdgeI = coreGraph[current_sequence].second.begin(); EdgeI != coreGraph[current_sequence].second.end(); EdgeI++)
  306 + cout<<*EdgeI<<" ";
  307 + cout<<endl;
  308 +
  309 +
  310 + CenterCameraToSelected();
  311 +
  312 +}
  313 +void DrawNodeSphere(rtsFiberNetwork* network, int n, float radius)
  314 +{
  315 + GLUquadricObj* quadric = gluNewQuadric();
  316 + gluQuadricNormals(quadric, GLU_SMOOTH);
  317 +
  318 + glMatrixMode(GL_MODELVIEW);
  319 +
  320 + glPushMatrix();
  321 +
  322 + point3D<float> p;
  323 + //glColor3f(network->NodeList[n].error, 0.0, 0.0);
  324 + p = network->NodeList[n].p;
  325 +
  326 + glTranslatef(p.x, p.y, p.z);
  327 + //glutSolidSphere(node_radius*standard_deviation, 20, 20);
  328 + glTexCoord1f(network->NodeList[n].error);
  329 + if(network->NodeList[n].color < 0)
  330 + glColor3f(1.0, 0.0, 0.0);
  331 + else
  332 + glColor3f(1.0, 1.0, 1.0);
  333 + gluSphere(quadric,radius,32,32);
  334 +
  335 + glPopMatrix();
  336 +
  337 +}
  338 +void DrawNodeSpheres(rtsFiberNetwork* network, float radius)
  339 +{
  340 +
  341 +
  342 + unsigned int n;
  343 + for(n=0; n != network->FiberList.size(); n++)
  344 + {
  345 + if(!network->isCulled(n))
  346 + {
  347 + DrawNodeSphere(network, network->FiberList[n].n0,radius);
  348 + DrawNodeSphere(network, network->FiberList[n].n1,radius);
  349 + }
  350 + }
  351 +}
  352 +
  353 +void FrenetFrame(vector3D<float> &x, vector3D<float> &y, vector3D<float> &z)
  354 +{
  355 + x = vector3D<float>(0.0, 0.0, 1.0);
  356 + y = x.X(z);
  357 + x = z.X(y);
  358 + x.Normalize();
  359 + y.Normalize();
  360 + z.Normalize();
  361 +}
  362 +
  363 +vector3D<float> GetColor(float error)
  364 +{
  365 + //This function converts an error value to a color
  366 + //The conversion is done by creating an HSV color from the error value and converting that HSV color to RGB
  367 + float H = (240.0/60.0)*(1.0 - error);
  368 + float S = 1.0;
  369 + float V = 1.0;
  370 +
  371 + int i = floor(H);
  372 + float f = H - i;
  373 + if(i%2 == 0)
  374 + f = 1-f;
  375 + float m = V*(1 - S);
  376 + float n = V*(1-S*f);
  377 + switch(i)
  378 + {
  379 + case 0:
  380 + return vector3D<float>(V, n, m);
  381 + case 1:
  382 + return vector3D<float>(n, V, m);
  383 + case 2:
  384 + return vector3D<float>(m, V, n);
  385 + case 3:
  386 + return vector3D<float>(m, n, V);
  387 + case 4:
  388 + return vector3D<float>(n, m, V);
  389 + case 5:
  390 + return vector3D<float>(V, m, n);
  391 + default:
  392 + return vector3D<float>(0, 0, 0);
  393 + }
  394 +
  395 +}
  396 +
  397 +void DrawTube(point3D<float> p0, vector3D<float> d0, point3D<float> p1, vector3D<float> d1, float error0, float error1, float radius, int subdiv)
  398 +{
  399 +
  400 + //draw the first circle
  401 + vector3D<float> x0, y0, z0, x1, y1, z1;
  402 + z0 = d0;
  403 + FrenetFrame(x0, y0, z0);
  404 +
  405 + z1 = d1;
  406 + FrenetFrame(x1, y1, z1);
  407 +
  408 + float t_step = (2*3.14159)/subdiv;
  409 +
  410 +
  411 + float u, v;
  412 +
  413 + //get the RGB color
  414 + point3D<float> circle0, circle1;
  415 + vector3D<float> RGB0, RGB1;
  416 + vector3D<float> normal;
  417 +
  418 + //RGB0 = GetColor(color0);
  419 + //RGB1 = GetColor(color1);
  420 +
  421 + glBegin(GL_TRIANGLE_STRIP);
  422 + for(int t=0; t<=subdiv; t++)
  423 + {
  424 + u = radius * cos(t*t_step);
  425 + v = radius * sin(t*t_step);
  426 + normal = u*x0 + v*y0;
  427 + circle0 = p0 + normal;
  428 + normal.Normalize();
  429 +
  430 + glTexCoord1f(error0);
  431 + //glColor4f(error0, 0.0, 0.0, 1.0);
  432 + glNormal3f(normal.x, normal.y, normal.z);
  433 + glVertex3f(circle0.x, circle0.y, circle0.z);
  434 +
  435 + normal = u*x1 + v*y1;
  436 + circle1 = p1 + normal;
  437 + normal.Normalize();
  438 +
  439 + glTexCoord1f(error1);
  440 + //glColor4f(error1, 0.0, 0.0, 1.0);
  441 + glNormal3f(normal.x, normal.y, normal.z);
  442 + glVertex3f(circle1.x, circle1.y, circle1.z);
  443 +
  444 + }
  445 + glEnd();
  446 + CHECK_OPENGL_ERROR
  447 +}
  448 +
  449 +void ExtrudeFiber(rtsFiberNetwork* network, int fiber, float radius)
  450 +{
  451 + vector3D<float> x, y, z;
  452 + point3D<float> p0, p1, p2, p3;
  453 + vector3D<float> d1, d2;
  454 + float e1, e2;
  455 +
  456 + //get the first point
  457 + int node = network->FiberList[fiber].n0;
  458 + p1 = network->NodeList[node].p;
  459 + e1 = network->NodeList[node].error;
  460 +
  461 + //for each vertex in the fiber
  462 + int num_points = (int)network->FiberList[fiber].pointList.size();
  463 + for(int v=0; v<num_points; v++)
  464 + {
  465 + //get the next point
  466 + p2 = network->FiberList[fiber].pointList[v];
  467 + e2 = network->FiberList[fiber].errorList[v];
  468 +
  469 + if(v<num_points-1)
  470 + p3 = network->FiberList[fiber].pointList[v+1];
  471 + else
  472 + {
  473 + node = network->FiberList[fiber].n1;
  474 + p3 = network->NodeList[node].p;
  475 + }
  476 +
  477 + d2 = p3-p1;
  478 +
  479 + //compute the fiber derivatives at p1 and p2
  480 + if(v==0) //if this is the first fiber
  481 + d1 = p2 - p1;
  482 + else
  483 + {
  484 + d1 = p2 - p0;
  485 + }
  486 +
  487 + DrawTube(p1, d1, p2, d2, e1, e2, radius, tube_subdivisions);
  488 +
  489 + //shift
  490 + p0 = p1;
  491 + p1 = p2;
  492 + e1 = e2;
  493 + }
  494 + //make the last tube
  495 +
  496 + //if there were any points in the pointlist
  497 + if(num_points > 0)
  498 + {
  499 + p2 = p3;
  500 + node = network->FiberList[fiber].n1;
  501 + e2 = network->NodeList[node].error;
  502 + d1 = p2-p0;
  503 + d2 = p2-p1;
  504 + DrawTube(p1, d1, p2, d2, e1, e2, radius, tube_subdivisions);
  505 + }
  506 + //if there are only the two node points
  507 + else
  508 + {
  509 + node = network->FiberList[fiber].n1;
  510 + p2 = network->NodeList[node].p;
  511 + e2 = network->NodeList[node].error;
  512 + d1 = p2 - p1;
  513 + d2 = p2 - p1;
  514 + DrawTube(p1, d1, p2, d2, e1, e2, radius, tube_subdivisions);
  515 + }
  516 +}
  517 +
  518 +void DrawLineFiber(rtsFiberNetwork* network, int f)
  519 +{
  520 + point3D<float> p;
  521 + int node = network->FiberList[f].n0;
  522 + p = network->NodeList[node].p;
  523 +
  524 + glBegin(GL_LINE_STRIP);
  525 + glVertex3f(p.x, p.y, p.z);
  526 + for(int v=0; v!=network->FiberList[f].pointList.size(); v++)
  527 + {
  528 + p = network->FiberList[f].pointList[v];
  529 + glVertex3f(p.x, p.y, p.z);
  530 + }
  531 + node = network->FiberList[f].n1;
  532 + p = network->NodeList[node].p;
  533 + glVertex3f(p.x, p.y, p.z);
  534 + glEnd();
  535 +
  536 +}
  537 +void DrawLineNetwork(rtsFiberNetwork* network)
  538 +{
  539 +
  540 + int num_fibers = network->FiberList.size();
  541 + for(int f = 0; f < num_fibers; f++)
  542 + {
  543 + /*if(network->FiberList[f].mapped_to == -1)
  544 + glColor3f(0.0,0.0, 0.0);
  545 + else
  546 + glColor3f(1.0, 0.0, 0.0);
  547 + */
  548 + DrawLineFiber(network, f);
  549 + CHECK_OPENGL_ERROR
  550 + }
  551 +
  552 +
  553 +}
  554 +void DrawGraphNodes(rtsFiberNetwork* network)
  555 +{
  556 + //renders graph nodes, colored based on their node color
  557 + glMatrixMode(GL_MODELVIEW);
  558 +
  559 + unsigned int n;
  560 + for(n=0; n != network->NodeList.size(); n++)
  561 + {
  562 + glPushMatrix();
  563 +
  564 + point3D<float> p;
  565 + /*if(network->NodeList[n].color < 0)
  566 + glColor3f(1.0, 0.0, 0.0);
  567 + else
  568 + glColor3f(0.0, 1.0, 0.0);
  569 + */
  570 + //glColor3f(network->NodeList[n].error, 0.0, 0.0);
  571 + p = network->NodeList[n].p;
  572 +
  573 + glTranslatef(p.x, p.y, p.z);
  574 + glutSolidSphere(node_radius_factor*sigmaC, 20, 20);
  575 +
  576 + glPopMatrix();
  577 + }
  578 +}
  579 +void DrawFiberSequence(rtsFiberNetwork* network, EdgeSequence sequence, float fiber_radius, float node_radius)
  580 +{
  581 + //glClear(GL_DEPTH_BUFFER_BIT);
  582 + for(EdgeSequence::iterator i = sequence.begin(); i != sequence.end(); i++)
  583 + {
  584 + ExtrudeFiber(network, *i, fiber_radius);
  585 + glPushAttrib(GL_CURRENT_BIT);
  586 + DrawNodeSphere(network, network->FiberList[*i].n0, node_radius);
  587 + DrawNodeSphere(network, network->FiberList[*i].n1, node_radius);
  588 + glPopAttrib();
  589 + }
  590 +
  591 +
  592 +}
  593 +GLuint CreateFiberDisplayList(rtsFiberNetwork* network, float radius)
  594 +{
  595 + GLuint result = glGenLists(1);
  596 + glNewList(result, GL_COMPILE);
  597 +
  598 + int num_fibers = network->FiberList.size();
  599 + for(int f = 0; f < num_fibers; f++)
  600 + {
  601 + if(!network->isCulled(f))
  602 + {
  603 + ExtrudeFiber(network, f, radius);
  604 + CHECK_OPENGL_ERROR
  605 + }
  606 + }
  607 + glEndList();
  608 + return result;
  609 +}
  610 +
  611 +GLuint CreateNodeDisplayList(rtsFiberNetwork* network, float radius)
  612 +{
  613 + GLuint result = glGenLists(1);
  614 + glNewList(result, GL_COMPILE);
  615 + DrawNodeSpheres(network, radius);
  616 + glEndList();
  617 + return result;
  618 +}
  619 +
  620 +
  621 +void CreateFiberPathLists(float fiber_radius, float node_radius)
  622 +{
  623 + GT_PathList = glGenLists(1);
  624 + glNewList(GT_PathList, GL_COMPILE);
  625 +
  626 + if(coreGraph.size() > 0)
  627 + {
  628 + for(unsigned int i=0; i<sequenceColors.size(); i++)
  629 + {
  630 + point3D<float> rgb = sequenceColors[i];
  631 + glColor3f(rgb.x, rgb.y, rgb.z);
  632 + DrawFiberSequence(goldNetwork, coreGraph[i].second, fiber_radius, node_radius);
  633 + }
  634 + }
  635 + glEndList();
  636 +
  637 + T_PathList = glGenLists(1);
  638 + glNewList(T_PathList, GL_COMPILE);
  639 +
  640 + if(coreGraph.size() > 0)
  641 + {
  642 + for(unsigned int i=0; i<sequenceColors.size(); i++)
  643 + {
  644 + point3D<float> rgb = sequenceColors[i];
  645 + glColor3f(rgb.x, rgb.y, rgb.z);
  646 + DrawFiberSequence(testNetwork, coreGraph[i].first, fiber_radius, node_radius);
  647 + }
  648 + }
  649 + glEndList();
  650 +
  651 +}
  652 +void CreateDisplayLists()
  653 +{
  654 + if(GT_FibersList != 0)
  655 + glDeleteLists(GT_FibersList, 1);
  656 + if(T_FibersList != 0)
  657 + glDeleteLists(T_FibersList, 1);
  658 + if(GT_NodesList != 0)
  659 + glDeleteLists(GT_NodesList, 1);
  660 + if(T_NodesList != 0)
  661 + glDeleteLists(T_NodesList, 1);
  662 + if(GT_EndCaps != 0)
  663 + glDeleteLists(GT_EndCaps, 1);
  664 + if(T_EndCaps != 0)
  665 + glDeleteLists(T_EndCaps, 1);
  666 +
  667 + //create the display lists
  668 + GT_FibersList = CreateFiberDisplayList(goldNetwork, sigmaG*fiber_radius_factor);
  669 + T_FibersList = CreateFiberDisplayList(testNetwork, sigmaG*fiber_radius_factor);
  670 + GT_NodesList = CreateNodeDisplayList(goldNetwork, sigmaG*node_radius_factor);
  671 + T_NodesList = CreateNodeDisplayList(testNetwork, sigmaG*node_radius_factor);
  672 + GT_EndCaps = CreateNodeDisplayList(goldNetwork, sigmaG*fiber_radius_factor);
  673 + T_EndCaps = CreateNodeDisplayList(testNetwork, sigmaG*fiber_radius_factor);
  674 +
  675 + if(GT_PathList != 0)
  676 + glDeleteLists(GT_PathList,1);
  677 + if(T_PathList != 0)
  678 + glDeleteLists(T_PathList,1);
  679 + CreateFiberPathLists(fiber_radius_factor*sigmaG, node_radius_factor*sigmaG);
  680 +}
  681 +void RenderViewCamera()
  682 +{
  683 + glMatrixMode(GL_PROJECTION);
  684 + glLoadIdentity();
  685 + //compute the aspect ratio
  686 + float aspect_ratio = (float)glutGet(GLUT_WINDOW_WIDTH)/2.0/(float)glutGet(GLUT_WINDOW_HEIGHT);
  687 + gluPerspective(rts_glut_camera.getFOV(), aspect_ratio, network_span/10, network_span*10);
  688 +
  689 + //render the camera
  690 + glMatrixMode(GL_MODELVIEW);
  691 + glLoadIdentity();
  692 +
  693 + point3D<float> camera_position = rts_glut_camera.getPosition();
  694 + vector3D<float> camera_up = rts_glut_camera.getUp();
  695 + point3D<float> camera_lookat = rts_glut_camera.getLookAt();
  696 + gluLookAt(camera_position.x,
  697 + camera_position.y,
  698 + camera_position.z,
  699 + camera_lookat.x,
  700 + camera_lookat.y,
  701 + camera_lookat.z,
  702 + camera_up.x,
  703 + camera_up.y,
  704 + camera_up.z);
  705 +
  706 +
  707 + //get the light positions (lights move with the camera)
  708 + vector3D<float> up = rts_glut_camera.getUp();
  709 + vector3D<float> dir = rts_glut_camera.getDirection();
  710 + vector3D<float> side = dir.X(up);
  711 + L0_pos[0] = side.x;
  712 + L0_pos[1] = side.y;
  713 + L0_pos[2] = side.z;
  714 +
  715 + L1_pos[0] = -dir.x;
  716 + L1_pos[1] = -dir.y;
  717 + L1_pos[2] = -dir.z;
  718 +
  719 + //scale the viewport to the network
  720 + /*vector3D<float> span = max_point - min_point;
  721 + float scale = 1.0/span.Length();
  722 + //compute center point
  723 + point3D<float> center = min_point + 0.5*span;
  724 + glScalef(scale, scale, scale);
  725 + glTranslatef(-center.x, -center.y, -center.z);*/
  726 +
  727 +
  728 +}
  729 +void RecenterCamera()
  730 +{
  731 + point3D<float> min_point0 = goldNetwork->min_pos;
  732 + point3D<float> min_point1 = testNetwork->min_pos;
  733 +
  734 + point3D<float> max_point0 = goldNetwork->max_pos;
  735 + point3D<float> max_point1 = testNetwork->max_pos;
  736 +
  737 + point3D<float> min_point(min(min_point0.x, min_point1.x), min(min_point0.y, min_point1.y), min(min_point0.z, min_point1.z));
  738 + point3D<float> max_point(max(max_point0.x, max_point1.x), max(max_point0.y, max_point1.y), max(max_point0.z, max_point1.z));
  739 + point3D<float> center_point = min_point + 0.5*(max_point - min_point);
  740 +
  741 +
  742 + network_span = (max_point - point3D<float>(0, 0, 0)).Length();
  743 + rts_glut_camera.setPosition(0, 0, 3*network_span);
  744 + rts_glut_camera.LookAt(center_point, vector3D<float>(0.0, 1.0, 0.0));
  745 +
  746 +}
  747 +void DrawNetwork(int Display)
  748 +{
  749 + //draw the network fibers
  750 + switch(Display)
  751 + {
  752 + case DISPLAY_GT_NETWORK:
  753 + Edge_ErrorShader.UpdateGlobalUniforms();
  754 + Edge_ErrorShader.BeginProgram();
  755 + glCallList(GT_FibersList);
  756 + Edge_ErrorShader.EndProgram();
  757 +
  758 + Node_ErrorShader.UpdateGlobalUniforms();
  759 + Node_ErrorShader.BeginProgram();
  760 + glCallList(GT_EndCaps);
  761 + Node_ErrorShader.EndProgram();
  762 + break;
  763 + case DISPLAY_T_NETWORK:
  764 + Edge_ErrorShader.UpdateGlobalUniforms();
  765 + Edge_ErrorShader.BeginProgram();
  766 + glCallList(T_FibersList);
  767 + Edge_ErrorShader.EndProgram();
  768 +
  769 + Node_ErrorShader.UpdateGlobalUniforms();
  770 + Node_ErrorShader.BeginProgram();
  771 + glCallList(T_EndCaps);
  772 + Node_ErrorShader.EndProgram();
  773 + break;
  774 + case DISPLAY_GT_GRAPH:
  775 + glColor3f(1.0, 1.0, 1.0);
  776 + Smooth_Shader.UpdateGlobalUniforms();
  777 + Smooth_Shader.BeginProgram();
  778 + glCallList(GT_PathList);
  779 + glColor3f(1.0, 1.0, 1.0);
  780 + glCallList(GT_FibersList);
  781 + glCallList(GT_NodesList);
  782 + Smooth_Shader.EndProgram();
  783 + break;
  784 + case DISPLAY_T_GRAPH:
  785 + glColor3f(1.0, 1.0, 1.0);
  786 + Smooth_Shader.UpdateGlobalUniforms();
  787 + Smooth_Shader.BeginProgram();
  788 + glCallList(T_PathList);
  789 + glColor3f(1.0, 1.0, 1.0);
  790 + glCallList(T_FibersList);
  791 + glCallList(T_NodesList);
  792 + Smooth_Shader.EndProgram();
  793 + break;
  794 + case DISPLAY_GT_SELECTED:
  795 + glColor3f(1.0, 1.0, 1.0);
  796 + Smooth_Shader.UpdateGlobalUniforms();
  797 + Smooth_Shader.BeginProgram();
  798 + glCallList(GT_FibersList);
  799 + glCallList(GT_NodesList);
  800 +
  801 + glClear(GL_DEPTH_BUFFER_BIT);
  802 + glColor3f(1.0, 0.0, 1.0);
  803 + DrawFiberSequence(goldNetwork, coreGraph[current_sequence].second, fiber_radius_factor*sigmaG, node_radius_factor*sigmaG);
  804 + Smooth_Shader.EndProgram();
  805 + break;
  806 + case DISPLAY_T_SELECTED:
  807 + glColor3f(1.0, 1.0, 1.0);
  808 + Smooth_Shader.UpdateGlobalUniforms();
  809 + Smooth_Shader.BeginProgram();
  810 + glCallList(T_FibersList);
  811 + glCallList(T_NodesList);
  812 +
  813 + glClear(GL_DEPTH_BUFFER_BIT);
  814 + glColor3f(1.0, 0.0, 1.0);
  815 + DrawFiberSequence(testNetwork, coreGraph[current_sequence].first, fiber_radius_factor*sigmaG, node_radius_factor*sigmaG);
  816 + Smooth_Shader.EndProgram();
  817 + break;
  818 + default:
  819 + break;
  820 + }
  821 +
  822 +}
  823 +
  824 +
  825 +
  826 +
  827 +void MyDisplayFunction()
  828 +{
  829 + //glClearColor(0.95, 1.0, 0.95, 1.0);
  830 + glClearColor(1.0, 1.0, 1.0, 1.0);
  831 + glClear(GL_COLOR_BUFFER_BIT);
  832 + glClear(GL_DEPTH_BUFFER_BIT);
  833 +
  834 + //set left viewport
  835 + glMatrixMode(GL_PROJECTION);
  836 + glLoadIdentity();
  837 + glViewport(0, 0, glutGet(GLUT_WINDOW_WIDTH)/2, glutGet(GLUT_WINDOW_HEIGHT));
  838 +
  839 + RenderViewCamera();
  840 +
  841 +
  842 + if(DisplayMode == DISPLAY_NETWORK)
  843 + DrawNetwork(DISPLAY_GT_NETWORK);
  844 + else if(DisplayMode == DISPLAY_GRAPH)
  845 + DrawNetwork(DISPLAY_GT_GRAPH);
  846 + else if(DisplayMode == DISPLAY_SELECTED)
  847 + DrawNetwork(DISPLAY_GT_SELECTED);
  848 +
  849 + //set right viewport
  850 + glMatrixMode(GL_PROJECTION);
  851 + glLoadIdentity();
  852 + glViewport(glutGet(GLUT_WINDOW_WIDTH)/2, 0, glutGet(GLUT_WINDOW_WIDTH)/2, glutGet(GLUT_WINDOW_HEIGHT));
  853 +
  854 + RenderViewCamera();
  855 + //glClear(GL_COLOR_BUFFER_BIT);
  856 + //glClear(GL_DEPTH_BUFFER_BIT);
  857 +
  858 + if(DisplayMode == DISPLAY_NETWORK)
  859 + DrawNetwork(DISPLAY_T_NETWORK);
  860 + else if(DisplayMode == DISPLAY_GRAPH)
  861 + DrawNetwork(DISPLAY_T_GRAPH);
  862 + else if(DisplayMode == DISPLAY_SELECTED)
  863 + DrawNetwork(DISPLAY_T_SELECTED);
  864 +
  865 +
  866 +
  867 + //glutSwapBuffers();
  868 +}
  869 +
  870 +void GlutMenuCallback(int option)
  871 +{
  872 + if(option == NETCOMP_EXIT)
  873 + exit(1);
  874 + if(option >= DISPLAY_NETWORK && option <= DISPLAY_SELECTED)
  875 + DisplayMode = option;
  876 + if(option >= COLORMAP_ISOLUMINANT && option <= COLORMAP_RAINBOW)
  877 + makeColormap(option);
  878 + if(option == CULL_TEST_CASE)
  879 + {
  880 + //get the new threshold
  881 + cout<<"Enter new test case fiber threshold [0 1]: ";
  882 + float cull_value;
  883 + cin>>cull_value;
  884 + testNetwork->setCullValue(cull_value);
  885 +
  886 + //re-create the display lists
  887 + ComputeNetMets();
  888 + CreateDisplayLists();
  889 +
  890 + }
  891 + if(option == RECOMPUTE_METRIC)
  892 + {
  893 + cout<<"Please enter a sigma value: ";
  894 + cin>>sigmaG;
  895 + sigmaC = sigmaG;
  896 +
  897 + ComputeNetMets();
  898 + CreateDisplayLists();
  899 + }
  900 +
  901 +
  902 +
  903 + /*
  904 + switch(option)
  905 + {
  906 + case NETCOMP_EXIT:
  907 + exit(1);
  908 + break;
  909 + case NETCOMP_VIEW_GT:
  910 + DisplayMode = DISPLAY_GT_NETWORK;
  911 + break;
  912 + case NETCOMP_VIEW_T:
  913 + DisplayMode = DISPLAY_T_NETWORK;
  914 + break;
  915 + default:
  916 + break;
  917 + }*/
  918 +
  919 +}
0 920 \ No newline at end of file
... ...
ErrorMap_Fragment.glsl 0 → 100644
  1 +++ a/ErrorMap_Fragment.glsl
  1 +#extension GL_EXT_gpu_shader4 : enable
  2 +
  3 +varying vec3 fragment_normal;
  4 +//uniform vec3 L0_pos;
  5 +uniform vec3 L1_pos;
  6 +uniform sampler1D colorMap;
  7 +
  8 +vec4 HSLtoRGB(vec4 HSL)
  9 +{
  10 + float H = HSL.x;
  11 + float S = HSL.y;
  12 + float L = HSL.z;
  13 +
  14 + float temp2;
  15 + if(L < 0.5)
  16 + temp2 = L*(1.0+S);
  17 + else
  18 + temp2 = L+S - L*S;
  19 +
  20 + float temp1 = 2.0*L - temp2;
  21 +
  22 + vec3 temp3 = vec3(H+1.0/3.0, H, H-1.0/3.0);
  23 + if(temp3.r < 0.0) temp3.r = temp3.r+1.0;
  24 + if(temp3.g < 0.0) temp3.g = temp3.g+1.0;
  25 + if(temp3.b < 0.0) temp3.b = temp3.b+1.0;
  26 +
  27 + if(temp3.r > 1.0) temp3.r = temp3.r - 1.0;
  28 + if(temp3.g > 1.0) temp3.g = temp3.g - 1.0;
  29 + if(temp3.b > 1.0) temp3.b = temp3.b - 1.0;
  30 +
  31 + vec4 result;
  32 + if(6.0*temp3.r < 1.0) result.r = temp1 +(temp2 - temp1)*6.0*temp3.r;
  33 + else if(2.0*temp3.r < 1.0) result.r = temp2;
  34 + else if(3.0*temp3.r < 2.0) result.r = temp1+(temp2-temp1)*((2.0/3.0) - temp3.r)*6.0;
  35 + else result.r = temp1;
  36 +
  37 + if(6.0*temp3.g < 1.0) result.g = temp1 +(temp2 - temp1)*6.0*temp3.g;
  38 + else if(2.0*temp3.g < 1.0) result.g = temp2;
  39 + else if(3.0*temp3.g < 2.0) result.g = temp1+(temp2-temp1)*((2.0/3.0) - temp3.g)*6.0;
  40 + else result.g = temp1;
  41 +
  42 + if(6.0*temp3.b < 1.0) result.b = temp1 +(temp2 - temp1)*6.0*temp3.b;
  43 + else if(2.0*temp3.b < 1.0) result.b = temp2;
  44 + else if(3.0*temp3.b < 2.0) result.b = temp1+(temp2-temp1)*((2.0/3.0) - temp3.b)*6.0;
  45 + else result.b = temp1;
  46 +
  47 + result.a = 0.0;
  48 + return result;
  49 +}
  50 +
  51 +float LightIntensity()
  52 +{
  53 + //vec3 L0_pos = vec3(1.0, 0.0, 0.0);
  54 + //vec3 L1_pos = vec3(0.0, 0.0, 1.0);
  55 + //float L0 = max(dot(fragment_normal, L0_pos), 0.0);
  56 + float L1 = max(dot(fragment_normal, L1_pos), 0.0);
  57 +
  58 + //float total = L0 + L1;
  59 + //if(total > 1.0)
  60 + // total = 1.0;
  61 +
  62 + return L1;
  63 + //return 0.5;
  64 +
  65 +}
  66 +
  67 +void main(void)
  68 +{
  69 + float error = gl_TexCoord[0].x;
  70 +
  71 + float light = LightIntensity();
  72 +
  73 + gl_FragColor = texture1D(colorMap, error)*light;
  74 +}
... ...
ErrorShader_Fragment.glsl 0 → 100644
  1 +++ a/ErrorShader_Fragment.glsl
  1 +#extension GL_EXT_gpu_shader4 : enable
  2 +
  3 +varying vec3 fragment_normal;
  4 +uniform vec3 L0_pos;
  5 +uniform vec3 L1_pos;
  6 +
  7 +vec4 HSLtoRGB(vec4 HSL)
  8 +{
  9 + float H = HSL.x;
  10 + float S = HSL.y;
  11 + float L = HSL.z;
  12 +
  13 + float temp2;
  14 + if(L < 0.5)
  15 + temp2 = L*(1.0+S);
  16 + else
  17 + temp2 = L+S - L*S;
  18 +
  19 + float temp1 = 2.0*L - temp2;
  20 +
  21 + vec3 temp3 = vec3(H+1.0/3.0, H, H-1.0/3.0);
  22 + if(temp3.r < 0.0) temp3.r = temp3.r+1.0;
  23 + if(temp3.g < 0.0) temp3.g = temp3.g+1.0;
  24 + if(temp3.b < 0.0) temp3.b = temp3.b+1.0;
  25 +
  26 + if(temp3.r > 1.0) temp3.r = temp3.r - 1.0;
  27 + if(temp3.g > 1.0) temp3.g = temp3.g - 1.0;
  28 + if(temp3.b > 1.0) temp3.b = temp3.b - 1.0;
  29 +
  30 + vec4 result;
  31 + if(6.0*temp3.r < 1.0) result.r = temp1 +(temp2 - temp1)*6.0*temp3.r;
  32 + else if(2.0*temp3.r < 1.0) result.r = temp2;
  33 + else if(3.0*temp3.r < 2.0) result.r = temp1+(temp2-temp1)*((2.0/3.0) - temp3.r)*6.0;
  34 + else result.r = temp1;
  35 +
  36 + if(6.0*temp3.g < 1.0) result.g = temp1 +(temp2 - temp1)*6.0*temp3.g;
  37 + else if(2.0*temp3.g < 1.0) result.g = temp2;
  38 + else if(3.0*temp3.g < 2.0) result.g = temp1+(temp2-temp1)*((2.0/3.0) - temp3.g)*6.0;
  39 + else result.g = temp1;
  40 +
  41 + if(6.0*temp3.b < 1.0) result.b = temp1 +(temp2 - temp1)*6.0*temp3.b;
  42 + else if(2.0*temp3.b < 1.0) result.b = temp2;
  43 + else if(3.0*temp3.b < 2.0) result.b = temp1+(temp2-temp1)*((2.0/3.0) - temp3.b)*6.0;
  44 + else result.b = temp1;
  45 +
  46 + result.a = 0.0;
  47 + return result;
  48 +}
  49 +
  50 +float LightIntensity()
  51 +{
  52 + //vec3 L0_pos = vec3(1.0, 0.0, 0.0);
  53 + //vec3 L1_pos = vec3(0.0, 0.0, 1.0);
  54 + float L0 = 0.3*max(dot(fragment_normal, L0_pos), 0.0);
  55 + float L1 = 0.3*max(dot(fragment_normal, L1_pos), 0.0);
  56 +
  57 + return L0 + L1;
  58 + //return 0.5;
  59 +
  60 +}
  61 +
  62 +void main(void)
  63 +{
  64 + float error = (1.0 - gl_TexCoord[0].x)*(240.0/360.0);
  65 + float light = LightIntensity();
  66 +
  67 + //convert from HSL to RGB
  68 + vec4 HSL = vec4(error, 1.0, light, 1.0);
  69 + vec4 RGB = HSLtoRGB(HSL);
  70 +
  71 + gl_FragColor = vec4(RGB.r, RGB.g, RGB.b, 1.0);
  72 +}
0 73 \ No newline at end of file
... ...
FindANN.cmake 0 → 100644
  1 +++ a/FindANN.cmake
  1 +# - Try to find ANN
  2 +# Once done this will define
  3 +#
  4 +# ANN_FOUND - system has ANN
  5 +# ANN_INCLUDE_DIR - the ANN include directory
  6 +# ANN_LIBRARY - Link these to use ANN
  7 +#
  8 +
  9 +IF (ANN_INCLUDE_DIRS)
  10 + # Already in cache, be silent
  11 + SET(ANN_FIND_QUIETLY TRUE)
  12 +ENDIF (ANN_INCLUDE_DIRS)
  13 +
  14 +FIND_PATH( ANN_INCLUDE_DIR ANN/ANN.h
  15 + PATHS "/usr/include" "C:/libs/ANN/include")
  16 +
  17 +if( WIN32 )
  18 +
  19 + set(ANN_LIBRARY $ENV{ANN_PATH}\\ANN.lib)
  20 + set(ANN_INCLUDE_DIR $ENV{ANN_PATH})
  21 +
  22 +
  23 + # Store the library dir. May be used for linking to dll!
  24 + # GET_FILENAME_COMPONENT( ANN_LIBRARY_DIR ${ANN_LIBRARY} PATH )
  25 +
  26 + find_package_handle_standard_args(ANN DEFAULT_MSG ANN_INCLUDE_DIR)
  27 +
  28 +else (WIN32)
  29 +
  30 + FIND_LIBRARY( ANN_LIBRARY
  31 + NAMES ann ANN
  32 + PATHS /lib /usr/lib /usr/lib64 /usr/local/lib )
  33 +
  34 +endif( WIN32)
  35 +
  36 +
  37 +IF (ANN_INCLUDE_DIR AND ANN_LIBRARY)
  38 + SET(ANN_FOUND TRUE)
  39 +ELSE (ANN_INCLUDE_DIR AND ANN_LIBRARY)
  40 + SET( ANN_FOUND FALSE )
  41 +ENDIF (ANN_INCLUDE_DIR AND ANN_LIBRARY)
  42 +
... ...
FindGLEW.cmake 0 → 100644
  1 +++ a/FindGLEW.cmake
  1 +#
  2 +# Try to find GLEW library and include path.
  3 +# Once done this will define
  4 +#
  5 +# GLEW_FOUND
  6 +# GLEW_INCLUDE_PATH
  7 +# GLEW_LIBRARY
  8 +#
  9 +
  10 +IF (WIN32)
  11 + FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
  12 + $ENV{PROGRAMFILES}/GLEW/include
  13 + $ENV{GLEW_PATH}/include
  14 + DOC "The directory where GL/glew.h resides")
  15 + FIND_LIBRARY( GLEW_LIBRARY
  16 + NAMES glew GLEW glew32 glew32s
  17 + PATHS
  18 + $ENV{GLEW_PATH}/lib/Release/Win32
  19 + DOC "The GLEW library")
  20 +ELSE (WIN32)
  21 + FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
  22 + /usr/include
  23 + /usr/local/include
  24 + /sw/include
  25 + /opt/local/include
  26 + DOC "The directory where GL/glew.h resides")
  27 + FIND_LIBRARY( GLEW_LIBRARY
  28 + NAMES GLEW glew
  29 + PATHS
  30 + /usr/lib64
  31 + /usr/lib
  32 + /usr/local/lib64
  33 + /usr/local/lib
  34 + /sw/lib
  35 + /opt/local/lib
  36 + DOC "The GLEW library")
  37 +ENDIF (WIN32)
  38 +
  39 +IF (GLEW_INCLUDE_PATH)
  40 + SET( GLEW_FOUND 1 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
  41 +ELSE (GLEW_INCLUDE_PATH)
  42 + SET( GLEW_FOUND 0 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
  43 +ENDIF (GLEW_INCLUDE_PATH)
  44 +
  45 +MARK_AS_ADVANCED(
  46 + GLEW_FOUND
  47 + GLEW_INCLUDE_PATH
  48 + GLEW_LIBRARY
  49 +)
... ...
FindGLUT.cmake 0 → 100644
  1 +++ a/FindGLUT.cmake
  1 +# - Try to find ANN
  2 +# Once done this will define
  3 +#
  4 +# ANN_FOUND - system has ANN
  5 +# ANN_INCLUDE_DIR - the ANN include directory
  6 +# ANN_LIBRARY - Link these to use ANN
  7 +#
  8 +
  9 +IF (ANN_INCLUDE_DIRS)
  10 + # Already in cache, be silent
  11 + SET(ANN_FIND_QUIETLY TRUE)
  12 +ENDIF (ANN_INCLUDE_DIRS)
  13 +
  14 +FIND_PATH( ANN_INCLUDE_DIR ANN/ANN.h
  15 + PATHS "/usr/include" "C:/libs/ANN/include")
  16 +
  17 +if( WIN32 )
  18 +
  19 + set(ANN_LIBRARY $ENV{ANN_PATH}\\ANN.lib)
  20 + set(ANN_INCLUDE_DIR $ENV{ANN_PATH})
  21 +
  22 +
  23 + # Store the library dir. May be used for linking to dll!
  24 + # GET_FILENAME_COMPONENT( ANN_LIBRARY_DIR ${ANN_LIBRARY} PATH )
  25 +
  26 + find_package_handle_standard_args(ANN DEFAULT_MSG ANN_INCLUDE_DIR)
  27 +
  28 +else (WIN32)
  29 +
  30 + FIND_LIBRARY( ANN_LIBRARY
  31 + NAMES ann ANN
  32 + PATHS /lib /usr/lib /usr/lib64 /usr/local/lib )
  33 +
  34 +endif( WIN32)
  35 +
  36 +
  37 +IF (ANN_INCLUDE_DIR AND ANN_LIBRARY)
  38 + SET(ANN_FOUND TRUE)
  39 +ELSE (ANN_INCLUDE_DIR AND ANN_LIBRARY)
  40 + SET( ANN_FOUND FALSE )
  41 +ENDIF (ANN_INCLUDE_DIR AND ANN_LIBRARY)
  42 +
... ...
GroundTruth.swc 0 → 100644
  1 +++ a/GroundTruth.swc
  1 +# Original neuron tracing performed in Neuromantic
  2 +# which was programmed by Darren Myatt (d.r.myatt@reading.ac.uk)
  3 +# See homepage at http://www.rdg.ac.uk/Neuromantic
  4 +#
  5 +# NEUROMANTIC V1.6.3 (1/15/2012 5:22:06 PM): Saved to GroundTruth.swc
  6 +1 1 1342.5 1069.5 0 6 -1
  7 +2 1 1351.5 1063.5 0 6 1
  8 +3 1 1361.5 1058.5 0 6 2
  9 +4 1 1369.5 1052.5 0 4 3
  10 +5 1 1378.5 1047.5 0 3.5 4
  11 +6 1 1386.5 1041.5 0 3 5
  12 +7 1 1394.5 1034.5 0 3 6
  13 +8 1 1402.5 1027.5 0 3.5 7
  14 +9 1 1412.5 1026.5 0 4 8
  15 +10 1 1420.5 1018.5 0 4 9
  16 +11 1 1428.5 1011.5 0 4 10
  17 +12 1 1437.5 1005.5 0 4.5 11
  18 +13 1 1447.5 1001.5 0 4.5 12
  19 +14 1 1456.5 995.5 0 3 13
  20 +15 1 1465.5 990.5 0 3 14
  21 +16 1 1474.5 985.5 0 2.5 15
  22 +17 1 1482.5 979.5 0 2.5 16
  23 +18 1 1492.5 979.5 0 2.5 17
  24 +19 1 1501.5 974.5 0 2 18
  25 +20 1 1510.5 969.5 0 2 19
  26 +21 1 1520.5 969.5 0 2 20
  27 +22 1 1530.5 969.5 0 2.5 21
  28 +23 1 1538.5 962.5 0 2.5 22
  29 +24 1 1548.5 959.5 0 2.5 23
  30 +25 1 1558.5 959.5 0 2 24
  31 +26 1 1568.5 959.5 0 2 25
  32 +27 1 1578.5 958.5 0 2 26
  33 +28 1 1588.5 954.5 0 2.5 27
  34 +29 1 1598.5 952.5 0 3.5 28
  35 +30 1 1618.5 943.5 0 2 29
  36 +31 1 1628.5 941.5 0 2 30
  37 +32 1 1636.5 935.5 0 2 31
  38 +33 1 1645.5 930.5 0 2 32
  39 +34 1 1655.5 926.5 0 2 33
  40 +35 1 1665.5 922.5 0 2 34
  41 +36 1 1675.5 918.5 0 2 35
  42 +37 1 1685.5 913.5 0 2 36
  43 +38 1 1695.5 909.5 0 2 37
  44 +39 1 1705.5 907.5 0 2 38
  45 +40 1 1714.5 902.5 0 2 39
  46 +41 1 1722.5 896.5 0 2 40
  47 +42 1 1730.5 888.5 0 2 41
  48 +43 1 1735.5 878.5 0 2 42
  49 +44 1 1742.5 870.5 0 2 43
  50 +45 1 1748.5 862.5 0 2 44
  51 +46 1 1753.5 853.5 0 2 45
  52 +47 1 1761.5 845.5 0 2 46
  53 +48 1 1769.5 837.5 0 2.5 47
  54 +49 1 1777.5 829.5 0 2.5 48
  55 +50 1 1786.5 824.5 0 2.5 49
  56 +51 1 1796.5 822.5 0 2.5 50
  57 +52 1 1809.5 826.5 0 2 51
  58 +53 1 1819.5 828.5 0 2 52
  59 +54 1 1829.5 831.5 0 1.5 53
  60 +55 1 1837.5 838.5 0 1.5 54
  61 +56 1 1839.5 848.5 0 2.5 55
  62 +57 1 1749.5 882.5 0 2 42
  63 +58 1 1758.5 876.5 0 2 57
  64 +59 1 1766.5 870.5 0 2 58
  65 +60 1 1774.5 862.5 0 2.5 59
  66 +61 1 1784.5 861.5 0 2.5 60
  67 +62 1 1794.5 861.5 0 3 61
  68 +63 1 1803.5 866.5 0 2 62
  69 +64 1 1813.5 870.5 0 2 63
  70 +65 1 1608.5 957.5 0 2 28
  71 +66 1 1618.5 959.5 0 1.5 65
  72 +67 1 1628.5 960.5 0 1.5 66
  73 +68 1 1638.5 960.5 0 1.5 67
  74 +69 1 1648.5 960.5 0 2 68
  75 +70 1 1658.5 960.5 0 2.5 69
  76 +71 1 1668.5 960.5 0 2.5 70
  77 +72 1 1678.5 958.5 0 2 71
  78 +73 1 1687.5 952.5 0 2 72
  79 +74 1 1696.5 947.5 0 2 73
  80 +75 1 1706.5 944.5 0 2 74
  81 +76 1 1714.5 938.5 0 2.5 75
  82 +77 1 1723.5 933.5 0 3 76
  83 +78 1 1733.5 929.5 0 3 77
  84 +79 1 1743.5 928.5 0 2.5 78
  85 +80 1 1753.5 926.5 0 2.5 79
  86 +81 1 1763.5 923.5 0 2.5 80
  87 +82 1 1772.5 917.5 0 2.5 81
  88 +83 1 1781.5 912.5 0 2 82
  89 +84 1 1349.5 1054.5 0 4 1
  90 +85 1 1358.5 1049.5 0 4 84
  91 +86 1 1366.5 1041.5 0 3 85
  92 +87 1 1371.5 1032.5 0 3 86
  93 +88 1 1379.5 1024.5 0 3 87
  94 +89 1 1387.5 1016.5 0 2.5 88
  95 +90 1 1395.5 1008.5 0 2.5 89
  96 +91 1 1403.5 1000.5 0 2.5 90
  97 +92 1 1410.5 992.5 0 2.5 91
  98 +93 1 1417.5 984.5 0 2 92
  99 +94 1 1425.5 976.5 0 2.5 93
  100 +95 1 1433.5 968.5 0 3 94
  101 +96 1 1441.5 960.5 0 3 95
  102 +97 1 1449.5 952.5 0 3 96
  103 +98 1 1458.5 947.5 0 2.5 97
  104 +99 1 1468.5 944.5 0 1.5 98
  105 +100 1 1476.5 938.5 0 1.5 99
  106 +101 1 1486.5 934.5 0 2 100
  107 +102 1 1494.5 927.5 0 2 101
  108 +103 1 1502.5 919.5 0 2 102
  109 +104 1 1511.5 914.5 0 2 103
  110 +105 1 1519.5 908.5 0 2 104
  111 +106 1 1527.5 901.5 0 2 105
  112 +107 1 1535.5 895.5 0 2 106
  113 +108 1 1543.5 887.5 0 2.5 107
  114 +109 1 1551.5 880.5 0 2.5 108
  115 +110 1 1559.5 872.5 0 2.5 109
  116 +111 1 1566.5 864.5 0 2 110
  117 +112 1 1573.5 856.5 0 2 111
  118 +113 1 1581.5 848.5 0 2.5 112
  119 +114 1 1590.5 843.5 0 3.5 113
  120 +115 1 1459.5 931.5 0 3 97
  121 +116 1 1467.5 923.5 0 2 115
  122 +117 1 1475.5 915.5 0 2 116
  123 +118 1 1479.5 905.5 0 2 117
  124 +119 1 1485.5 897.5 0 2.5 118
  125 +120 1 1491.5 888.5 0 2.5 119
  126 +121 1 1499.5 880.5 0 2.5 120
  127 +122 1 1507.5 872.5 0 2.5 121
  128 +123 1 1515.5 864.5 0 2.5 122
  129 +124 1 1521.5 856.5 0 2 123
  130 +125 1 1527.5 847.5 0 2.5 124
  131 +126 1 1529.5 837.5 0 2.5 125
  132 +127 1 1530.5 827.5 0 2.5 126
  133 +128 1 1534.5 817.5 0 2.5 127
  134 +129 1 1538.5 807.5 0 3 128
  135 +130 1 1545.5 799.5 0 3 129
  136 +131 1 1553.5 791.5 0 2.5 130
  137 +132 1 1561.5 785.5 0 2.5 131
  138 +133 1 1571.5 781.5 0 2 132
  139 +134 1 1581.5 778.5 0 2 133
  140 +135 1 1591.5 776.5 0 2 134
  141 +136 1 1601.5 773.5 0 2 135
  142 +137 1 1611.5 769.5 0 2 136
  143 +138 1 1621.5 769.5 0 2.5 137
  144 +139 1 1635.5 762.5 0 2 138
  145 +140 1 1645.5 759.5 0 2 139
  146 +141 1 1654.5 754.5 0 2.5 140
  147 +142 1 1662.5 747.5 0 2 141
  148 +143 1 1671.5 741.5 0 2 142
  149 +144 1 1680.5 735.5 0 2 143
  150 +145 1 1688.5 728.5 0 2 144
  151 +146 1 1697.5 723.5 0 2 145
  152 +147 1 1707.5 720.5 0 2 146
  153 +148 1 1716.5 715.5 0 1.5 147
  154 +149 1 1726.5 711.5 0 2 148
  155 +150 1 1736.5 709.5 0 1.5 149
  156 +151 1 1746.5 708.5 0 2 150
  157 +152 1 1756.5 705.5 0 3 151
  158 +153 1 1765.5 700.5 0 12 152
  159 +154 1 1636.5 753.5 0 6 138
  160 +155 1 1646.5 748.5 0 5.5 154
  161 +156 1 1656.5 743.5 0 5.5 155
  162 +157 1 1666.5 736.5 0 2 156
  163 +158 1 1672.5 728.5 0 2 157
  164 +159 1 1677.5 718.5 0 2 158
  165 +160 1 1683.5 709.5 0 2 159
  166 +161 1 1689.5 701.5 0 2 160
  167 +162 1 1695.5 692.5 0 2 161
  168 +163 1 1701.5 683.5 0 1.5 162
  169 +164 1 1704.5 673.5 0 1.5 163
  170 +165 1 1708.5 663.5 0 1.5 164
  171 +166 1 1711.5 653.5 0 1.5 165
  172 +167 1 1342.5 1038.5 0 3.5 1
  173 +168 1 1339.5 1028.5 0 4 167
  174 +169 1 1339.5 1018.5 0 4 168
  175 +170 1 1339.5 1008.5 0 4 169
  176 +171 1 1339.5 998.5 0 3 170
  177 +172 1 1339.5 988.5 0 3 171
  178 +173 1 1339.5 978.5 0 2.5 172
  179 +174 1 1339.5 968.5 0 2.5 173
  180 +175 1 1319.5 1084.5 0 4 1
  181 +176 1 1310.5 1090.5 0 4 175
  182 +177 1 1302.5 1098.5 0 4 176
  183 +178 1 1294.5 1106.5 0 4 177
  184 +179 1 1286.5 1114.5 0 4 178
  185 +180 1 1278.5 1121.5 0 4 179
  186 +181 1 1270.5 1128.5 0 4.5 180
  187 +182 1 1262.5 1136.5 0 4 181
  188 +183 1 1254.5 1144.5 0 4.5 182
  189 +184 1 1246.5 1152.5 0 4.5 183
  190 +185 1 1238.5 1160.5 0 4.5 184
  191 +186 1 1231.5 1168.5 0 3.5 185
  192 +187 1 1225.5 1176.5 0 3.5 186
  193 +188 1 1221.5 1186.5 0 3.5 187
  194 +189 1 1216.5 1196.5 0 3.5 188
  195 +190 1 1210.5 1204.5 0 5 189
  196 +191 1 1202.5 1212.5 0 5 190
  197 +192 1 1197.5 1222.5 0 2.5 191
  198 +193 1 1193.5 1232.5 0 2.5 192
  199 +194 1 1188.5 1241.5 0 2.5 193
  200 +195 1 1183.5 1251.5 0 2.5 194
  201 +196 1 1177.5 1259.5 0 2.5 195
  202 +197 1 1171.5 1268.5 0 2.5 196
  203 +198 1 1165.5 1276.5 0 2.5 197
  204 +199 1 1157.5 1284.5 0 2 198
  205 +200 1 1149.5 1292.5 0 2 199
  206 +201 1 1144.5 1302.5 0 2 200
  207 +202 1 1133.5 1317.5 0 2 201
  208 +203 1 1127.5 1326.5 0 2 202
  209 +204 1 1122.5 1335.5 0 2.5 203
  210 +205 1 1118.5 1345.5 0 2.5 204
  211 +206 1 1115.5 1355.5 0 2 205
  212 +207 1 1114.5 1365.5 0 2 206
  213 +208 1 1114.5 1375.5 0 2 207
  214 +209 1 1162.5 1298.5 0 2 197
  215 +210 1 1158.5 1308.5 0 2 209
  216 +211 1 1155.5 1318.5 0 2 210
  217 +212 1 1153.5 1328.5 0 2 211
  218 +213 1 1152.5 1338.5 0 2 212
  219 +214 1 1151.5 1348.5 0 2 213
  220 +215 1 1150.5 1358.5 0 2 214
  221 +216 1 1149.5 1368.5 0 2 215
  222 +217 1 1147.5 1378.5 0 2 216
  223 +218 1 1144.5 1388.5 0 2 217
  224 +219 1 1178.5 1232.5 0 2.5 191
  225 +220 1 1172.5 1240.5 0 2.5 219
  226 +221 1 1166.5 1248.5 0 2.5 220
  227 +222 1 1159.5 1256.5 0 2.5 221
  228 +223 1 1151.5 1264.5 0 2.5 222
  229 +224 1 1142.5 1269.5 0 2.5 223
  230 +225 1 1133.5 1274.5 0 2 224
  231 +226 1 1125.5 1281.5 0 2 225
  232 +227 1 1117.5 1289.5 0 2 226
  233 +228 1 1109.5 1297.5 0 2 227
  234 +229 1 1101.5 1303.5 0 2 228
  235 +230 1 1093.5 1310.5 0 2 229
  236 +231 1 1084.5 1315.5 0 2 230
  237 +232 1 1076.5 1322.5 0 2 231
  238 +233 1 1067.5 1327.5 0 2.5 232
  239 +234 1 1059.5 1334.5 0 2.5 233
  240 +235 1 1051.5 1342.5 0 2.5 234
  241 +236 1 1043.5 1350.5 0 2 235
  242 +237 1 1037.5 1359.5 0 2.5 236
  243 +238 1 1031.5 1368.5 0 4.5 237
... ...
GroundTruthCopy.swc 0 → 100644
  1 +++ a/GroundTruthCopy.swc
  1 +# Original neuron tracing performed in Neuromantic
  2 +# which was programmed by Darren Myatt (d.r.myatt@reading.ac.uk)
  3 +# See homepage at http://www.rdg.ac.uk/Neuromantic
  4 +#
  5 +# NEUROMANTIC V1.6.3 (1/15/2012 5:22:06 PM): Saved to GroundTruth.swc
  6 +1 1 1342.5 1069.5 0 6 -1
  7 +2 1 1351.5 1063.5 0 6 1
  8 +3 1 1361.5 1058.5 0 6 2
  9 +4 1 1369.5 1052.5 0 4 3
  10 +5 1 1378.5 1047.5 0 3.5 4
  11 +6 1 1386.5 1041.5 0 3 5
  12 +7 1 1394.5 1034.5 0 3 6
  13 +8 1 1402.5 1027.5 0 3.5 7
  14 +9 1 1412.5 1026.5 0 4 8
  15 +10 1 1420.5 1018.5 0 4 9
  16 +11 1 1428.5 1011.5 0 4 10
  17 +12 1 1437.5 1005.5 0 4.5 11
  18 +13 1 1447.5 1001.5 0 4.5 12
  19 +14 1 1456.5 995.5 0 3 13
  20 +15 1 1465.5 990.5 0 3 14
  21 +16 1 1474.5 985.5 0 2.5 15
  22 +17 1 1482.5 979.5 0 2.5 16
  23 +18 1 1492.5 979.5 0 2.5 17
  24 +19 1 1501.5 974.5 0 2 18
  25 +20 1 1510.5 969.5 0 2 19
  26 +21 1 1520.5 969.5 0 2 20
  27 +22 1 1530.5 969.5 0 2.5 21
  28 +23 1 1538.5 962.5 0 2.5 22
  29 +24 1 1548.5 959.5 0 2.5 23
  30 +25 1 1558.5 959.5 0 2 24
  31 +26 1 1568.5 959.5 0 2 25
  32