From: Romulo Pinho Date: Wed, 24 Aug 2011 09:42:49 +0000 (+0200) Subject: Bug in clitkMedianTemporalDimension X-Git-Tag: v1.3.0~240^2~1 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=c6d394ddcea2f36214e7cdf7f16dd695d11b4427;p=clitk.git Bug in clitkMedianTemporalDimension - median taken was one position before or after the real median. results were actually unpredictable... - also optimized the code a bit... --- 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