]> Creatis software - clitk.git/commitdiff
Modified padding for empire
authorsrit <srit>
Thu, 16 Sep 2010 10:45:45 +0000 (10:45 +0000)
committersrit <srit>
Thu, 16 Sep 2010 10:45:45 +0000 (10:45 +0000)
segmentation/clitkMotionMaskGenericFilter.txx

index d2de0d4dd8543d13312da958d6912443d1f4162c..0edf047f368778f2e62a5002ce5ed5c020f3e44b 100755 (executable)
@@ -107,10 +107,13 @@ MotionMaskGenericFilter::GetAirImage(typename itk::Image<PixelType, Dimension>::
       typename InternalImageType::IndexType index;
       while(!it.IsAtEnd()) {
         index=it.GetIndex();
+
+        //Pad borders of all dimensions but 2 (cranio-caudal)
         for (unsigned int i=0; i<Dimension; i++){
-          if(index[2]!=0 &&
-             (index[i]==air->GetLargestPossibleRegion().GetIndex()[i]
-              || index[i]==(unsigned int)air->GetLargestPossibleRegion().GetIndex()[i]+ (unsigned int) air->GetLargestPossibleRegion().GetSize()[i]-1))
+          if(i==2)
+            continue;
+          if(index[i]==air->GetLargestPossibleRegion().GetIndex()[i]
+              || index[i]==(unsigned int)air->GetLargestPossibleRegion().GetIndex()[i]+ (unsigned int) air->GetLargestPossibleRegion().GetSize()[i]-1)
             it.Set(1);
         }
         ++it;
@@ -139,10 +142,13 @@ MotionMaskGenericFilter::GetAirImage(typename itk::Image<PixelType, Dimension>::
       typename InternalImageType::IndexType index;
       while(!it.IsAtEnd()) {
         index=it.GetIndex();
+
+        //Pad borders of all dimensions but 2 (cranio-caudal)
         for (unsigned int i=0; i<Dimension; i++){
-          if(index[2]!=0 &&
-             (index[i]==air->GetLargestPossibleRegion().GetIndex()[i]
-              || index[i]==(unsigned int)air->GetLargestPossibleRegion().GetIndex()[i]+ (unsigned int) air->GetLargestPossibleRegion().GetSize()[i]-1))
+          if(i==2)
+            continue;
+          if(index[i]==air->GetLargestPossibleRegion().GetIndex()[i]
+              || index[i]==(unsigned int)air->GetLargestPossibleRegion().GetIndex()[i]+ (unsigned int) air->GetLargestPossibleRegion().GetSize()[i]-1)
             it.Set(binarizeFilter->GetInsideValue());
         }
         ++it;