Commit df1c3a2f authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

ENH: add concept checking to avoid instantiation of...

ENH: add concept checking to avoid instantiation of VectorImageToAmplitudeImageFilter with VectorImageOutput
parent b5dc08ff
......@@ -20,6 +20,7 @@ See OTBCopyright.txt for details.
#include "itkUnaryFunctorImageFilter.h"
#include "otbMath.h"
#include "itkConceptChecking.h"
namespace otb
{
......@@ -36,6 +37,11 @@ public:
{
return static_cast<TOutput>(vcl_sqrt(A.GetSquaredNorm()));
}
itkConceptMacro(OutputShouldNotBeVectorImageCheck,
(itk::Concept::Convertible<TOutput, double>));
}; // end namespace Functor
}
......@@ -46,18 +52,24 @@ public:
* \ingroup Streamed
* \ingroup Threaded
*/
template <class TInputImage, class TOutputImage>
class ITK_EXPORT VectorImageToAmplitudeImageFilter
: public itk::UnaryFunctorImageFilter<TInputImage,TOutputImage,Functor::VectorToAmplitudeFunctor<
typename TInputImage::PixelType, typename TOutputImage::PixelType> >
: public itk::UnaryFunctorImageFilter<TInputImage,TOutputImage,
Functor::VectorToAmplitudeFunctor<
typename TInputImage::PixelType, typename TOutputImage::PixelType> >
{
public:
/** Standard typedefs */
typedef VectorImageToAmplitudeImageFilter Self;
typedef itk::UnaryFunctorImageFilter<TInputImage,TOutputImage,Functor::VectorToAmplitudeFunctor<
typename TInputImage::PixelType, typename TOutputImage::PixelType> > Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef VectorImageToAmplitudeImageFilter Self;
typedef itk::UnaryFunctorImageFilter<
TInputImage,
TOutputImage,
Functor::VectorToAmplitudeFunctor<
typename TInputImage::PixelType,
typename TOutputImage::PixelType> > Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Type macro */
itkNewMacro(Self);
......@@ -80,5 +92,6 @@ private:
VectorImageToAmplitudeImageFilter(const Self&); //purposely not implemented
void operator=(const Self&); //purposely not implemented
};
}// End namespace otb
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment