From d85fb29b8e891588aea3b64101f5bbc7feca29d6 Mon Sep 17 00:00:00 2001 From: Julien Michel <julien.michel@orfeo-toolbox.org> Date: Fri, 27 Jan 2012 14:50:28 +0100 Subject: [PATCH] DOC: Enhancing documentation of the Dimension Reduction chapter --- Examples/DimensionReduction/ICAExample.cxx | 18 ++++++++++------ Examples/DimensionReduction/MNFExample.cxx | 21 ++++++++++++++----- .../MaximumAutocorrelationFactor.cxx | 11 +++++++++- Examples/DimensionReduction/NAPCAExample.cxx | 8 +++---- 4 files changed, 42 insertions(+), 16 deletions(-) diff --git a/Examples/DimensionReduction/ICAExample.cxx b/Examples/DimensionReduction/ICAExample.cxx index 7277842d80..5078a9793f 100644 --- a/Examples/DimensionReduction/ICAExample.cxx +++ b/Examples/DimensionReduction/ICAExample.cxx @@ -31,10 +31,15 @@ // // This example illustrates the use of the // \doxygen{otb}{FastICAImageFilter}. -// This filter computes a Principal Component Analysis using an -// efficient method based on the inner product in order to compute the -// covariance matrix. +// This filter computes a Fast Independant Components Analysis transform. // +// Like Principal Components Analysis, FastICA computes a set of +// orthogonal linear combinations, but the criterion of Fast ICA is +// different: instead of maximizing variance, it tries to maximize +// stastistical independance between components. In Fast ICA, +// statistical independance is mesured by evaluating non-Gaussianity +// of the components, and the maximization is done in an iterative way. + // The first step required to use this filter is to include its header file. // // Software Guide : EndLatex @@ -144,7 +149,7 @@ int main(int argc, char* argv[]) // Software Guide : EndCodeSnippet // Software Guide : BeginLatex // - // We finally plug the pipeline and trigger the PCA computation with + // We finally plug the pipeline and trigger the ICA computation with // the method \code{Update()} of the writer. // // Software Guide : EndLatex @@ -159,7 +164,7 @@ int main(int argc, char* argv[]) // Software Guide : BeginLatex // // \doxygen{otb}{FastICAImageFilter} allows also to compute inverse - // transformation from PCA coefficients. In reverse mode, the + // transformation from ICA coefficients. In reverse mode, the // covariance matrix or the transformation matrix // (which may not be square) has to be given. // @@ -173,7 +178,8 @@ int main(int argc, char* argv[]) invFilter->SetMeanValues( FastICAfilter->GetMeanValues() ); invFilter->SetStdDevValues( FastICAfilter->GetStdDevValues() ); invFilter->SetTransformationMatrix( FastICAfilter->GetTransformationMatrix() ); - invFilter->SetPCATransformationMatrix( FastICAfilter->GetPCATransformationMatrix() ); + invFilter->SetPCATransformationMatrix( + FastICAfilter->GetPCATransformationMatrix() ); invFilter->SetInput(FastICAfilter->GetOutput()); WriterType::Pointer invWriter = WriterType::New(); diff --git a/Examples/DimensionReduction/MNFExample.cxx b/Examples/DimensionReduction/MNFExample.cxx index 8977d85bdb..bc4d6df850 100644 --- a/Examples/DimensionReduction/MNFExample.cxx +++ b/Examples/DimensionReduction/MNFExample.cxx @@ -30,11 +30,22 @@ // Software Guide : BeginLatex // // This example illustrates the use of the -// \doxygen{otb}{MNFImageFilter}. -// This filter computes a Principal Component Analysis using an +// \doxygen{otb}{MNFImageFilter}. This filter computes a Minimum +// Noise Fraction transform \cite{nielsen2011kernel} using an // efficient method based on the inner product in order to compute the // covariance matrix. // +// The Minimum Noise Fraction transform is a sequence of two Principal +// Components Analysis transform. The first transform is based on an +// estimated covariance matrix of the noise, and intends to whiten the +// input image (noise with unit variance and no correlation between +// bands). +// +// The second Principal Components Analysis is then applied to the +// noise-whitened image, giving the Minimum Noise Fraction transform. +// +// In this implementation, noise is estimated from a local window. +// // The first step required to use this filter is to include its header file. // // Software Guide : EndLatex @@ -100,7 +111,7 @@ int main(int argc, char* argv[]) // Software Guide : EndLatex // SoftwareGuide : BeginCodeSnippet - typedef otb::LocalActivityVectorImageFilter< ImageType, ImageType > NoiseFilterType; + typedef otb::LocalActivityVectorImageFilter<ImageType,ImageType> NoiseFilterType; // SoftwareGuide : EndCodeSnippet @@ -167,7 +178,7 @@ int main(int argc, char* argv[]) // Software Guide : EndCodeSnippet // Software Guide : BeginLatex // - // We finally plug the pipeline and trigger the PCA computation with + // We finally plug the pipeline and trigger the MNF computation with // the method \code{Update()} of the writer. // // Software Guide : EndLatex @@ -182,7 +193,7 @@ int main(int argc, char* argv[]) // Software Guide : BeginLatex // // \doxygen{otb}{MNFImageFilter} allows also to compute inverse - // transformation from PCA coefficients. In reverse mode, the + // transformation from MNF coefficients. In reverse mode, the // covariance matrix or the transformation matrix // (which may not be square) has to be given. // diff --git a/Examples/DimensionReduction/MaximumAutocorrelationFactor.cxx b/Examples/DimensionReduction/MaximumAutocorrelationFactor.cxx index ffd26e2538..6dd258860a 100644 --- a/Examples/DimensionReduction/MaximumAutocorrelationFactor.cxx +++ b/Examples/DimensionReduction/MaximumAutocorrelationFactor.cxx @@ -28,7 +28,16 @@ // Software Guide : BeginLatex // This example illustrates the class -// \doxygen{otb}{MaximumAutocorrelationFactorImageFilter} ... +// \doxygen{otb}{MaximumAutocorrelationFactorImageFilter}, which +// performs a Maximum Autocorrelation Factor transform \cite{nielsen2011kernel}. Like +// PCA, MAF tries to find a set of orthogonal linear transform, but +// the criterion to maximize is the auto-correlation rather than the +// variance. +// +// Auto-correlation is the correlation between the component and a +// unitary shifted version of the component. +// +// Please note that the inverse transform is not implemented yet. // // We start by including the corresponding header file. // diff --git a/Examples/DimensionReduction/NAPCAExample.cxx b/Examples/DimensionReduction/NAPCAExample.cxx index cf24000d18..6ecc58b916 100644 --- a/Examples/DimensionReduction/NAPCAExample.cxx +++ b/Examples/DimensionReduction/NAPCAExample.cxx @@ -100,7 +100,7 @@ int main(int argc, char* argv[]) // Software Guide : EndLatex // SoftwareGuide : BeginCodeSnippet - typedef otb::LocalActivityVectorImageFilter< ImageType, ImageType > NoiseFilterType; + typedef otb::LocalActivityVectorImageFilter<ImageType,ImageType> NoiseFilterType; // SoftwareGuide : EndCodeSnippet @@ -167,7 +167,7 @@ int main(int argc, char* argv[]) // Software Guide : EndCodeSnippet // Software Guide : BeginLatex // - // We finally plug the pipeline and trigger the PCA computation with + // We finally plug the pipeline and trigger the NA-PCA computation with // the method \code{Update()} of the writer. // // Software Guide : EndLatex @@ -182,7 +182,7 @@ int main(int argc, char* argv[]) // Software Guide : BeginLatex // // \doxygen{otb}{NAPCAImageFilter} allows also to compute inverse - // transformation from PCA coefficients. In reverse mode, the + // transformation from NA-PCA coefficients. In reverse mode, the // covariance matrix or the transformation matrix // (which may not be square) has to be given. // @@ -209,7 +209,7 @@ int main(int argc, char* argv[]) // Software Guide : BeginLatex // Figure~\ref{fig:NAPCA_FILTER} shows the result of applying forward - // and reverse NAPCA transformation to a 8 bands Wordlview2 image. + // and reverse NA-PCA transformation to a 8 bands Wordlview2 image. // \begin{figure} // \center // \includegraphics[width=0.32\textwidth]{napca-input-pretty.eps} -- GitLab