]> Creatis software - clitk.git/commitdiff
clitkImageStatistics - small robustness issue
authorRomulo Pinho <pinho@lyon.fnclcc.fr>
Thu, 6 Oct 2011 15:17:35 +0000 (17:17 +0200)
committerRomulo Pinho <pinho@lyon.fnclcc.fr>
Thu, 6 Oct 2011 15:17:35 +0000 (17:17 +0200)
tools/clitkImageStatisticsGenericFilter.cxx
tools/clitkImageStatisticsGenericFilter.txx

index 90e6ecbd334b2e3856bb79699660d60147bb9900..ddfe5e0293661220055a8aabd95259273d759403 100644 (file)
@@ -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;
     }
index 9931fa0b0e048bad7fbcd59dde0d0b0ea944791d..d1b0d4c4abf845ce98e50054e8d259093523e37a 100644 (file)
@@ -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: ";