18 #ifndef __itkRotateSHCoefficientsImageFilter_h 19 #define __itkRotateSHCoefficientsImageFilter_h 21 #include <vnl/vnl_matrix.h> 24 #include "itkUnaryFunctorImageFilter.h" 46 template<
class TInput,
class TOutput>
65 return !(*
this == other);
73 const int N = A.GetSize();
76 utl::VectorToVector<TInput, VectorType >(A, vec, N);
78 utl::VectorToVector<VectorType, TInput>(vecRotated, output, N);
99 template <
class TInputImage,
class TOutputImage>
102 UnaryFunctorImageFilter<TInputImage,TOutputImage,
103 Functor::RotateSHCoefficients<
104 typename TInputImage::PixelType,
105 typename TOutputImage::PixelType> >
110 typedef UnaryFunctorImageFilter<
111 TInputImage,TOutputImage,
113 typename TInputImage::PixelType,
131 this->GetFunctor().GetSHRotate()->SetTessOrder(3);
132 this->GetFunctor().GetSHRotate()->SetMaxRank(10);
133 this->GetFunctor().GetSHRotate()->Initialize();
139 if( !mat.
IsEqual(this->GetFunctor().GetRotationMatrix(), 1e-8) )
141 this->GetFunctor().SetRotationMatrix(mat);
147 return this->GetFunctor().GetRotationMatrix();
156 Superclass::PrintSelf(os, indent);
157 os << indent <<
"RotationMatrix: " 165 void operator=(
const Self&);
SHCoefficientsRotation< double > RotationFilter
utl::NDArray< double, 1 > VectorType
SmartPointer< const Self > ConstPointer
bool operator==(const RotateSHCoefficients &other) const
helper functions specifically used in dmritool
void BeforeThreadedGenerateData() ITK_OVERRIDE
UnaryFunctorImageFilter< TInputImage, TOutputImage, Functor::RotateSHCoefficients< typename TInputImage::PixelType, typename TOutputImage::PixelType > > Superclass
SHCoefficientsRotation< double > SHRotationFilter
SmartPointer< Self > Pointer
void SetRotationMatrix(const MatrixType &mat)
SmartPointer< Self > Pointer
void SetSHRotate(const SHRotationPointer &ptr)
RotateSHCoefficientsImageFilter Self
bool IsEqual(const NDArrayBase< T, Dim > &r, const double eps) const
TOutput operator()(const TInput &A) const
RotateSHCoefficientsImageFilter()
utl::NDArray< double, 1 > VectorType
Rotate SH coefficient to all input pixels.
void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
const SHRotationPointer & GetSHRotate() const
virtual ~RotateSHCoefficientsImageFilter()
rotate SH coefficient vector by a given rotation matrix.
const MatrixType & GetRotationMatrix() const
void SetRotationMatrix(const MatrixType &mat)
bool operator!=(const RotateSHCoefficients &other) const
SHRotationFilter::Pointer SHRotationPointer
SHRotationPointer m_SHRotate
const MatrixType & GetRotationMatrix() const
utl::NDArray< double, 2 > MatrixType
MatrixType m_RotationMatrix
utl::NDArray< double, 2 > MatrixType