From 942ca247436b4b80fa373c9fd4b4a4890f32c367 Mon Sep 17 00:00:00 2001 From: Romulo Pinho Date: Thu, 6 Oct 2011 17:17:35 +0200 Subject: [PATCH] clitkImageStatistics - small robustness issue --- tools/clitkImageStatisticsGenericFilter.cxx | 2 +- tools/clitkImageStatisticsGenericFilter.txx | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/clitkImageStatisticsGenericFilter.cxx b/tools/clitkImageStatisticsGenericFilter.cxx index 90e6ecb..ddfe5e0 100644 --- a/tools/clitkImageStatisticsGenericFilter.cxx +++ b/tools/clitkImageStatisticsGenericFilter.cxx @@ -54,7 +54,7 @@ namespace clitk std::string PixelType; ReadImageDimensionAndPixelType(m_InputFileName, Dimension, PixelType, Components); - if (m_ArgsInfo.channel_arg != -1 && m_ArgsInfo.channel_arg >= Components) { + if (m_ArgsInfo.channel_arg < -1 || m_ArgsInfo.channel_arg >= Components) { std::cout << "Invalid image channel" << std::endl; return; } diff --git a/tools/clitkImageStatisticsGenericFilter.txx b/tools/clitkImageStatisticsGenericFilter.txx index 9931fa0..d1b0d4c 100644 --- a/tools/clitkImageStatisticsGenericFilter.txx +++ b/tools/clitkImageStatisticsGenericFilter.txx @@ -186,7 +186,6 @@ namespace clitk statisticsFilter->SetHistogramParameters(m_ArgsInfo.bins_arg, m_ArgsInfo.lower_arg, m_ArgsInfo.upper_arg); } statisticsFilter->Update(); - if (m_Verbose) std::cout<<"FINISHED!"; // Output if (m_Verbose) std::cout<<"N° of pixels: "; -- 2.47.1