]> Creatis software - clitk.git/blobdiff - tools/clitkImageStatisticsGenericFilter.cxx
Merge branch 'master' of git.creatis.insa-lyon.fr:clitk
[clitk.git] / tools / clitkImageStatisticsGenericFilter.cxx
index 90e6ecbd334b2e3856bb79699660d60147bb9900..931e1bfe7c12b8002cc2e18eeb5ba5181fb044e8 100644 (file)
 #ifndef clitkImageStatisticsGenericFilter_cxx
 #define clitkImageStatisticsGenericFilter_cxx
 
-/* =================================================
- * @file   clitkImageStatisticsGenericFilter.cxx
- * @author 
- * @date   
- * 
- * @brief 
- * 
- ===================================================*/
-
 #include "clitkImageStatisticsGenericFilter.h"
 
-
 namespace clitk
 {
 
@@ -42,7 +32,8 @@ namespace clitk
     m_Verbose=false;
     m_InputFileName="";
   }
-
+  //-----------------------------------------------------------
+  
 
   //-----------------------------------------------------------
   // Update
@@ -54,7 +45,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;
     }