Fix PCA in Dimensionality reduction
All threads resolved!
Fix bugs in the DimensionalityReduction
and add a few functionalities (e.g. output eigenvalues)
See issues #1950 (closed) and #1849
List of changes:
SetAutomaticInputMinMaxComputation(false)
on the rescaler to avoid computation of the min max on each streaming tile (the global min/max are computed before the rescaling step. This was causing the "stripping" described in #1950 (closed).rescale
was disabled by default, and at it was a ParameterGroup
it was not possible to enable it using cli (it was possible to use it in gui by clicking on the parameter box), so it was not possible to use rescaling in cli. "rescale" is now a parameterChoice
, with two choices: no
and minmax
, if the latter is chosen rescaling is performed.normalize
parameter is set to true
, the input data is centered and reduced. In PCA this means that the transformation is defined by the eigenvector of the correlation matrix defined by the element (E[XY]-E[X]E[Y])/(sigmaX*sigmaY)
, but in the PCAImageFilter E[XY] was used (this is what the StreamingStatisticsVectorImageFilter
's GetCorrelation() method output, this is the definition of auto correlation matrix used in signal processing). The code has been modified to use the correct matrix.on
and normalize off
. With normalize on the data is reduced and centered, and normalize off where the data is not centered nor reduced. However the most common way to use PCA is to use it on centered data (0 mean). By default (normalize off) the data is now centered.method.pca.outeigenvalues
(filename) : write the computed eigenvalues in a txt file.method.pca.whiten
(bool) : perform whitening on the input data (currently whitening was always performed).The copyright owner is CNES and has signed the ORFEO ToolBox Contributor License Agreement.
Check before merging:
git diff develop... -U0 --no-color | clang-format-diff.py -p1 -i
on latest changes and commitapTvChDimensionalityReductionPCA.tif
Download