@@ -76,7 +76,7 @@ float minSegLen, minFiberLen, maxFiberLen;
7676
7777// Threads variables
7878vector<thread> threads;
79- vector<unsigned long int > totICSegments;
79+ vector<unsigned long int > totICSegments;
8080vector<unsigned int > totFibers;
8181unsigned int totECVoxels = 0 ;
8282unsigned int totECSegments = 0 ;
@@ -94,7 +94,7 @@ unsigned int read_fiberTCK( FILE* fp, float fiber[3][MAX_FIB_LEN] , float* toVOX
9494
9595// ---------- Parallel fuction --------------
9696int ICSegments ( char * str_filename, int isTRK, int n_count, int nReplicas, int n_scalars, int n_properties, float * ptrToVOXMM,
97- double * ptrTDI , double * ptrBlurRho, double * ptrBlurAngle, double * ptrBlurWeights, bool * ptrBlurApplyTo, short * ptrHashTable, char * path_out,
97+ double * ptrTDI , double * ptrBlurRho, double * ptrBlurAngle, double * ptrBlurWeights, bool * ptrBlurApplyTo, short * ptrHashTable, char * path_out,
9898unsigned long long int offset, int idx, unsigned int startpos, unsigned int endpos );
9999
100100int ECSegments (float * ptrPEAKS, int Np, float vf_THR, int ECix, int ECiy, int ECiz,
@@ -148,7 +148,7 @@ int trk2dictionary(
148148 batch_size[i%p_size] += 1 ;
149149 }
150150
151-
151+
152152 // Compute the starting position
153153 // -----------------------------------------
154154 unsigned int elements = threads_count + 1 ;
@@ -172,7 +172,7 @@ int trk2dictionary(
172172 else if (strcmp (ext," .tck" )==0 ) // for .tck file
173173 isTRK = 0 ;
174174 else
175- return 0 ;
175+ return 0 ;
176176
177177
178178 // Open tractogram file and compute the offset for each thread
@@ -185,7 +185,7 @@ int trk2dictionary(
185185
186186 FILE* fpTractogram = fopen (str_filename," rb" );
187187 if (fpTractogram == NULL ) return 0 ;
188- fseek ( fpTractogram, data_offset, SEEK_SET ); // skip the header
188+ fseek ( fpTractogram, data_offset, SEEK_SET ); // skip the header
189189
190190 OffsetArr[0 ] = ftell ( fpTractogram );
191191
@@ -200,7 +200,7 @@ int trk2dictionary(
200200 f++;
201201 current = ftell ( fpTractogram );
202202 for ( int i = 1 ; i < threads_count; i++ ){
203- if ( f == Pos[i] )
203+ if ( f == Pos[i] )
204204 OffsetArr[i] = current;
205205 }
206206 }
@@ -215,7 +215,7 @@ int trk2dictionary(
215215 current = ftell ( fpTractogram );
216216
217217 for ( int i = 1 ; i < threads_count; i++ ){
218- if ( f == Pos[i] )
218+ if ( f == Pos[i] )
219219 OffsetArr[i] = current;
220220 }
221221
@@ -232,7 +232,7 @@ int trk2dictionary(
232232 // ==========================================
233233 // Parallel IC compartments
234234 // ==========================================
235-
235+
236236 std::cout << " * Exporting IC compartments:" << std::endl;
237237 // unsigned int width = 25;
238238 // PROGRESS = new ProgressBar( (unsigned int) n_count, (unsigned int) width);
@@ -244,7 +244,7 @@ int trk2dictionary(
244244 // ---- Original ------
245245 for ( int i = 0 ; i<threads_count; i++ ){
246246 threads.push_back ( thread ( ICSegments, str_filename, isTRK, n_count, nReplicas, n_scalars, n_properties, ptrToVOXMM,
247- ptrTDI[i] , ptrBlurRho, ptrBlurAngle, ptrBlurWeights, ptrBlurApplyTo, ptrHashTable, path_out, OffsetArr[i],
247+ ptrTDI[i] , ptrBlurRho, ptrBlurAngle, ptrBlurWeights, ptrBlurApplyTo, ptrHashTable, path_out, OffsetArr[i],
248248 i, Pos[i], Pos[i+1 ] ) );
249249 }
250250
@@ -410,10 +410,11 @@ int ISOcompartments(double** ptrTDI, char* path_out, int threads){
410410 OUTPUT_path = OUTPUT_path.substr (0 ,OUTPUT_path.size ()-5 );
411411 unsigned int totISOVoxels = 0 , v=0 ;
412412
413- filename = OUTPUT_path+" /dictionary_ISO_v.dict" ; FILE* pDict_ISO_v = fopen ( filename.c_str (), " wb" );
413+ filename = OUTPUT_path+" /dictionary_ISO_v.dict" ;
414+ FILE* pDict_ISO_v = fopen ( filename.c_str (), " wb" );
414415
415- int ix, iy, iz, id, atLeastOne;
416- int skip = 0 ;
416+ int ix, iy, iz, id, atLeastOne;
417+ int skip = 0 ;
417418
418419 for (iz=0 ; iz<dim.z ;iz++){
419420 for (iy=0 ; iy<dim.y ;iy++)
@@ -437,8 +438,8 @@ int ISOcompartments(double** ptrTDI, char* path_out, int threads){
437438 }
438439 skip = 0 ;
439440 v = ix + dim.x * ( iy + dim.y * iz );
440- fwrite ( &v, 4 , 1 , pDict_ISO_v );
441- totISOVoxels++;
441+ fwrite ( &v, 4 , 1 , pDict_ISO_v );
442+ totISOVoxels++;
442443 }
443444 }
444445 fclose ( pDict_ISO_v );
@@ -453,9 +454,9 @@ int ISOcompartments(double** ptrTDI, char* path_out, int threads){
453454/* Parallel Function */
454455/* *******************************************************************************************************************/
455456
456- int ICSegments ( char * str_filename, int isTRK, int n_count, int nReplicas, int n_scalars, int n_properties, float * ptrToVOXMM, double * ptrTDI, double * ptrBlurRho,
457- double * ptrBlurAngle, double * ptrBlurWeights, bool * ptrBlurApplyTo, short * ptrHashTable, char * path_out,
458- unsigned long long int offset, int idx, unsigned int startpos, unsigned int endpos )
457+ int ICSegments ( char * str_filename, int isTRK, int n_count, int nReplicas, int n_scalars, int n_properties, float * ptrToVOXMM, double * ptrTDI, double * ptrBlurRho,
458+ double * ptrBlurAngle, double * ptrBlurWeights, bool * ptrBlurApplyTo, short * ptrHashTable, char * path_out,
459+ unsigned long long int offset, int idx, unsigned int startpos, unsigned int endpos )
459460{
460461
461462 // Variables definition
@@ -474,7 +475,7 @@ unsigned long long int offset, int idx, unsigned int startpos, unsigned int endp
474475 map<segInVoxKey,float > FiberNorm;
475476 map<segInVoxKey,float >::iterator itNorm;
476477
477- segInVoxKey inVoxKey;
478+ segInVoxKey inVoxKey;
478479
479480 P.resize (nReplicas);
480481
@@ -506,8 +507,8 @@ unsigned long long int offset, int idx, unsigned int startpos, unsigned int endp
506507 int incr_old = 0 ;
507508 // Iterate over streamlines
508509
509- for (int f=startpos; f<endpos; f++)
510- {
510+ for (int f=startpos; f<endpos; f++)
511+ {
511512
512513 if ( isTRK )
513514 N = read_fiberTRK ( fpTractogram1, fiber, n_scalars, n_properties );
@@ -528,13 +529,13 @@ unsigned long long int offset, int idx, unsigned int startpos, unsigned int endp
528529 {
529530 // NB: please note inverted ordering for 'v'
530531 v = it->first .x + dim.x * ( it->first .y + dim.y * it->first .z );
531- o = it->first .o ;
532+ o = it->first .o ;
532533
533534 fwrite ( &sumFibers, 4 , 1 , pDict_IC_f );
534535 fwrite ( &v, 4 , 1 , pDict_IC_v );
535536 fwrite ( &o, 2 , 1 , pDict_IC_o );
536- fwrite ( &(it->second ), 4 , 1 , pDict_IC_len );
537-
537+ fwrite ( &(it->second ), 4 , 1 , pDict_IC_len );
538+
538539 ptrTDI[ it->first .z + dim.z * ( it->first .y + dim.y * it->first .x ) ] += it->second ;
539540
540541 inVoxKey.set ( it->first .x , it->first .y , it->first .z );
0 commit comments