]> Creatis software - clitk.git/commitdiff
Change 3 by ImageDimension
authorDavid Sarrut <david.sarrut@creatis.insa-lyon.fr>
Mon, 25 Jul 2011 07:14:37 +0000 (09:14 +0200)
committerDavid Sarrut <david.sarrut@creatis.insa-lyon.fr>
Mon, 25 Jul 2011 07:14:37 +0000 (09:14 +0200)
itk/clitkForwardWarpImageFilter.txx

index 5e1bb132d05470e9fd3c3ab69f2ec7028b431b66..e99ef0fde6b0ca08883abe75fa48832807145a7e 100644 (file)
@@ -154,6 +154,7 @@ void HelperClass1<InputImageType, OutputImageType, DeformationFieldType>::Thread
   //define some temp variables
   signed long baseIndex[ImageDimension];
   double distance[ImageDimension];
+  for(uint i=0; i<ImageDimension; i++) distance[i] = 0.0; // to avoid warning
   unsigned int dim, counter, upper;
   double overlap, totalOverlap;
   typename OutputImageType::IndexType neighIndex;
@@ -195,7 +196,7 @@ void HelperClass1<InputImageType, OutputImageType, DeformationFieldType>::Thread
         upper = counter;  // each bit indicates upper/lower neighbour
 
         // get neighbor index and overlap fraction
-        for( dim = 0; dim < 3; dim++ ) {
+        for( dim = 0; dim < ImageDimension; dim++ ) {
           if ( upper & 1 ) {
             neighIndex[dim] = baseIndex[dim] + 1;
             overlap *= distance[dim];