Commit da89bce94257ccbd1a92dc7051517ec404f6f6b2

Authored by Jiaming Guo
1 parent 62d95dcd

fixed splitting bugs

stim/biomodels/centerline.h
@@ -149,7 +149,7 @@ public: @@ -149,7 +149,7 @@ public:
149 //if the index is not an end point 149 //if the index is not an end point
150 else{ 150 else{
151 151
152 - unsigned int N1 = idx; //calculate the size of both fibers 152 + unsigned int N1 = idx + 1; //calculate the size of both fibers
153 unsigned int N2 = N - idx; 153 unsigned int N2 = N - idx;
154 154
155 fl.resize(2); //set the array size to 2 155 fl.resize(2); //set the array size to 2
stim/visualization/cylinder.h
@@ -233,7 +233,7 @@ public: @@ -233,7 +233,7 @@ public:
233 unsigned i = 0; 233 unsigned i = 0;
234 C[0] = LL[0]; 234 C[0] = LL[0];
235 //C[0].R.resize(idx); 235 //C[0].R.resize(idx);
236 - for (; i < idx; i++) { 236 + for (; i < idx + 1; i++) {
237 //for(unsigned d = 0; d < 3; d++) 237 //for(unsigned d = 0; d < 3; d++)
238 //C[0][i][d] = LL[0].c[i][d]; 238 //C[0][i][d] = LL[0].c[i][d];
239 C[0].R[i] = R[i]; 239 C[0].R[i] = R[i];
@@ -241,6 +241,7 @@ public: @@ -241,6 +241,7 @@ public:
241 } 241 }
242 if (C.size() == 2) { 242 if (C.size() == 2) {
243 C[1] = LL[1]; 243 C[1] = LL[1];
  244 + i--;
244 //C[1].M.resize(N - idx); 245 //C[1].M.resize(N - idx);
245 for (; i < N; i++) { 246 for (; i < N; i++) {
246 //for(unsigned d = 0; d < 3; d++) 247 //for(unsigned d = 0; d < 3; d++)
stim/visualization/swc.h
@@ -96,7 +96,7 @@ namespace stim { @@ -96,7 +96,7 @@ namespace stim {
96 96
97 // if the file is invalid, throw an error 97 // if the file is invalid, throw an error
98 if (!infile) { 98 if (!infile) {
99 - std::cerr << "STUN::SWC Error loading file" << filename << std::endl; 99 + std::cerr << "STIM::SWC Error loading file" << filename << std::endl;
100 exit(-1); 100 exit(-1);
101 } 101 }
102 102
@@ -138,7 +138,7 @@ namespace stim { @@ -138,7 +138,7 @@ namespace stim {
138 138
139 // if the file is invalid, throw an error 139 // if the file is invalid, throw an error
140 if (!infile) { 140 if (!infile) {
141 - std::cerr << "STUN::SWC Error loading file" << filename << std::endl; 141 + std::cerr << "STIM::SWC Error loading file" << filename << std::endl;
142 exit(1); 142 exit(1);
143 } 143 }
144 144