From 582367441993fbd1cba684396344c5a8fcc6c015 Mon Sep 17 00:00:00 2001 From: Romulo Pinho Date: Thu, 31 Jan 2013 23:12:33 +0100 Subject: [PATCH] VectorArithm: make Norm(0) = 0 --- tools/clitkVectorArithmGenericFilter.txx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.47.1