X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpExtensions%2FDataStructures%2FFourierSeriesContour.cxx;h=679f21660ada88e149f922ade876814a4e8d17ea;hb=80ac2c55630c2a345a2102f0be86843147a398cc;hp=989b0bcfaad13f807d24021fe0e8169819dd29c2;hpb=e393f405f8f1864f8b019940fe1303be78002f64;p=cpPlugins.git diff --git a/lib/cpExtensions/DataStructures/FourierSeriesContour.cxx b/lib/cpExtensions/DataStructures/FourierSeriesContour.cxx index 989b0bc..679f216 100644 --- a/lib/cpExtensions/DataStructures/FourierSeriesContour.cxx +++ b/lib/cpExtensions/DataStructures/FourierSeriesContour.cxx @@ -26,7 +26,7 @@ template< class _TScalar > _TScalar cpExtensions::DataStructures::FourierSeriesContour< _TScalar >:: GetArea( ) const { - S a = TScalar( 0 ); + TScalar a = TScalar( 0 ); int q = this->GetNumberOfHarmonics( ); typename Self::const_iterator i = this->begin( ); for( int l = -q; i != this->end( ); ++i, ++l ) @@ -403,7 +403,7 @@ operator&( const _TScalar& phase ) const int q = this->GetNumberOfHarmonics( ); typename Self::const_iterator i = this->begin( ); for( int l = -q; i != this->end( ); ++i, ++l ) - res.push_back( *i * std::polar( S( 1 ), S( l ) * phase ) ); + res.push_back( *i * std::polar( TScalar( 1 ), TScalar( l ) * phase ) ); return( res ); } @@ -416,7 +416,7 @@ operator&=( const _TScalar& phase ) int q = this->GetNumberOfHarmonics( ); typename Self::iterator i = this->begin( ); for( int l = -q; i != this->end( ); ++i, ++l ) - *i *= std::polar( S( 1 ), S( l ) * phase ); + *i *= std::polar( TScalar( 1 ), TScalar( l ) * phase ); return( *this ); } @@ -473,8 +473,8 @@ GetPhase( const _TScalar& w ) const // 1.1. Roughly sample phases for( unsigned int s = 0; s < _samples; ++s ) { - S w = TScalar( s ) * _angleOff; - S a = std::arg( contour._Z( w, 0 ) ); + TScalar w = TScalar( s ) * _angleOff; + TScalar a = std::arg( contour._Z( w, 0 ) ); function.push_back( std::pair< TScalar, TScalar >( w, a ) ); if( a < minA ) { @@ -545,7 +545,7 @@ Sample( std::vector< TPoint >& p, const unsigned long& s ) const static const TScalar _2pi = TScalar( 2 ) * TScalar( vnl_math::pi ); TScalar off = _2pi / TScalar( s - 1 ); for( unsigned int w = 0; w < s; ++w ) - p.push_back( ( *this )( S( w ) * off ) ); + p.push_back( ( *this )( TScalar( w ) * off ) ); } // ------------------------------------------------------------------------- @@ -571,8 +571,12 @@ GetEllipse( int l, _TScalar& a, _TScalar& b, _TScalar& t, _TScalar& p ) const { zp /= np; zn /= nn; - t = std::real( std::log( zp * zn ) / TComplex( TScalar( 0 ), S( 2 ) ) ); - p = std::real( std::log( zp / zn ) / TComplex( TScalar( 0 ), S( 2 * l ) ) ); + t = std::real( + std::log( zp * zn ) / TComplex( TScalar( 0 ), TScalar( 2 ) ) + ); + p = std::real( + std::log( zp / zn ) / TComplex( TScalar( 0 ), TScalar( 2 * l ) ) + ); } else { @@ -623,7 +627,7 @@ template< class _TScalar > void cpExtensions::DataStructures::FourierSeriesContour< _TScalar >:: _DFT( const std::vector< TComplex >& p, unsigned int q ) { - static const S _2pi = TScalar( 2 ) * TScalar( vnl_math::pi ); + static const TScalar _2pi = TScalar( 2 ) * TScalar( vnl_math::pi ); this->SetNumberOfHarmonics( q ); *this *= TScalar( 0 );