18 #ifndef __itkNormalizeODFImageFilter_h 19 #define __itkNormalizeODFImageFilter_h 21 #include "itkUnaryFunctorImageFilter.h" 28 template <
class TInput,
class TOutput>
43 return !( *
this == other );
59 unsigned int size = A.GetSize();
61 value.SetSize( size );
64 for (
unsigned int k=0; k < size; k++ )
65 norm += std::fabs(A[k]);
68 double normFactor = 1.0;
71 normFactor = 1.0/std::sqrt(4*
M_PI) * 1.0/A[0];
76 for (
unsigned int k=0; k < size; k++ )
78 if (std::fabs(sum)>1e-8)
79 normFactor = 1.0/sum * double(size)/(4*
M_PI);
81 for (
unsigned int k=0; k < size; k++ )
82 value[k] = A[k]*normFactor;
86 for (
unsigned int k=0; k < size; k++ )
115 template <
class TInputImage,
class TOutputImage>
118 UnaryFunctorImageFilter<TInputImage, TOutputImage,
119 Functor::ODFNormlizeFunctor< typename TInputImage::PixelType,typename TOutputImage::PixelType> >
124 typedef UnaryFunctorImageFilter<
125 TInputImage, TOutputImage,
127 typename TInputImage::PixelType,
typename TOutputImage::PixelType> >
Superclass;
148 this->GetFunctor().SetODFType( type );
155 return this->GetFunctor().GetODFType();
169 Superclass::PrintSelf( os, indent );
171 os << indent <<
"ODFType: " << this->
GetODFType() << std::endl;
176 void operator=(
const Self &);
TOutput operator()(const TInput &A) const
bool operator!=(const ODFNormlizeFunctor &other) const
void SetODFType(ODFType type)
Functor::ODFNormlizeFunctor< typename TInputImage::PixelType, typename TOutputImage::PixelType > FunctorType
SmartPointer< const Self > ConstPointer
void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
FunctorType::ODFType ODFType
Normalize the input ODF such that the output ODF has unit integral. The input ODF can be represented ...
NormalizeODFImageFilter Self
UnaryFunctorImageFilter< TInputImage, TOutputImage, Functor::ODFNormlizeFunctor< typename TInputImage::PixelType, typename TOutputImage::PixelType > > Superclass
bool operator==(const ODFNormlizeFunctor &other) const
const ODFType & GetODFType() const
SmartPointer< Self > Pointer
virtual ~NormalizeODFImageFilter()
const ODFType & GetODFType() const
void SetODFType(ODFType odfType)
NormalizeODFImageFilter()