Commit 311ab632 authored by Cédric Traizet's avatar Cédric Traizet

STY: remove commented code

parent f4a1b37f
......@@ -179,7 +179,6 @@ private:
MandatoryOff("outmatrix");
DisableParameter("outmatrix");
AddRAMParameter();
// Doc example parameter settings
......@@ -493,7 +492,6 @@ private:
m_MinMaxFilter = MinMaxFilterType::New();
m_MinMaxFilter->SetInput(m_ForwardFilter->GetOutput());
//m_MinMaxFilter->GetStreamer()->SetNumberOfLinesStrippedStreaming(50);
m_MinMaxFilter->GetStreamer()->SetAutomaticAdaptativeStreaming(GetParameterInt("ram"));
AddProcess(m_MinMaxFilter->GetStreamer(), "Min/Max computing");
......
......@@ -376,54 +376,6 @@ MNFImageFilter< TInputImage, TOutputImage, TNoiseImageFilter, TDirectionOfTransf
InternalMatrixType transf = Rn_inv * U;
#if 0
InternalMatrixType Ax = m_CovarianceMatrix.GetVnlMatrix();
InternalMatrixType Ax_inv = vnl_matrix_inverse< MatrixElementType > ( Ax );
InternalMatrixType An = m_NoiseCovarianceMatrix.GetVnlMatrix();
InternalMatrixType W = An * Ax_inv;
#endif
#if 0
InternalMatrixType transf;
vnl_vector< MatrixElementType > vectValP;
vnl_symmetric_eigensystem_compute( W, transf, vectValP );
InternalMatrixType valP ( vectValP.size(), vectValP.size(), vnl_matrix_null );
for ( unsigned int i = 0; i < vectValP.size(); ++i )
valP(i, i) = vectValP[i];
#endif
#if 0
vnl_svd< MatrixElementType > solver ( W );
InternalMatrixType transf = solver.U();
InternalMatrixType valP = solver.W();
#endif
#if 0
MatrixType Id ( m_CovarianceMatrix );
Id.SetIdentity();
vnl_generalized_eigensystem solver ( W, Id.GetVnlMatrix() );
InternalMatrixType transf = solver.V;
transf.fliplr();
InternalMatrixType valP = solver.D;
valP.fliplr();
valP.flipud();
#endif
/*
InternalMatrixType normMat = transf.transpose() * Ax * transf;
for ( unsigned int i = 0; i < transf.rows(); ++i )
{
double norm = 1. / std::sqrt( normMat.get(i, i) );
for ( unsigned int j = 0; j < transf.cols(); ++j )
transf.put( j, i, transf.get(j, i) * norm );
}
*/
transf.inplace_transpose();
if ( m_NumberOfPrincipalComponentsRequired
......
......@@ -366,50 +366,6 @@ void
PCAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation >
::GenerateTransformationMatrix ()
{
#if 0
/*
* Old stuff but did work !
*/
MatrixType Id ( m_CovarianceMatrix );
Id.SetIdentity();
typename MatrixType::InternalMatrixType A = m_CovarianceMatrix.GetVnlMatrix();
typename MatrixType::InternalMatrixType I = Id.GetVnlMatrix();
vnl_generalized_eigensystem solver ( A, I );
typename MatrixType::InternalMatrixType transf = solver.V;
transf.fliplr();
transf.inplace_transpose();
vnl_vector< double > valP = solver.D.diagonal();
valP.flip();
m_EigenValues.SetSize( m_NumberOfPrincipalComponentsRequired );
for ( unsigned int i = 0; i < m_NumberOfPrincipalComponentsRequired; ++i )
m_EigenValues[i] = static_cast< RealType >( valP[i] );
/*
* We used normalized PCA
*/
for ( unsigned int i = 0; i < valP.size(); ++i )
{
if ( valP[i] != 0. )
valP[i] = 1. / std::sqrt( std::abs( valP[i] ) );
else
throw itk::ExceptionObject( __FILE__, __LINE__,
"Null Eigen value !!", ITK_LOCATION );
}
valP.post_multiply( transf );
if ( m_NumberOfPrincipalComponentsRequired
!= this->GetInput()->GetNumberOfComponentsPerPixel() )
m_TransformationMatrix = transf.get_n_rows( 0, m_NumberOfPrincipalComponentsRequired );
else
m_TransformationMatrix = transf;
#else
InternalMatrixType transf;
vnl_vector<double> vectValP;
vnl_symmetric_eigensystem_compute( m_CovarianceMatrix.GetVnlMatrix(), transf, vectValP );
......@@ -448,8 +404,6 @@ PCAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation >
m_TransformationMatrix = transf.get_n_rows( 0, m_NumberOfPrincipalComponentsRequired );
else
m_TransformationMatrix = transf;
#endif
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment