]> Creatis software - clitk.git/commitdiff
VectorArithm: make Norm(0) = 0
authorRomulo Pinho <romulo.pinho@lyon.unicancer.fr>
Thu, 31 Jan 2013 22:12:33 +0000 (23:12 +0100)
committerRomulo Pinho <romulo.pinho@lyon.unicancer.fr>
Thu, 31 Jan 2013 22:12:33 +0000 (23:12 +0100)
tools/clitkVectorArithmGenericFilter.txx

index 38c3b873291af48521be746bf45754d467b350c2..1f4cb721ea246b222c5ceb370cba283597918860 100644 (file)
@@ -431,7 +431,9 @@ void clitk::VectorArithmGenericFilter<args_info_type>::ComputeImage(Iter1 it, It
   case 12: // normalize
     while (!it.IsAtEnd()) {
       PixelType n = it.Get();
-      n.Normalize();
+      if (n.GetNorm() != 0)
+        n.Normalize();
+      
       ito.Set(n);
       ++it;
       ++ito;