From: Romulo Pinho Date: Fri, 25 May 2012 13:20:02 +0000 (+0200) Subject: kept only the "most relevant" vector conversions X-Git-Tag: v1.3.0~31 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=b66c2eca0715f12fd1fc861234f4e784272ef79d;p=clitk.git kept only the "most relevant" vector conversions --- diff --git a/common/clitkImageToImageGenericFilterBase.cxx b/common/clitkImageToImageGenericFilterBase.cxx index 18d9118..9db15b0 100644 --- a/common/clitkImageToImageGenericFilterBase.cxx +++ b/common/clitkImageToImageGenericFilterBase.cxx @@ -306,6 +306,7 @@ DEF_SetNextOutput_And_GetInput(int, 3); DEF_SetNextOutput_And_GetInput(float, 3); DEF_SetNextOutput_And_GetInput(double, 3); +/* DEF_SetNextOutput_And_GetInput_WithCompo(unsigned char, 2, 2); DEF_SetNextOutput_And_GetInput_WithCompo(unsigned char, 2, 3); DEF_SetNextOutput_And_GetInput_WithCompo(unsigned char, 2, 4); @@ -355,6 +356,7 @@ DEF_SetNextOutput_And_GetInput_WithCompo(int, 3, 4); DEF_SetNextOutput_And_GetInput_WithCompo(int, 4, 2); DEF_SetNextOutput_And_GetInput_WithCompo(int, 4, 3); DEF_SetNextOutput_And_GetInput_WithCompo(int, 4, 4); +*/ DEF_SetNextOutput_And_GetInput_WithCompo(float, 2, 2); DEF_SetNextOutput_And_GetInput_WithCompo(float, 2, 3); diff --git a/tools/clitkImageConvertGenericFilter.cxx b/tools/clitkImageConvertGenericFilter.cxx index b36ba04..e8d8efb 100644 --- a/tools/clitkImageConvertGenericFilter.cxx +++ b/tools/clitkImageConvertGenericFilter.cxx @@ -19,18 +19,16 @@ #define CLITKIMAGECONVERTGENERICFILTER_CXX #include "clitkImageConvertGenericFilter.h" -// itk include -#include "itkCastImageFilter.h" -#include "itkVectorCastImageFilter.h" //-------------------------------------------------------------------- clitk::ImageConvertGenericFilter::ImageConvertGenericFilter(): clitk::ImageToImageGenericFilter("ImageConvert") { mOutputPixelTypeName = "NotSpecified"; - mWarningOccur = false; - mWarning = ""; mDisplayWarning = true; + mWarning = ""; + mWarningOccur = false; + InitializeImageType<2>(); InitializeImageType<3>(); InitializeImageType<4>(); @@ -43,20 +41,10 @@ template void clitk::ImageConvertGenericFilter::InitializeImageType() { ADD_DEFAULT_IMAGE_TYPES(Dim); - ADD_VEC_IMAGE_TYPE(Dim, 2, char) - ADD_VEC_IMAGE_TYPE(Dim, 3, char) - ADD_VEC_IMAGE_TYPE(Dim, 2, unsigned char) - ADD_VEC_IMAGE_TYPE(Dim, 3, unsigned char) - ADD_VEC_IMAGE_TYPE(Dim, 2, short) - ADD_VEC_IMAGE_TYPE(Dim, 3, short) - ADD_VEC_IMAGE_TYPE(Dim, 2, unsigned short) - ADD_VEC_IMAGE_TYPE(Dim, 3, unsigned short) - ADD_VEC_IMAGE_TYPE(Dim, 2, int) - ADD_VEC_IMAGE_TYPE(Dim, 3, int) - ADD_VEC_IMAGE_TYPE(Dim, 2, float) - ADD_VEC_IMAGE_TYPE(Dim, 3, float) - ADD_VEC_IMAGE_TYPE(Dim, 2, double) - ADD_VEC_IMAGE_TYPE(Dim, 3, double) + ADD_VEC_IMAGE_TYPE(Dim, 2, float); + ADD_VEC_IMAGE_TYPE(Dim, 3, float); + ADD_VEC_IMAGE_TYPE(Dim, 2, double); + ADD_VEC_IMAGE_TYPE(Dim, 3, double); } //-------------------------------------------------------------------- @@ -65,7 +53,6 @@ void clitk::ImageConvertGenericFilter::InitializeImageType() template void clitk::ImageConvertGenericFilter::UpdateWithInputImageType() { - // Verbose stuff if (m_IOVerbose) { if (m_InputFilenames.size() == 1) { @@ -83,471 +70,58 @@ void clitk::ImageConvertGenericFilter::UpdateWithInputImageType() } } - if ((m_PixelTypeName == mOutputPixelTypeName) || (mOutputPixelTypeName == "NotSpecified")) { - // typename InputImageType::Pointer input = clitk::readImage(m_InputFilenames); typename InputImageType::Pointer input = this->template GetInput(0); - //clitk::writeImage(input, mOutputFilename, m_IOVerbose); this->SetNextOutput(input); } else { -#define TRY_TYPE(TYPE) \ - if (IsSameType(mOutputPixelTypeName)) { UpdateWithOutputType(); return; } - TRY_TYPE(char); - // TRY_TYPE(signed char); - TRY_TYPE(uchar); - TRY_TYPE(short); - TRY_TYPE(ushort); - TRY_TYPE(int); // no uint ... - TRY_TYPE(float); - TRY_TYPE(double); -#undef TRY_TYPE - - IsSameType("char"); - - std::string list = CreateListOfTypes(); - std::cerr << "Error, I don't know the output type '" << mOutputPixelTypeName << " (input = " << m_PixelTypeName << ")" - << "'. " << std::endl << "Known types are " << list << "." << std::endl; - exit(0); - } -} -//==================================================================== - -//==================================================================== -template -void clitk::ImageConvertGenericFilter::UpdateWithOutputType() -{ - // Read - typename InputImageType::Pointer input =this->template GetInput(0); - - // Typedef - typedef typename InputImageType::PixelType PixelType; - - // Warning - std::ostringstream osstream; - if (std::numeric_limits::is_signed) { - if (!std::numeric_limits::is_signed) { - osstream << "Warning, input type is signed (" << m_PixelTypeName << ") while output type is not (" - << mOutputPixelTypeName << "), use at your own responsability." << std::endl; - mWarningOccur = true; - } - } - if (!std::numeric_limits::is_integer) { - if (std::numeric_limits::is_integer) { - osstream << "Warning, input type is not integer (" << m_PixelTypeName << ") while output type is (" - << mOutputPixelTypeName << "), use at your own responsability." << std::endl; - mWarningOccur = true; - } - } - // DD(std::numeric_limits::digits10); - // DD(std::numeric_limits::digits10); - if (!std::numeric_limits::is_integer) { - if (std::numeric_limits::is_integer) { - osstream << "Warning, input type is not integer (" << m_PixelTypeName << ") while output type is (" - << mOutputPixelTypeName << "), use at your own responsability." << std::endl; - mWarningOccur = true; - } - } - if (std::numeric_limits::digits10 > std::numeric_limits::digits10) { - osstream << "Warning, possible loss of precision : input type is (" << m_PixelTypeName << ") while output type is (" - << mOutputPixelTypeName << "), use at your own responsability." << std::endl; - mWarningOccur = true; - } - - mWarning = osstream.str(); - if (mDisplayWarning) { - std::cerr << mWarning; + // "trick" to call independent versions of update according to the + // pixel type (vector or scalar), using partial specializations + if (!UpdateWithSelectiveOutputType::IS_VECTOR>::Run(*this, mOutputPixelTypeName)) + exit(-1); } - - // Cast - typedef itk::Image OutputImageType; - typedef itk::CastImageFilter FilterType; - typename FilterType::Pointer filter = FilterType::New(); - filter->SetInput(input); - filter->Update(); - - // Write - SetNextOutput(filter->GetOutput()); - //clitk::writeImage(filter->GetOutput(), mOutputFilename, m_IOVerbose); } //==================================================================== -// Vector specializations (RP: do we need so many?) - -#define VEC_UPDATE_IMPL(TYPE_IN, COMP, DIM, TYPE_OUT) \ - template<> \ - void clitk::ImageConvertGenericFilter::UpdateWithOutputType, DIM>, TYPE_OUT>() \ - { \ - UpdateWithOutputVectorType, DIM>, TYPE_OUT>(); \ - } - -VEC_UPDATE_IMPL(char, 2, 2, unsigned char); -VEC_UPDATE_IMPL(char, 2, 3, unsigned char); -VEC_UPDATE_IMPL(char, 2, 4, unsigned char); -VEC_UPDATE_IMPL(char, 2, 2, char); -VEC_UPDATE_IMPL(char, 2, 3, char); -VEC_UPDATE_IMPL(char, 2, 4, char); -VEC_UPDATE_IMPL(char, 2, 2, unsigned short); -VEC_UPDATE_IMPL(char, 2, 3, unsigned short); -VEC_UPDATE_IMPL(char, 2, 4, unsigned short); -VEC_UPDATE_IMPL(char, 2, 2, short); -VEC_UPDATE_IMPL(char, 2, 3, short); -VEC_UPDATE_IMPL(char, 2, 4, short); -VEC_UPDATE_IMPL(char, 2, 2, int); -VEC_UPDATE_IMPL(char, 2, 3, int); -VEC_UPDATE_IMPL(char, 2, 4, int); -VEC_UPDATE_IMPL(char, 2, 2, float); -VEC_UPDATE_IMPL(char, 2, 3, float); -VEC_UPDATE_IMPL(char, 2, 4, float); -VEC_UPDATE_IMPL(char, 2, 2, double); -VEC_UPDATE_IMPL(char, 2, 3, double); -VEC_UPDATE_IMPL(char, 2, 4, double); - -VEC_UPDATE_IMPL(char, 3, 2, unsigned char); -VEC_UPDATE_IMPL(char, 3, 3, unsigned char); -VEC_UPDATE_IMPL(char, 3, 4, unsigned char); -VEC_UPDATE_IMPL(char, 3, 2, char); -VEC_UPDATE_IMPL(char, 3, 3, char); -VEC_UPDATE_IMPL(char, 3, 4, char); -VEC_UPDATE_IMPL(char, 3, 2, unsigned short); -VEC_UPDATE_IMPL(char, 3, 3, unsigned short); -VEC_UPDATE_IMPL(char, 3, 4, unsigned short); -VEC_UPDATE_IMPL(char, 3, 2, short); -VEC_UPDATE_IMPL(char, 3, 3, short); -VEC_UPDATE_IMPL(char, 3, 4, short); -VEC_UPDATE_IMPL(char, 3, 2, int); -VEC_UPDATE_IMPL(char, 3, 3, int); -VEC_UPDATE_IMPL(char, 3, 4, int); -VEC_UPDATE_IMPL(char, 3, 2, float); -VEC_UPDATE_IMPL(char, 3, 3, float); -VEC_UPDATE_IMPL(char, 3, 4, float); -VEC_UPDATE_IMPL(char, 3, 2, double); -VEC_UPDATE_IMPL(char, 3, 3, double); -VEC_UPDATE_IMPL(char, 3, 4, double); - -VEC_UPDATE_IMPL(unsigned char, 2, 2, unsigned char); -VEC_UPDATE_IMPL(unsigned char, 2, 3, unsigned char); -VEC_UPDATE_IMPL(unsigned char, 2, 4, unsigned char); -VEC_UPDATE_IMPL(unsigned char, 2, 2, char); -VEC_UPDATE_IMPL(unsigned char, 2, 3, char); -VEC_UPDATE_IMPL(unsigned char, 2, 4, char); -VEC_UPDATE_IMPL(unsigned char, 2, 2, unsigned short); -VEC_UPDATE_IMPL(unsigned char, 2, 3, unsigned short); -VEC_UPDATE_IMPL(unsigned char, 2, 4, unsigned short); -VEC_UPDATE_IMPL(unsigned char, 2, 2, short); -VEC_UPDATE_IMPL(unsigned char, 2, 3, short); -VEC_UPDATE_IMPL(unsigned char, 2, 4, short); -VEC_UPDATE_IMPL(unsigned char, 2, 2, int); -VEC_UPDATE_IMPL(unsigned char, 2, 3, int); -VEC_UPDATE_IMPL(unsigned char, 2, 4, int); -VEC_UPDATE_IMPL(unsigned char, 2, 2, float); -VEC_UPDATE_IMPL(unsigned char, 2, 3, float); -VEC_UPDATE_IMPL(unsigned char, 2, 4, float); -VEC_UPDATE_IMPL(unsigned char, 2, 2, double); -VEC_UPDATE_IMPL(unsigned char, 2, 3, double); -VEC_UPDATE_IMPL(unsigned char, 2, 4, double); - -VEC_UPDATE_IMPL(unsigned char, 3, 2, unsigned char); -VEC_UPDATE_IMPL(unsigned char, 3, 3, unsigned char); -VEC_UPDATE_IMPL(unsigned char, 3, 4, unsigned char); -VEC_UPDATE_IMPL(unsigned char, 3, 2, char); -VEC_UPDATE_IMPL(unsigned char, 3, 3, char); -VEC_UPDATE_IMPL(unsigned char, 3, 4, char); -VEC_UPDATE_IMPL(unsigned char, 3, 2, unsigned short); -VEC_UPDATE_IMPL(unsigned char, 3, 3, unsigned short); -VEC_UPDATE_IMPL(unsigned char, 3, 4, unsigned short); -VEC_UPDATE_IMPL(unsigned char, 3, 2, short); -VEC_UPDATE_IMPL(unsigned char, 3, 3, short); -VEC_UPDATE_IMPL(unsigned char, 3, 4, short); -VEC_UPDATE_IMPL(unsigned char, 3, 2, int); -VEC_UPDATE_IMPL(unsigned char, 3, 3, int); -VEC_UPDATE_IMPL(unsigned char, 3, 4, int); -VEC_UPDATE_IMPL(unsigned char, 3, 2, float); -VEC_UPDATE_IMPL(unsigned char, 3, 3, float); -VEC_UPDATE_IMPL(unsigned char, 3, 4, float); -VEC_UPDATE_IMPL(unsigned char, 3, 2, double); -VEC_UPDATE_IMPL(unsigned char, 3, 3, double); -VEC_UPDATE_IMPL(unsigned char, 3, 4, double); - -VEC_UPDATE_IMPL(short, 2, 2, unsigned char); -VEC_UPDATE_IMPL(short, 2, 3, unsigned char); -VEC_UPDATE_IMPL(short, 2, 4, unsigned char); -VEC_UPDATE_IMPL(short, 2, 2, char); -VEC_UPDATE_IMPL(short, 2, 3, char); -VEC_UPDATE_IMPL(short, 2, 4, char); -VEC_UPDATE_IMPL(short, 2, 2, unsigned short); -VEC_UPDATE_IMPL(short, 2, 3, unsigned short); -VEC_UPDATE_IMPL(short, 2, 4, unsigned short); -VEC_UPDATE_IMPL(short, 2, 2, short); -VEC_UPDATE_IMPL(short, 2, 3, short); -VEC_UPDATE_IMPL(short, 2, 4, short); -VEC_UPDATE_IMPL(short, 2, 2, int); -VEC_UPDATE_IMPL(short, 2, 3, int); -VEC_UPDATE_IMPL(short, 2, 4, int); -VEC_UPDATE_IMPL(short, 2, 2, float); -VEC_UPDATE_IMPL(short, 2, 3, float); -VEC_UPDATE_IMPL(short, 2, 4, float); -VEC_UPDATE_IMPL(short, 2, 2, double); -VEC_UPDATE_IMPL(short, 2, 3, double); -VEC_UPDATE_IMPL(short, 2, 4, double); - -VEC_UPDATE_IMPL(short, 3, 2, unsigned char); -VEC_UPDATE_IMPL(short, 3, 3, unsigned char); -VEC_UPDATE_IMPL(short, 3, 4, unsigned char); -VEC_UPDATE_IMPL(short, 3, 2, char); -VEC_UPDATE_IMPL(short, 3, 3, char); -VEC_UPDATE_IMPL(short, 3, 4, char); -VEC_UPDATE_IMPL(short, 3, 2, unsigned short); -VEC_UPDATE_IMPL(short, 3, 3, unsigned short); -VEC_UPDATE_IMPL(short, 3, 4, unsigned short); -VEC_UPDATE_IMPL(short, 3, 2, short); -VEC_UPDATE_IMPL(short, 3, 3, short); -VEC_UPDATE_IMPL(short, 3, 4, short); -VEC_UPDATE_IMPL(short, 3, 2, int); -VEC_UPDATE_IMPL(short, 3, 3, int); -VEC_UPDATE_IMPL(short, 3, 4, int); -VEC_UPDATE_IMPL(short, 3, 2, float); -VEC_UPDATE_IMPL(short, 3, 3, float); -VEC_UPDATE_IMPL(short, 3, 4, float); -VEC_UPDATE_IMPL(short, 3, 2, double); -VEC_UPDATE_IMPL(short, 3, 3, double); -VEC_UPDATE_IMPL(short, 3, 4, double); - -VEC_UPDATE_IMPL(unsigned short, 2, 2, unsigned char); -VEC_UPDATE_IMPL(unsigned short, 2, 3, unsigned char); -VEC_UPDATE_IMPL(unsigned short, 2, 4, unsigned char); -VEC_UPDATE_IMPL(unsigned short, 2, 2, char); -VEC_UPDATE_IMPL(unsigned short, 2, 3, char); -VEC_UPDATE_IMPL(unsigned short, 2, 4, char); -VEC_UPDATE_IMPL(unsigned short, 2, 2, unsigned short); -VEC_UPDATE_IMPL(unsigned short, 2, 3, unsigned short); -VEC_UPDATE_IMPL(unsigned short, 2, 4, unsigned short); -VEC_UPDATE_IMPL(unsigned short, 2, 2, short); -VEC_UPDATE_IMPL(unsigned short, 2, 3, short); -VEC_UPDATE_IMPL(unsigned short, 2, 4, short); -VEC_UPDATE_IMPL(unsigned short, 2, 2, int); -VEC_UPDATE_IMPL(unsigned short, 2, 3, int); -VEC_UPDATE_IMPL(unsigned short, 2, 4, int); -VEC_UPDATE_IMPL(unsigned short, 2, 2, float); -VEC_UPDATE_IMPL(unsigned short, 2, 3, float); -VEC_UPDATE_IMPL(unsigned short, 2, 4, float); -VEC_UPDATE_IMPL(unsigned short, 2, 2, double); -VEC_UPDATE_IMPL(unsigned short, 2, 3, double); -VEC_UPDATE_IMPL(unsigned short, 2, 4, double); - -VEC_UPDATE_IMPL(unsigned short, 3, 2, unsigned char); -VEC_UPDATE_IMPL(unsigned short, 3, 3, unsigned char); -VEC_UPDATE_IMPL(unsigned short, 3, 4, unsigned char); -VEC_UPDATE_IMPL(unsigned short, 3, 2, char); -VEC_UPDATE_IMPL(unsigned short, 3, 3, char); -VEC_UPDATE_IMPL(unsigned short, 3, 4, char); -VEC_UPDATE_IMPL(unsigned short, 3, 2, unsigned short); -VEC_UPDATE_IMPL(unsigned short, 3, 3, unsigned short); -VEC_UPDATE_IMPL(unsigned short, 3, 4, unsigned short); -VEC_UPDATE_IMPL(unsigned short, 3, 2, short); -VEC_UPDATE_IMPL(unsigned short, 3, 3, short); -VEC_UPDATE_IMPL(unsigned short, 3, 4, short); -VEC_UPDATE_IMPL(unsigned short, 3, 2, int); -VEC_UPDATE_IMPL(unsigned short, 3, 3, int); -VEC_UPDATE_IMPL(unsigned short, 3, 4, int); -VEC_UPDATE_IMPL(unsigned short, 3, 2, float); -VEC_UPDATE_IMPL(unsigned short, 3, 3, float); -VEC_UPDATE_IMPL(unsigned short, 3, 4, float); -VEC_UPDATE_IMPL(unsigned short, 3, 2, double); -VEC_UPDATE_IMPL(unsigned short, 3, 3, double); -VEC_UPDATE_IMPL(unsigned short, 3, 4, double); - -VEC_UPDATE_IMPL(int, 2, 2, unsigned char); -VEC_UPDATE_IMPL(int, 2, 3, unsigned char); -VEC_UPDATE_IMPL(int, 2, 4, unsigned char); -VEC_UPDATE_IMPL(int, 2, 2, char); -VEC_UPDATE_IMPL(int, 2, 3, char); -VEC_UPDATE_IMPL(int, 2, 4, char); -VEC_UPDATE_IMPL(int, 2, 2, unsigned short); -VEC_UPDATE_IMPL(int, 2, 3, unsigned short); -VEC_UPDATE_IMPL(int, 2, 4, unsigned short); -VEC_UPDATE_IMPL(int, 2, 2, short); -VEC_UPDATE_IMPL(int, 2, 3, short); -VEC_UPDATE_IMPL(int, 2, 4, short); -VEC_UPDATE_IMPL(int, 2, 2, int); -VEC_UPDATE_IMPL(int, 2, 3, int); -VEC_UPDATE_IMPL(int, 2, 4, int); -VEC_UPDATE_IMPL(int, 2, 2, float); -VEC_UPDATE_IMPL(int, 2, 3, float); -VEC_UPDATE_IMPL(int, 2, 4, float); -VEC_UPDATE_IMPL(int, 2, 2, double); -VEC_UPDATE_IMPL(int, 2, 3, double); -VEC_UPDATE_IMPL(int, 2, 4, double); - -VEC_UPDATE_IMPL(int, 3, 2, unsigned char); -VEC_UPDATE_IMPL(int, 3, 3, unsigned char); -VEC_UPDATE_IMPL(int, 3, 4, unsigned char); -VEC_UPDATE_IMPL(int, 3, 2, char); -VEC_UPDATE_IMPL(int, 3, 3, char); -VEC_UPDATE_IMPL(int, 3, 4, char); -VEC_UPDATE_IMPL(int, 3, 2, unsigned short); -VEC_UPDATE_IMPL(int, 3, 3, unsigned short); -VEC_UPDATE_IMPL(int, 3, 4, unsigned short); -VEC_UPDATE_IMPL(int, 3, 2, short); -VEC_UPDATE_IMPL(int, 3, 3, short); -VEC_UPDATE_IMPL(int, 3, 4, short); -VEC_UPDATE_IMPL(int, 3, 2, int); -VEC_UPDATE_IMPL(int, 3, 3, int); -VEC_UPDATE_IMPL(int, 3, 4, int); -VEC_UPDATE_IMPL(int, 3, 2, float); -VEC_UPDATE_IMPL(int, 3, 3, float); -VEC_UPDATE_IMPL(int, 3, 4, float); -VEC_UPDATE_IMPL(int, 3, 2, double); -VEC_UPDATE_IMPL(int, 3, 3, double); -VEC_UPDATE_IMPL(int, 3, 4, double); - -VEC_UPDATE_IMPL(float, 2, 2, unsigned char); -VEC_UPDATE_IMPL(float, 2, 3, unsigned char); -VEC_UPDATE_IMPL(float, 2, 4, unsigned char); -VEC_UPDATE_IMPL(float, 2, 2, char); -VEC_UPDATE_IMPL(float, 2, 3, char); -VEC_UPDATE_IMPL(float, 2, 4, char); -VEC_UPDATE_IMPL(float, 2, 2, unsigned short); -VEC_UPDATE_IMPL(float, 2, 3, unsigned short); -VEC_UPDATE_IMPL(float, 2, 4, unsigned short); -VEC_UPDATE_IMPL(float, 2, 2, short); -VEC_UPDATE_IMPL(float, 2, 3, short); -VEC_UPDATE_IMPL(float, 2, 4, short); -VEC_UPDATE_IMPL(float, 2, 2, int); -VEC_UPDATE_IMPL(float, 2, 3, int); -VEC_UPDATE_IMPL(float, 2, 4, int); -VEC_UPDATE_IMPL(float, 2, 2, float); -VEC_UPDATE_IMPL(float, 2, 3, float); -VEC_UPDATE_IMPL(float, 2, 4, float); -VEC_UPDATE_IMPL(float, 2, 2, double); -VEC_UPDATE_IMPL(float, 2, 3, double); -VEC_UPDATE_IMPL(float, 2, 4, double); - -VEC_UPDATE_IMPL(float, 3, 2, unsigned char); -VEC_UPDATE_IMPL(float, 3, 3, unsigned char); -VEC_UPDATE_IMPL(float, 3, 4, unsigned char); -VEC_UPDATE_IMPL(float, 3, 2, char); -VEC_UPDATE_IMPL(float, 3, 3, char); -VEC_UPDATE_IMPL(float, 3, 4, char); -VEC_UPDATE_IMPL(float, 3, 2, unsigned short); -VEC_UPDATE_IMPL(float, 3, 3, unsigned short); -VEC_UPDATE_IMPL(float, 3, 4, unsigned short); -VEC_UPDATE_IMPL(float, 3, 2, short); -VEC_UPDATE_IMPL(float, 3, 3, short); -VEC_UPDATE_IMPL(float, 3, 4, short); -VEC_UPDATE_IMPL(float, 3, 2, int); -VEC_UPDATE_IMPL(float, 3, 3, int); -VEC_UPDATE_IMPL(float, 3, 4, int); -VEC_UPDATE_IMPL(float, 3, 2, float); -VEC_UPDATE_IMPL(float, 3, 3, float); -VEC_UPDATE_IMPL(float, 3, 4, float); -VEC_UPDATE_IMPL(float, 3, 2, double); -VEC_UPDATE_IMPL(float, 3, 3, double); -VEC_UPDATE_IMPL(float, 3, 4, double); - - -VEC_UPDATE_IMPL(double, 2, 2, unsigned char); -VEC_UPDATE_IMPL(double, 2, 3, unsigned char); -VEC_UPDATE_IMPL(double, 2, 4, unsigned char); -VEC_UPDATE_IMPL(double, 2, 2, char); -VEC_UPDATE_IMPL(double, 2, 3, char); -VEC_UPDATE_IMPL(double, 2, 4, char); -VEC_UPDATE_IMPL(double, 2, 2, unsigned short); -VEC_UPDATE_IMPL(double, 2, 3, unsigned short); -VEC_UPDATE_IMPL(double, 2, 4, unsigned short); -VEC_UPDATE_IMPL(double, 2, 2, short); -VEC_UPDATE_IMPL(double, 2, 3, short); -VEC_UPDATE_IMPL(double, 2, 4, short); -VEC_UPDATE_IMPL(double, 2, 2, int); -VEC_UPDATE_IMPL(double, 2, 3, int); -VEC_UPDATE_IMPL(double, 2, 4, int); -VEC_UPDATE_IMPL(double, 2, 2, float); -VEC_UPDATE_IMPL(double, 2, 3, float); -VEC_UPDATE_IMPL(double, 2, 4, float); -VEC_UPDATE_IMPL(double, 2, 2, double); -VEC_UPDATE_IMPL(double, 2, 3, double); -VEC_UPDATE_IMPL(double, 2, 4, double); - -VEC_UPDATE_IMPL(double, 3, 2, unsigned char); -VEC_UPDATE_IMPL(double, 3, 3, unsigned char); -VEC_UPDATE_IMPL(double, 3, 4, unsigned char); -VEC_UPDATE_IMPL(double, 3, 2, char); -VEC_UPDATE_IMPL(double, 3, 3, char); -VEC_UPDATE_IMPL(double, 3, 4, char); -VEC_UPDATE_IMPL(double, 3, 2, unsigned short); -VEC_UPDATE_IMPL(double, 3, 3, unsigned short); -VEC_UPDATE_IMPL(double, 3, 4, unsigned short); -VEC_UPDATE_IMPL(double, 3, 2, short); -VEC_UPDATE_IMPL(double, 3, 3, short); -VEC_UPDATE_IMPL(double, 3, 4, short); -VEC_UPDATE_IMPL(double, 3, 2, int); -VEC_UPDATE_IMPL(double, 3, 3, int); -VEC_UPDATE_IMPL(double, 3, 4, int); -VEC_UPDATE_IMPL(double, 3, 2, float); -VEC_UPDATE_IMPL(double, 3, 3, float); -VEC_UPDATE_IMPL(double, 3, 4, float); -VEC_UPDATE_IMPL(double, 3, 2, double); -VEC_UPDATE_IMPL(double, 3, 3, double); -VEC_UPDATE_IMPL(double, 3, 4, double); //==================================================================== -//==================================================================== -template -void clitk::ImageConvertGenericFilter::UpdateWithOutputVectorType() +template +void clitk::ImageConvertGenericFilter::CheckTypes( + std::string inType, std::string outType +) { - // Read - typename InputImageType::Pointer input =this->template GetInput(0); - - // Typedef - typedef typename InputImageType::PixelType::ValueType PixelType; - - // Warning std::ostringstream osstream; if (std::numeric_limits::is_signed) { if (!std::numeric_limits::is_signed) { - osstream << "Warning, input type is signed (" << m_PixelTypeName << ") while output type is not (" - << mOutputPixelTypeName << "), use at your own responsability." << std::endl; - mWarningOccur = true; + osstream << "Warning, input type is signed ("; } } if (!std::numeric_limits::is_integer) { if (std::numeric_limits::is_integer) { - osstream << "Warning, input type is not integer (" << m_PixelTypeName << ") while output type is (" - << mOutputPixelTypeName << "), use at your own responsability." << std::endl; - mWarningOccur = true; + osstream << "Warning, input type is not integer ("; } } // DD(std::numeric_limits::digits10); // DD(std::numeric_limits::digits10); if (!std::numeric_limits::is_integer) { if (std::numeric_limits::is_integer) { - osstream << "Warning, input type is not integer (" << m_PixelTypeName << ") while output type is (" - << mOutputPixelTypeName << "), use at your own responsability." << std::endl; - mWarningOccur = true; + osstream << "Warning, input type is not integer ("; } } if (std::numeric_limits::digits10 > std::numeric_limits::digits10) { - osstream << "Warning, possible loss of precision : input type is (" << m_PixelTypeName << ") while output type is (" - << mOutputPixelTypeName << "), use at your own responsability." << std::endl; - mWarningOccur = true; + osstream << "Warning, possible loss of precision : input type is (" ; } - mWarning = osstream.str(); - if (mDisplayWarning) { - std::cerr << mWarning; + if (!osstream.str().empty()) + { + mWarningOccur = true; + osstream << inType << ") while output type is (" << outType << "), use at your own responsability." << std::endl; + mWarning = osstream.str(); + if (mDisplayWarning) { + std::cerr << mWarning; + } } - - // Cast - typedef itk::Image, InputImageType::ImageDimension> OutputImageType; - typedef itk::VectorCastImageFilter FilterType; - typename FilterType::Pointer filter = FilterType::New(); - filter->SetInput(input); - filter->Update(); - - // Write - SetNextOutput(filter->GetOutput()); - //clitk::writeImage(filter->GetOutput(), mOutputFilename, m_IOVerbose); } -//==================================================================== + #endif /* end #define CLITKIMAGECONVERTGENERICFILTER_CXX */ diff --git a/tools/clitkImageConvertGenericFilter.h b/tools/clitkImageConvertGenericFilter.h index 71ef2c9..2071714 100644 --- a/tools/clitkImageConvertGenericFilter.h +++ b/tools/clitkImageConvertGenericFilter.h @@ -30,9 +30,30 @@ // clitk include #include "clitkImageToImageGenericFilter.h" +// itk include +#include "itkCastImageFilter.h" +#include "itkVectorCastImageFilter.h" + namespace clitk { + template + class ImageConvertTraits + { + public: + enum { IS_VECTOR = false }; + ImageConvertTraits() { + TPixel p = "SCALAR"; + } + }; + + template < class TPixel, unsigned int Comp > + class ImageConvertTraits< itk::Vector > + { + public: + enum { IS_VECTOR = true }; + }; + class ImageConvertGenericFilter: public clitk::ImageToImageGenericFilter { @@ -49,6 +70,8 @@ namespace clitk { itkNewMacro(Self); // Members functions + std::string GetInputPixelTypeName() { return m_PixelTypeName; } + std::string GetOutputPixelTypeName() { return mOutputPixelTypeName; } void SetOutputPixelType(std::string p) { mOutputPixelTypeName = p; } bool IsWarningOccur() { return mWarningOccur; } std::string & GetWarning() { return mWarning; } @@ -59,329 +82,137 @@ namespace clitk { template void UpdateWithInputImageType(); + template + void CheckTypes(std::string inType, std::string outType); + protected: + template void InitializeImageType(); std::string mOutputPixelTypeName; std::string mWarning; bool mWarningOccur; bool mDisplayWarning; - template void UpdateWithOutputType(); - template void UpdateWithOutputVectorType(); - + private: + template + class UpdateWithSelectiveOutputType + { + public: + static bool Run(ImageConvertGenericFilter& filter, std::string outputPixelType) + { + if (IsSameType(outputPixelType)) + UpdateWithOutputType(filter); + else if (IsSameType(outputPixelType)) + UpdateWithOutputType(filter); + else if (IsSameType(outputPixelType)) + UpdateWithOutputType(filter); + else if (IsSameType(outputPixelType)) + UpdateWithOutputType(filter); + else if (IsSameType(outputPixelType)) + UpdateWithOutputType(filter); + else if (IsSameType(outputPixelType)) + UpdateWithOutputType(filter); + else if (IsSameType(outputPixelType)) + UpdateWithOutputType(filter); + else + { + std::string list = CreateListOfTypes(); + std::cerr << "Error, I don't know the vector output type '" << outputPixelType + << "'. " << std::endl << "Known types are " << list << "." << std::endl; + return false; + } + + return true; + } + + private: + + template + static void UpdateWithOutputType(ImageConvertGenericFilter& filter) + { + // Read + typename InputImageType::Pointer input =filter.template GetInput(0); + + // Typedef + typedef typename InputImageType::PixelType PixelType; + + // Warning + filter.CheckTypes(filter.GetInputPixelTypeName(), filter.GetOutputPixelTypeName()); + + // Cast + typedef itk::Image OutputImageType; + typedef itk::CastImageFilter FilterType; + typename FilterType::Pointer cast_filter = FilterType::New(); + cast_filter->SetInput(input); + cast_filter->Update(); + + // Write + filter.SetNextOutput(cast_filter->GetOutput()); + } + }; + + template + class UpdateWithSelectiveOutputType + { + public: + static bool Run(ImageConvertGenericFilter& filter, std::string outputPixelType) + { + /* + // RP: future conversions? + if (IsSameType(outputPixelType)) + UpdateWithOutputVectorType(); + else if (IsSameType(outputPixelType)) + UpdateWithOutputVectorType(); + else if (IsSameType(outputPixelType)) + UpdateWithOutputVectorType(); + else if (IsSameType(outputPixelType)) + UpdateWithOutputVectorType(); + else if (IsSameType(outputPixelType)) + UpdateWithOutputVectorType(); + else + */ + if (IsSameType(outputPixelType)) + UpdateWithOutputVectorType(filter); + else if (IsSameType(outputPixelType)) + UpdateWithOutputVectorType(filter); + else + { + std::string list = CreateListOfTypes(); + std::cerr << "Error, I don't know the vector output type '" << outputPixelType + << "'. " << std::endl << "Known types are " << list << "." << std::endl; + return false; + } + + return true; + } + + private: + + template + static void UpdateWithOutputVectorType(ImageConvertGenericFilter& filter) + { + // Read + typename InputImageType::Pointer input =filter.template GetInput(0); + + // Typedef + typedef typename InputImageType::PixelType::ValueType PixelType; + + // Warning + filter.CheckTypes(filter.GetInputPixelTypeName(), filter.GetOutputPixelTypeName()); + + // Cast + typedef itk::Image, InputImageType::ImageDimension> OutputImageType; + typedef itk::VectorCastImageFilter FilterType; + typename FilterType::Pointer cast_filter = FilterType::New(); + cast_filter->SetInput(input); + cast_filter->Update(); + + // Write + filter.SetNextOutput(cast_filter->GetOutput()); + } + }; }; // end class ImageConvertGenericFilter -#define VEC_UPDATE_DECL(TYPE_IN, COMP, DIM, TYPE_OUT) \ - template<> void ImageConvertGenericFilter::UpdateWithOutputType, DIM>, TYPE_OUT>() - -VEC_UPDATE_DECL(char, 2, 2, unsigned char); -VEC_UPDATE_DECL(char, 2, 3, unsigned char); -VEC_UPDATE_DECL(char, 2, 4, unsigned char); -VEC_UPDATE_DECL(char, 2, 2, char); -VEC_UPDATE_DECL(char, 2, 3, char); -VEC_UPDATE_DECL(char, 2, 4, char); -VEC_UPDATE_DECL(char, 2, 2, unsigned short); -VEC_UPDATE_DECL(char, 2, 3, unsigned short); -VEC_UPDATE_DECL(char, 2, 4, unsigned short); -VEC_UPDATE_DECL(char, 2, 2, short); -VEC_UPDATE_DECL(char, 2, 3, short); -VEC_UPDATE_DECL(char, 2, 4, short); -VEC_UPDATE_DECL(char, 2, 2, int); -VEC_UPDATE_DECL(char, 2, 3, int); -VEC_UPDATE_DECL(char, 2, 4, int); -VEC_UPDATE_DECL(char, 2, 2, float); -VEC_UPDATE_DECL(char, 2, 3, float); -VEC_UPDATE_DECL(char, 2, 4, float); -VEC_UPDATE_DECL(char, 2, 2, double); -VEC_UPDATE_DECL(char, 2, 3, double); -VEC_UPDATE_DECL(char, 2, 4, double); - -VEC_UPDATE_DECL(char, 3, 2, unsigned char); -VEC_UPDATE_DECL(char, 3, 3, unsigned char); -VEC_UPDATE_DECL(char, 3, 4, unsigned char); -VEC_UPDATE_DECL(char, 3, 2, char); -VEC_UPDATE_DECL(char, 3, 3, char); -VEC_UPDATE_DECL(char, 3, 4, char); -VEC_UPDATE_DECL(char, 3, 2, unsigned short); -VEC_UPDATE_DECL(char, 3, 3, unsigned short); -VEC_UPDATE_DECL(char, 3, 4, unsigned short); -VEC_UPDATE_DECL(char, 3, 2, short); -VEC_UPDATE_DECL(char, 3, 3, short); -VEC_UPDATE_DECL(char, 3, 4, short); -VEC_UPDATE_DECL(char, 3, 2, int); -VEC_UPDATE_DECL(char, 3, 3, int); -VEC_UPDATE_DECL(char, 3, 4, int); -VEC_UPDATE_DECL(char, 3, 2, float); -VEC_UPDATE_DECL(char, 3, 3, float); -VEC_UPDATE_DECL(char, 3, 4, float); -VEC_UPDATE_DECL(char, 3, 2, double); -VEC_UPDATE_DECL(char, 3, 3, double); -VEC_UPDATE_DECL(char, 3, 4, double); - -VEC_UPDATE_DECL(unsigned char, 2, 2, unsigned char); -VEC_UPDATE_DECL(unsigned char, 2, 3, unsigned char); -VEC_UPDATE_DECL(unsigned char, 2, 4, unsigned char); -VEC_UPDATE_DECL(unsigned char, 2, 2, char); -VEC_UPDATE_DECL(unsigned char, 2, 3, char); -VEC_UPDATE_DECL(unsigned char, 2, 4, char); -VEC_UPDATE_DECL(unsigned char, 2, 2, unsigned short); -VEC_UPDATE_DECL(unsigned char, 2, 3, unsigned short); -VEC_UPDATE_DECL(unsigned char, 2, 4, unsigned short); -VEC_UPDATE_DECL(unsigned char, 2, 2, short); -VEC_UPDATE_DECL(unsigned char, 2, 3, short); -VEC_UPDATE_DECL(unsigned char, 2, 4, short); -VEC_UPDATE_DECL(unsigned char, 2, 2, int); -VEC_UPDATE_DECL(unsigned char, 2, 3, int); -VEC_UPDATE_DECL(unsigned char, 2, 4, int); -VEC_UPDATE_DECL(unsigned char, 2, 2, float); -VEC_UPDATE_DECL(unsigned char, 2, 3, float); -VEC_UPDATE_DECL(unsigned char, 2, 4, float); -VEC_UPDATE_DECL(unsigned char, 2, 2, double); -VEC_UPDATE_DECL(unsigned char, 2, 3, double); -VEC_UPDATE_DECL(unsigned char, 2, 4, double); - -VEC_UPDATE_DECL(unsigned char, 3, 2, unsigned char); -VEC_UPDATE_DECL(unsigned char, 3, 3, unsigned char); -VEC_UPDATE_DECL(unsigned char, 3, 4, unsigned char); -VEC_UPDATE_DECL(unsigned char, 3, 2, char); -VEC_UPDATE_DECL(unsigned char, 3, 3, char); -VEC_UPDATE_DECL(unsigned char, 3, 4, char); -VEC_UPDATE_DECL(unsigned char, 3, 2, unsigned short); -VEC_UPDATE_DECL(unsigned char, 3, 3, unsigned short); -VEC_UPDATE_DECL(unsigned char, 3, 4, unsigned short); -VEC_UPDATE_DECL(unsigned char, 3, 2, short); -VEC_UPDATE_DECL(unsigned char, 3, 3, short); -VEC_UPDATE_DECL(unsigned char, 3, 4, short); -VEC_UPDATE_DECL(unsigned char, 3, 2, int); -VEC_UPDATE_DECL(unsigned char, 3, 3, int); -VEC_UPDATE_DECL(unsigned char, 3, 4, int); -VEC_UPDATE_DECL(unsigned char, 3, 2, float); -VEC_UPDATE_DECL(unsigned char, 3, 3, float); -VEC_UPDATE_DECL(unsigned char, 3, 4, float); -VEC_UPDATE_DECL(unsigned char, 3, 2, double); -VEC_UPDATE_DECL(unsigned char, 3, 3, double); -VEC_UPDATE_DECL(unsigned char, 3, 4, double); - -VEC_UPDATE_DECL(short, 2, 2, unsigned char); -VEC_UPDATE_DECL(short, 2, 3, unsigned char); -VEC_UPDATE_DECL(short, 2, 4, unsigned char); -VEC_UPDATE_DECL(short, 2, 2, char); -VEC_UPDATE_DECL(short, 2, 3, char); -VEC_UPDATE_DECL(short, 2, 4, char); -VEC_UPDATE_DECL(short, 2, 2, unsigned short); -VEC_UPDATE_DECL(short, 2, 3, unsigned short); -VEC_UPDATE_DECL(short, 2, 4, unsigned short); -VEC_UPDATE_DECL(short, 2, 2, short); -VEC_UPDATE_DECL(short, 2, 3, short); -VEC_UPDATE_DECL(short, 2, 4, short); -VEC_UPDATE_DECL(short, 2, 2, int); -VEC_UPDATE_DECL(short, 2, 3, int); -VEC_UPDATE_DECL(short, 2, 4, int); -VEC_UPDATE_DECL(short, 2, 2, float); -VEC_UPDATE_DECL(short, 2, 3, float); -VEC_UPDATE_DECL(short, 2, 4, float); -VEC_UPDATE_DECL(short, 2, 2, double); -VEC_UPDATE_DECL(short, 2, 3, double); -VEC_UPDATE_DECL(short, 2, 4, double); - -VEC_UPDATE_DECL(short, 3, 2, unsigned char); -VEC_UPDATE_DECL(short, 3, 3, unsigned char); -VEC_UPDATE_DECL(short, 3, 4, unsigned char); -VEC_UPDATE_DECL(short, 3, 2, char); -VEC_UPDATE_DECL(short, 3, 3, char); -VEC_UPDATE_DECL(short, 3, 4, char); -VEC_UPDATE_DECL(short, 3, 2, unsigned short); -VEC_UPDATE_DECL(short, 3, 3, unsigned short); -VEC_UPDATE_DECL(short, 3, 4, unsigned short); -VEC_UPDATE_DECL(short, 3, 2, short); -VEC_UPDATE_DECL(short, 3, 3, short); -VEC_UPDATE_DECL(short, 3, 4, short); -VEC_UPDATE_DECL(short, 3, 2, int); -VEC_UPDATE_DECL(short, 3, 3, int); -VEC_UPDATE_DECL(short, 3, 4, int); -VEC_UPDATE_DECL(short, 3, 2, float); -VEC_UPDATE_DECL(short, 3, 3, float); -VEC_UPDATE_DECL(short, 3, 4, float); -VEC_UPDATE_DECL(short, 3, 2, double); -VEC_UPDATE_DECL(short, 3, 3, double); -VEC_UPDATE_DECL(short, 3, 4, double); - -VEC_UPDATE_DECL(unsigned short, 2, 2, unsigned char); -VEC_UPDATE_DECL(unsigned short, 2, 3, unsigned char); -VEC_UPDATE_DECL(unsigned short, 2, 4, unsigned char); -VEC_UPDATE_DECL(unsigned short, 2, 2, char); -VEC_UPDATE_DECL(unsigned short, 2, 3, char); -VEC_UPDATE_DECL(unsigned short, 2, 4, char); -VEC_UPDATE_DECL(unsigned short, 2, 2, unsigned short); -VEC_UPDATE_DECL(unsigned short, 2, 3, unsigned short); -VEC_UPDATE_DECL(unsigned short, 2, 4, unsigned short); -VEC_UPDATE_DECL(unsigned short, 2, 2, short); -VEC_UPDATE_DECL(unsigned short, 2, 3, short); -VEC_UPDATE_DECL(unsigned short, 2, 4, short); -VEC_UPDATE_DECL(unsigned short, 2, 2, int); -VEC_UPDATE_DECL(unsigned short, 2, 3, int); -VEC_UPDATE_DECL(unsigned short, 2, 4, int); -VEC_UPDATE_DECL(unsigned short, 2, 2, float); -VEC_UPDATE_DECL(unsigned short, 2, 3, float); -VEC_UPDATE_DECL(unsigned short, 2, 4, float); -VEC_UPDATE_DECL(unsigned short, 2, 2, double); -VEC_UPDATE_DECL(unsigned short, 2, 3, double); -VEC_UPDATE_DECL(unsigned short, 2, 4, double); - -VEC_UPDATE_DECL(unsigned short, 3, 2, unsigned char); -VEC_UPDATE_DECL(unsigned short, 3, 3, unsigned char); -VEC_UPDATE_DECL(unsigned short, 3, 4, unsigned char); -VEC_UPDATE_DECL(unsigned short, 3, 2, char); -VEC_UPDATE_DECL(unsigned short, 3, 3, char); -VEC_UPDATE_DECL(unsigned short, 3, 4, char); -VEC_UPDATE_DECL(unsigned short, 3, 2, unsigned short); -VEC_UPDATE_DECL(unsigned short, 3, 3, unsigned short); -VEC_UPDATE_DECL(unsigned short, 3, 4, unsigned short); -VEC_UPDATE_DECL(unsigned short, 3, 2, short); -VEC_UPDATE_DECL(unsigned short, 3, 3, short); -VEC_UPDATE_DECL(unsigned short, 3, 4, short); -VEC_UPDATE_DECL(unsigned short, 3, 2, int); -VEC_UPDATE_DECL(unsigned short, 3, 3, int); -VEC_UPDATE_DECL(unsigned short, 3, 4, int); -VEC_UPDATE_DECL(unsigned short, 3, 2, float); -VEC_UPDATE_DECL(unsigned short, 3, 3, float); -VEC_UPDATE_DECL(unsigned short, 3, 4, float); -VEC_UPDATE_DECL(unsigned short, 3, 2, double); -VEC_UPDATE_DECL(unsigned short, 3, 3, double); -VEC_UPDATE_DECL(unsigned short, 3, 4, double); - -VEC_UPDATE_DECL(int, 2, 2, unsigned char); -VEC_UPDATE_DECL(int, 2, 3, unsigned char); -VEC_UPDATE_DECL(int, 2, 4, unsigned char); -VEC_UPDATE_DECL(int, 2, 2, char); -VEC_UPDATE_DECL(int, 2, 3, char); -VEC_UPDATE_DECL(int, 2, 4, char); -VEC_UPDATE_DECL(int, 2, 2, unsigned short); -VEC_UPDATE_DECL(int, 2, 3, unsigned short); -VEC_UPDATE_DECL(int, 2, 4, unsigned short); -VEC_UPDATE_DECL(int, 2, 2, short); -VEC_UPDATE_DECL(int, 2, 3, short); -VEC_UPDATE_DECL(int, 2, 4, short); -VEC_UPDATE_DECL(int, 2, 2, int); -VEC_UPDATE_DECL(int, 2, 3, int); -VEC_UPDATE_DECL(int, 2, 4, int); -VEC_UPDATE_DECL(int, 2, 2, float); -VEC_UPDATE_DECL(int, 2, 3, float); -VEC_UPDATE_DECL(int, 2, 4, float); -VEC_UPDATE_DECL(int, 2, 2, double); -VEC_UPDATE_DECL(int, 2, 3, double); -VEC_UPDATE_DECL(int, 2, 4, double); - -VEC_UPDATE_DECL(int, 3, 2, unsigned char); -VEC_UPDATE_DECL(int, 3, 3, unsigned char); -VEC_UPDATE_DECL(int, 3, 4, unsigned char); -VEC_UPDATE_DECL(int, 3, 2, char); -VEC_UPDATE_DECL(int, 3, 3, char); -VEC_UPDATE_DECL(int, 3, 4, char); -VEC_UPDATE_DECL(int, 3, 2, unsigned short); -VEC_UPDATE_DECL(int, 3, 3, unsigned short); -VEC_UPDATE_DECL(int, 3, 4, unsigned short); -VEC_UPDATE_DECL(int, 3, 2, short); -VEC_UPDATE_DECL(int, 3, 3, short); -VEC_UPDATE_DECL(int, 3, 4, short); -VEC_UPDATE_DECL(int, 3, 2, int); -VEC_UPDATE_DECL(int, 3, 3, int); -VEC_UPDATE_DECL(int, 3, 4, int); -VEC_UPDATE_DECL(int, 3, 2, float); -VEC_UPDATE_DECL(int, 3, 3, float); -VEC_UPDATE_DECL(int, 3, 4, float); -VEC_UPDATE_DECL(int, 3, 2, double); -VEC_UPDATE_DECL(int, 3, 3, double); -VEC_UPDATE_DECL(int, 3, 4, double); - -VEC_UPDATE_DECL(float, 2, 2, unsigned char); -VEC_UPDATE_DECL(float, 2, 3, unsigned char); -VEC_UPDATE_DECL(float, 2, 4, unsigned char); -VEC_UPDATE_DECL(float, 2, 2, char); -VEC_UPDATE_DECL(float, 2, 3, char); -VEC_UPDATE_DECL(float, 2, 4, char); -VEC_UPDATE_DECL(float, 2, 2, unsigned short); -VEC_UPDATE_DECL(float, 2, 3, unsigned short); -VEC_UPDATE_DECL(float, 2, 4, unsigned short); -VEC_UPDATE_DECL(float, 2, 2, short); -VEC_UPDATE_DECL(float, 2, 3, short); -VEC_UPDATE_DECL(float, 2, 4, short); -VEC_UPDATE_DECL(float, 2, 2, int); -VEC_UPDATE_DECL(float, 2, 3, int); -VEC_UPDATE_DECL(float, 2, 4, int); -VEC_UPDATE_DECL(float, 2, 2, float); -VEC_UPDATE_DECL(float, 2, 3, float); -VEC_UPDATE_DECL(float, 2, 4, float); -VEC_UPDATE_DECL(float, 2, 2, double); -VEC_UPDATE_DECL(float, 2, 3, double); -VEC_UPDATE_DECL(float, 2, 4, double); - -VEC_UPDATE_DECL(float, 3, 2, unsigned char); -VEC_UPDATE_DECL(float, 3, 3, unsigned char); -VEC_UPDATE_DECL(float, 3, 4, unsigned char); -VEC_UPDATE_DECL(float, 3, 2, char); -VEC_UPDATE_DECL(float, 3, 3, char); -VEC_UPDATE_DECL(float, 3, 4, char); -VEC_UPDATE_DECL(float, 3, 2, unsigned short); -VEC_UPDATE_DECL(float, 3, 3, unsigned short); -VEC_UPDATE_DECL(float, 3, 4, unsigned short); -VEC_UPDATE_DECL(float, 3, 2, short); -VEC_UPDATE_DECL(float, 3, 3, short); -VEC_UPDATE_DECL(float, 3, 4, short); -VEC_UPDATE_DECL(float, 3, 2, int); -VEC_UPDATE_DECL(float, 3, 3, int); -VEC_UPDATE_DECL(float, 3, 4, int); -VEC_UPDATE_DECL(float, 3, 2, float); -VEC_UPDATE_DECL(float, 3, 3, float); -VEC_UPDATE_DECL(float, 3, 4, float); -VEC_UPDATE_DECL(float, 3, 2, double); -VEC_UPDATE_DECL(float, 3, 3, double); -VEC_UPDATE_DECL(float, 3, 4, double); - -VEC_UPDATE_DECL(double, 2, 2, unsigned char); -VEC_UPDATE_DECL(double, 2, 3, unsigned char); -VEC_UPDATE_DECL(double, 2, 4, unsigned char); -VEC_UPDATE_DECL(double, 2, 2, char); -VEC_UPDATE_DECL(double, 2, 3, char); -VEC_UPDATE_DECL(double, 2, 4, char); -VEC_UPDATE_DECL(double, 2, 2, unsigned short); -VEC_UPDATE_DECL(double, 2, 3, unsigned short); -VEC_UPDATE_DECL(double, 2, 4, unsigned short); -VEC_UPDATE_DECL(double, 2, 2, short); -VEC_UPDATE_DECL(double, 2, 3, short); -VEC_UPDATE_DECL(double, 2, 4, short); -VEC_UPDATE_DECL(double, 2, 2, int); -VEC_UPDATE_DECL(double, 2, 3, int); -VEC_UPDATE_DECL(double, 2, 4, int); -VEC_UPDATE_DECL(double, 2, 2, float); -VEC_UPDATE_DECL(double, 2, 3, float); -VEC_UPDATE_DECL(double, 2, 4, float); -VEC_UPDATE_DECL(double, 2, 2, double); -VEC_UPDATE_DECL(double, 2, 3, double); -VEC_UPDATE_DECL(double, 2, 4, double); - -VEC_UPDATE_DECL(double, 3, 2, unsigned char); -VEC_UPDATE_DECL(double, 3, 3, unsigned char); -VEC_UPDATE_DECL(double, 3, 4, unsigned char); -VEC_UPDATE_DECL(double, 3, 2, char); -VEC_UPDATE_DECL(double, 3, 3, char); -VEC_UPDATE_DECL(double, 3, 4, char); -VEC_UPDATE_DECL(double, 3, 2, unsigned short); -VEC_UPDATE_DECL(double, 3, 3, unsigned short); -VEC_UPDATE_DECL(double, 3, 4, unsigned short); -VEC_UPDATE_DECL(double, 3, 2, short); -VEC_UPDATE_DECL(double, 3, 3, short); -VEC_UPDATE_DECL(double, 3, 4, short); -VEC_UPDATE_DECL(double, 3, 2, int); -VEC_UPDATE_DECL(double, 3, 3, int); -VEC_UPDATE_DECL(double, 3, 4, int); -VEC_UPDATE_DECL(double, 3, 2, float); -VEC_UPDATE_DECL(double, 3, 3, float); -VEC_UPDATE_DECL(double, 3, 4, float); -VEC_UPDATE_DECL(double, 3, 2, double); -VEC_UPDATE_DECL(double, 3, 3, double); -VEC_UPDATE_DECL(double, 3, 4, double); - //#include "clitkImageConvertGenericFilter.txx" } // end namespace