From: Romulo Pinho Date: Thu, 31 Jan 2013 22:12:33 +0000 (+0100) Subject: VectorArithm: make Norm(0) = 0 X-Git-Tag: v1.4.0~249^2 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=582367441993fbd1cba684396344c5a8fcc6c015;p=clitk.git VectorArithm: make Norm(0) = 0 --- diff --git a/tools/clitkVectorArithmGenericFilter.txx b/tools/clitkVectorArithmGenericFilter.txx index 38c3b87..1f4cb72 100644 --- a/tools/clitkVectorArithmGenericFilter.txx +++ b/tools/clitkVectorArithmGenericFilter.txx @@ -431,7 +431,9 @@ void clitk::VectorArithmGenericFilter::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;