11 #ifndef __itkMultiplyByConstantMatrixVectorImageFilter_h 12 #define __itkMultiplyByConstantMatrixVectorImageFilter_h 14 #include "itkUnaryFunctorImageFilter.h" 31 template <
class TInput,
class TMatrix,
class TOutput=TInput>
49 return !( *
this == other );
61 VectorType vectorInput(A.GetSize());
66 utl::VectorToVector<TInput, VectorType>(A, vectorInput, A.Size());
68 utl::VectorToVector<VectorType, TOutput>(vectorOutput, out, vectorOutput.Size());
92 template <
class TInputImage,
class TConstantMatrix,
class TOutputImage=TInputImage>
95 UnaryFunctorImageFilter<TInputImage, TOutputImage,
96 Functor::MultiplyByConstantMatrix<
97 typename TInputImage::PixelType, TConstantMatrix,
98 typename TOutputImage::PixelType> >
103 typedef UnaryFunctorImageFilter<
104 TInputImage, TOutputImage,
106 typename TInputImage::PixelType, TConstantMatrix,
123 this->GetFunctor().SetConstantMatrix( ct );
130 return this->GetFunctor().GetConstantMatrix();
144 Superclass::GenerateOutputInformation();
145 typename Superclass::OutputImagePointer outputPtr = this->GetOutput();
146 unsigned dim = this->GetFunctor().GetNumberOfComponentsPerPixelInOutput();
147 outputPtr->SetNumberOfComponentsPerPixel(dim);
152 Superclass::PrintSelf( os, indent );
158 void operator=(
const Self &);
MultiplyByConstantMatrixVectorImageFilter()
NDArray is a N-Dimensional array class (row-major, c version)
void SetConstantMatrix(const TConstantMatrix &ct)
SmartPointer< Self > Pointer
void SetConstantMatrix(const TMatrix &ct)
const unsigned GetNumberOfComponentsPerPixelInOutput() const
bool operator==(const MultiplyByConstantMatrix &other) const
TInput::ValueType InputValueType
utl::NDArray< double, 1 > VectorType
const TMatrix & GetConstantMatrix() const
MultiplyByConstantMatrixVectorImageFilter Self
void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
TOutput::ValueType OutputValueType
virtual void GenerateOutputInformation() ITK_OVERRIDE
SmartPointer< const Self > ConstPointer
virtual ~MultiplyByConstantMatrixVectorImageFilter()
~MultiplyByConstantMatrix()
In each vxoel, multiply the input vector by a matrix.
TOutput operator()(const TInput &A)
const TConstantMatrix & GetConstantMatrix() const
bool operator!=(const MultiplyByConstantMatrix &other) const
UnaryFunctorImageFilter< TInputImage, TOutputImage, Functor::MultiplyByConstantMatrix< typename TInputImage::PixelType, TConstantMatrix, typename TOutputImage::PixelType > > Superclass
void ProductUtlMv(const utl::NDArray< T, 2 > &A, const utl::NDArray< T, 1 > &b, utl::NDArray< T, 1 > &c, const double alpha=1.0, const double beta=0.0)
MultiplyByConstantMatrix()