X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tools%2FclitkImageStatisticsGenericFilter.cxx;h=3d9bea5041106e5d2e6afdd40f5636fcdb29757e;hb=543b72e23ad001ac2a7743b9beacf48e2d0054ac;hp=90e6ecbd334b2e3856bb79699660d60147bb9900;hpb=d8d3febb5b610a76d682c7ae9bb5d9b5bf090178;p=clitk.git diff --git a/tools/clitkImageStatisticsGenericFilter.cxx b/tools/clitkImageStatisticsGenericFilter.cxx index 90e6ecb..3d9bea5 100644 --- a/tools/clitkImageStatisticsGenericFilter.cxx +++ b/tools/clitkImageStatisticsGenericFilter.cxx @@ -1,7 +1,7 @@ /*========================================================================= Program: vv http://www.creatis.insa-lyon.fr/rio/vv - Authors belong to: + Authors belong to: - University of LYON http://www.universite-lyon.fr/ - Léon Bérard cancer center http://www.centreleonberard.fr - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr @@ -18,18 +18,8 @@ #ifndef clitkImageStatisticsGenericFilter_cxx #define clitkImageStatisticsGenericFilter_cxx -/* ================================================= - * @file clitkImageStatisticsGenericFilter.cxx - * @author - * @date - * - * @brief - * - ===================================================*/ - #include "clitkImageStatisticsGenericFilter.h" - namespace clitk { @@ -42,6 +32,7 @@ namespace clitk m_Verbose=false; m_InputFileName=""; } + //----------------------------------------------------------- //----------------------------------------------------------- @@ -53,12 +44,12 @@ namespace clitk int Dimension, Components; 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; } - + if (m_ArgsInfo.mask_given) { int maskDimension, maskComponents; std::string maskPixelType; @@ -69,17 +60,17 @@ namespace clitk } } - + // Call UpdateWithDim if (Dimension==2) { switch (Components) { - case 1: + case 1: UpdateWithDim<2,1>(PixelType); break; - case 2: + case 2: UpdateWithDim<2,2>(PixelType); break; - case 3: + case 3: UpdateWithDim<2,3>(PixelType); break; default: @@ -89,13 +80,13 @@ namespace clitk } else if (Dimension==3) { switch (Components) { - case 1: + case 1: UpdateWithDim<3,1>(PixelType); break; - case 2: + case 2: UpdateWithDim<3,2>(PixelType); break; - case 3: + case 3: UpdateWithDim<3,3>(PixelType); break; default: @@ -105,13 +96,13 @@ namespace clitk } else if (Dimension==4) { switch (Components) { - case 1: + case 1: UpdateWithDim<4,1>(PixelType); break; - case 2: + case 2: UpdateWithDim<4,2>(PixelType); break; - case 3: + case 3: UpdateWithDim<4,3>(PixelType); break; default: