21 #ifndef otbPCAImageFilter_h
22 #define otbPCAImageFilter_h
52 template <
class TInputImage,
class TOutputImage, Transform::TransformDirection TDirectionOfTransformation>
53 class ITK_EXPORT
PCAImageFilter :
public itk::ImageToImageFilter<TInputImage, TOutputImage>
58 typedef itk::ImageToImageFilter<TInputImage, TOutputImage>
Superclass;
69 itkStaticConstMacro(InputImageDimension,
unsigned int, TInputImage::ImageDimension);
70 itkStaticConstMacro(OutputImageDimension,
unsigned int, TOutputImage::ImageDimension);
87 typedef typename MatrixObjectType::ComponentType
MatrixType;
102 itkSetMacro(NumberOfPrincipalComponentsRequired,
unsigned int);
103 itkGetMacro(NumberOfPrincipalComponentsRequired,
unsigned int);
106 itkSetMacro(Whitening,
bool);
107 itkGetMacro(Whitening,
bool);
112 itkGetMacro(GivenCovarianceMatrix,
bool);
115 if (m_GivenCovarianceMatrix)
116 return m_CovarianceMatrix;
118 return this->GetCovarianceEstimator()->GetCovariance();
123 m_CovarianceMatrix = cov;
124 m_GivenCovarianceMatrix =
true;
128 itkGetMacro(TransformationMatrix, MatrixType);
129 itkGetMacro(GivenTransformationMatrix,
bool);
132 m_TransformationMatrix = transf;
133 m_GivenTransformationMatrix =
true;
134 m_IsTransformationMatrixForward = isForward;
140 itkGetMacro(UseNormalization,
bool);
143 m_UseNormalization = norm;
144 m_UseVarianceForNormalization = norm;
151 m_UseNormalization =
true;
152 m_GivenMeanValues =
true;
157 itkGetConstMacro(UseVarianceForNormalization,
bool);
158 itkSetMacro(UseVarianceForNormalization,
bool);
163 m_UseNormalization =
true;
164 m_UseVarianceForNormalization =
true;
165 m_GivenStdDevValues =
true;
166 m_StdDevValues = vec;
173 m_Normalizer->GetCovarianceEstimator()->SetUserIgnoredValue(value);
174 m_Normalizer->GetCovarianceEstimator()->SetIgnoreUserDefinedValue(
true);
177 m_CovarianceEstimator->SetUserIgnoredValue(value);
178 m_CovarianceEstimator->SetIgnoreUserDefinedValue(
true);
196 void GenerateOutputInformation()
override;
201 void GenerateData()
override;
203 void PrintSelf(std::ostream& os, itk::Indent indent)
const override;
206 virtual void ForwardGenerateOutputInformation();
207 virtual void ReverseGenerateOutputInformation();
208 virtual void ForwardGenerateData();
209 virtual void ReverseGenerateData();
212 void GenerateTransformationMatrix();
237 void operator=(
const Self&);
242 #ifndef OTB_MANUAL_INSTANTIATION
246 #endif // otbPCAImageFilter_h