-#define TRY_TYPE(TYPE) \
- if (IsSameType<TYPE>(mOutputPixelTypeName)) { UpdateWithOutputType<InputImageType, TYPE>(); 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
-
- std::string list = CreateListOfTypes<char, uchar, short, ushort, int, float, double>();
- std::cerr << "Error, I don't know the output type '" << mOutputPixelTypeName
- << "'. " << std::endl << "Known types are " << list << "." << std::endl;
- exit(0);
+ // "trick" to call independent versions of update according to the
+ // pixel type (vector or scalar), using partial specializations
+ if (!UpdateWithSelectiveOutputType<InputImageType, ImageConvertTraits<typename InputImageType::PixelType>::IS_VECTOR>::Run(*this, mOutputPixelTypeName))
+ exit(-1);