21 #ifndef otbMDMDNMFImageFilter_h
22 #define otbMDMDNMFImageFilter_h
24 #include "itkImageToImageFilter.h"
27 #include "vnl/vnl_matrix.h"
28 #include "vnl/vnl_vector.h"
127 template <
class TInputImage,
class TOutputImage>
133 typedef itk::ImageToImageFilter<TInputImage, TOutputImage>
Superclass;
177 itkSetMacro(MaxIter,
unsigned int);
178 itkGetMacro(MaxIter,
unsigned int);
181 itkSetMacro(CritStopValue,
double);
182 itkGetMacro(CritStopValue,
double);
184 itkSetMacro(Delt,
double);
185 itkGetMacro(Delt,
double);
187 itkSetMacro(LambdD,
double);
188 itkGetMacro(LambdD,
double);
190 itkSetMacro(LambdS,
double);
191 itkGetMacro(LambdS,
double);
198 void PrintSelf(std::ostream& os, itk::Indent indent)
const override;
200 void GenerateInputRequestedRegion()
override;
205 void GenerateOutputInformation()
override;
208 void GenerateData()
override;
213 void operator=(
const Self&) =
delete;
215 static void AddOneRowOfOnes(
const MatrixType& m, MatrixType& M);
217 static double Criterion(
const MatrixType& X,
const MatrixType& A,
const MatrixType& S,
const double& delt,
const double& lambdS,
const double& lambdD);
219 static void EvalGradS(
const MatrixType& X,
const MatrixType& A,
const MatrixType& S,
const double& delt,
const double& lambdS, MatrixType& gradS);
221 static void EvalGradA(
const MatrixType& X,
const MatrixType& A,
const MatrixType& S,
const double& delt,
const double& lambdD, MatrixType& gradA);
223 static double Call(
const MatrixType& variMat,
const MatrixType& fixedMat,
const MatrixType& X,
const double& delt,
const double& lambdS,
const double& lambdD,
224 const bool isDirectEvalDirection);
226 static void ProjGradOneStep(
const MatrixType& X,
const MatrixType& fixedMat,
const MatrixType& gradVariMat,
const double& sig,
const double& betinit,
227 const double& delt,
const double& lambdS,
const double& lambdD, MatrixType& variMat,
double& alph,
228 const bool isDirectEvalDirection);
230 static void SetNegativeCoefficientsToZero(MatrixType& M);
232 static MatrixType TermByTermMatrixProduct(
const MatrixType& M1,
const MatrixType& M2);
234 static double SumMatrixElements(
const MatrixType& M);
236 static bool ArmijoTest(
const double& sig,
const MatrixType variMat,
const MatrixType& newVariMat,
const double& evalf,
const double& newEvalf,
237 const MatrixType& gradVariMat,
const double& alph);
252 #ifndef OTB_MANUAL_INSTANTIATION