From c6d394ddcea2f36214e7cdf7f16dd695d11b4427 Mon Sep 17 00:00:00 2001 From: Romulo Pinho Date: Wed, 24 Aug 2011 11:42:49 +0200 Subject: [PATCH] Bug in clitkMedianTemporalDimension - median taken was one position before or after the real median. results were actually unpredictable... - also optimized the code a bit... --- ...tkMedianTemporalDimensionGenericFilter.txx | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/tools/clitkMedianTemporalDimensionGenericFilter.txx b/tools/clitkMedianTemporalDimensionGenericFilter.txx index 253b493..f23e277 100644 --- a/tools/clitkMedianTemporalDimensionGenericFilter.txx +++ b/tools/clitkMedianTemporalDimensionGenericFilter.txx @@ -184,22 +184,23 @@ namespace clitk // Take the median double value; + typename InputImageType::IndexValueType temporal_dimension = size4D[Dimension-1]; + std::vector temp(temporal_dimension); while (!(iterators[0]).IsAtEnd()) { value=0.; - std::vector temp; - for (unsigned int i=0; i