Commit d531d348 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[MERGE]

parents e2a3af19 dcdcf30d
......@@ -24,17 +24,16 @@
#include <vector>
#include "../../ext/Eigen/SVD"
#include "../WAssert.h"
#include "WLinearAlgebraFunctions.h"
#include "WMatrix.h"
#include "WMatrix4x4.h"
#include "WValue.h"
#include "WVector3D.h"
#ifdef OW_USE_OSSIM
#include "WOSSIMHelper.h"
#endif
WVector3D multMatrixWithVector3D( WMatrix<double> mat, WVector3D vec )
{
WVector3D result;
......@@ -301,32 +300,32 @@ bool linearIndependent( const WVector3D& u, const WVector3D& v )
return true;
}
void computeSVD( const WMatrix< double >& A,
WMatrix< double >& U,
WMatrix< double >& V,
WValue< double >& S )
void computeSVD( const WMatrix_2& A,
WMatrix_2& U,
WMatrix_2& V,
WVector_2& S )
{
#ifdef OW_USE_OSSIM
WOSSIMHelper::computeSVD( A, U, V, S );
#else
(void) A; (void) U; (void) V; (void) S; // NOLINT to prevent "unused variable" warnings
WAssert( false, "OpenWalnut must be compiled with OSSIM to support SVD." );
#endif
Eigen::JacobiSVD<WMatrix_2> svd( A, Eigen::ComputeFullU | Eigen::ComputeFullV );
U = svd.matrixU();
V = svd.matrixV();
S = svd.singularValues();
}
WMatrix<double> pseudoInverse( const WMatrix<double>& input )
WMatrix_2 pseudoInverse( const WMatrix_2& input )
{
// calc pseudo inverse
WMatrix< double > U( input.getNbRows(), input.getNbCols() );
WMatrix< double > V( input.getNbCols(), input.getNbCols() );
WValue< double > Svec( input.getNbCols() );
WMatrix_2 U( input.rows(), input.cols() );
WMatrix_2 V( input.cols(), input.cols() );
WVector_2 Svec( input.cols() );
computeSVD( input, U, V, Svec );
// create diagonal matrix S
WMatrix< double > S( input.getNbCols(), input.getNbCols() );
for ( size_t i = 0; i < Svec.size() && i < S.getNbRows() && i < S.getNbCols(); i++ )
S( i, i ) = ( Svec[ i ] == 0.0 ) ? 0.0 : 1.0 / Svec[ i ];
WMatrix_2 S( input.cols(), input.cols() );
S.setZero();
for ( int i = 0; i < Svec.size() && i < S.rows() && i < S.cols(); i++ )
{
S( i, i ) = ( Svec[ i ] == 0.0 ) ? 0.0 : 1.0 / Svec[ i ];
}
return WMatrix< double >( V*S*U.transposed() );
return WMatrix_2( V*S*U.transpose() );
}
......@@ -26,6 +26,7 @@
#define WLINEARALGEBRAFUNCTIONS_H
#include "../WExportCommon.h"
#include "WMatrix.h"
namespace osg
{
......@@ -115,8 +116,7 @@ bool OWCOMMON_EXPORT linearIndependent( const WVector3D& u, const WVector3D& v )
*
* \note This function needs the OSSIM library.
*/
void OWCOMMON_EXPORT computeSVD( const WMatrix< double >& A, WMatrix< double >& U,
WMatrix< double >& V, WValue< double >& S );
void OWCOMMON_EXPORT computeSVD( const WMatrix_2& A, WMatrix_2& U, WMatrix_2& V, WVector_2& S );
/**
* Calculates for a matrix the pseudo inverse.
......@@ -126,6 +126,6 @@ void OWCOMMON_EXPORT computeSVD( const WMatrix< double >& A, WMatrix< double >&
* \return Inverted Matrix
*
*/
WMatrix< double > OWCOMMON_EXPORT pseudoInverse( const WMatrix<double>& input );
WMatrix_2 OWCOMMON_EXPORT pseudoInverse( const WMatrix_2& input );
#endif // WLINEARALGEBRAFUNCTIONS_H
......@@ -72,6 +72,15 @@ typedef Eigen::Matrix< double, 4, 4 > WMatrix4x4_2;
*/
typedef Eigen::MatrixXd WMatrix_2;
/**
* A complex double matrix of dynamic size. Heap-allocated.
* If you want to access coefficients using the operator( size_t, size_t ), the first parameter is still the row index, starting with 0.
*
* \see http://eigen.tuxfamily.org/dox/classEigen_1_1Matrix.html
* \see http://eigen.tuxfamily.org/dox/classEigen_1_1MatrixBase.html
*/
typedef Eigen::MatrixXcd WMatrixComplex_2;
/**
* Matrix template class with variable number of rows and columns.
* The access function are row-major, which means that the rows
......
......@@ -31,7 +31,7 @@
#include "WMath.h"
#include "WMatrix.h"
#include "WUnitSphereCoordinates.h"
#include "WValue.h"
#include "WVector3D.h"
/**
* Class for symmetric spherical harmonics
......@@ -50,7 +50,7 @@ public:
* Constructor.
* \param SHCoefficients the initial coefficients (stored like in the mentioned Descoteaux paper).
*/
explicit WSymmetricSphericalHarmonic( const WValue<double>& SHCoefficients );
explicit WSymmetricSphericalHarmonic( const WVector_2& SHCoefficients );
/**
* Destructor.
......@@ -73,17 +73,17 @@ public:
/**
* Returns the used coefficients (stored like in the mentioned 2007 Descoteaux paper).
*/
const WValue<double>& getCoefficients() const;
const WVector_2& getCoefficients() const;
/**
* Returns the coefficients for Schultz' SH base.
*/
WValue< double > getCoefficientsSchultz() const;
WVector_2 getCoefficientsSchultz() const;
/**
* Returns the coefficients for the complex base.
*/
WValue< std::complex< double > > getCoefficientsComplex() const;
WVectorComplex_2 getCoefficientsComplex() const;
/**
* Applies the Funk-Radon-Transformation. This is faster than matrix multiplication.
......@@ -91,7 +91,7 @@ public:
*
* \param frtMat the frt matrix as calculated by calcFRTMatrix()
*/
void applyFunkRadonTransformation( WMatrix< double > const& frtMat );
void applyFunkRadonTransformation( const WMatrix_2& frtMat );
/**
* Return the order of the spherical harmonic.
......@@ -125,7 +125,7 @@ public:
*
* \return The generalized fractional anisotropy.
*/
double calcGFA( WMatrix< double > const& B ) const;
double calcGFA( const WMatrix_2& B ) const;
/**
* This calculates the transformation/fitting matrix T like in the 2007 Descoteaux paper. The orientations are given as WVector3D.
......@@ -135,10 +135,10 @@ public:
* \param withFRT include the Funk-Radon-Transformation?
* \return Transformation matrix
*/
static WMatrix<double> getSHFittingMatrix( const std::vector< WVector3D >& orientations,
int order,
double lambda,
bool withFRT );
static WMatrix_2 getSHFittingMatrix( const std::vector< WVector3D >& orientations,
int order,
double lambda,
bool withFRT );
/**
* This calculates the transformation/fitting matrix T like in the 2007 Descoteaux paper. The orientations are given as WUnitSphereCoordinates .
......@@ -148,7 +148,7 @@ public:
* \param withFRT include the Funk-Radon-Transformation?
* \return Transformation matrix
*/
static WMatrix<double> getSHFittingMatrix( const std::vector< WUnitSphereCoordinates >& orientations,
static WMatrix_2 getSHFittingMatrix( const std::vector< WUnitSphereCoordinates >& orientations,
int order,
double lambda,
bool withFRT );
......@@ -159,7 +159,7 @@ public:
* \param order The order of the spherical harmonics intended to create
* \return The base Matrix B
*/
static WMatrix<double> calcBaseMatrix( const std::vector< WUnitSphereCoordinates >& orientations, int order );
static WMatrix_2 calcBaseMatrix( const std::vector< WUnitSphereCoordinates >& orientations, int order );
/**
* Calculates the base matrix B for the complex spherical harmonics.
......@@ -167,7 +167,7 @@ public:
* \param order The order of the spherical harmonics intended to create
* \return The base Matrix B
*/
static WMatrix< std::complex< double > > calcComplexBaseMatrix( std::vector< WUnitSphereCoordinates > const& orientations,
static WMatrixComplex_2 calcComplexBaseMatrix( std::vector< WUnitSphereCoordinates > const& orientations,
int order );
/**
......@@ -175,14 +175,14 @@ public:
* \param order The order of the spherical harmonic
* \return The smoothing matrix L
*/
static WMatrix<double> calcSmoothingMatrix( size_t order );
static WMatrix_2 calcSmoothingMatrix( size_t order );
/**
* Calculates the Funk-Radon-Transformation-Matrix P from the 2007 Descoteaux Paper "Regularized, Fast, and Robust Analytical Q-Ball Imaging"
* \param order The order of the spherical harmonic
* \return The Funk-Radon-Matrix P
*/
static WMatrix<double> calcFRTMatrix( size_t order );
static WMatrix_2 calcFRTMatrix( size_t order );
#ifdef OW_USE_OSSIM
/**
......@@ -191,8 +191,9 @@ public:
* \param order The order of the symmetric tensor.
* \param orientations A vector of at least (orderTensor+1) * (orderTensor+2) / 2 orientations.
*/
static WMatrix< double > calcSHToTensorSymMatrix( std::size_t order, const std::vector< WUnitSphereCoordinates >& orientations );
static WMatrix_2 calcSHToTensorSymMatrix( std::size_t order, const std::vector< WUnitSphereCoordinates >& orientations );
#endif // OW_USE_OSSIM
void normalize();
protected:
......@@ -201,7 +202,7 @@ private:
size_t m_order;
/** coefficients of the spherical harmonic */
WValue<double> m_SHCoefficients;
WVector_2 m_SHCoefficients;
};
#endif // WSYMMETRICSPHERICALHARMONIC_H
......@@ -31,6 +31,7 @@
#include "../WAssert.h"
#include "../WStringUtils.h"
#include "WVector3D.h"
/**
* Base class for all higher level values like tensors, vectors, matrices and so on.
......@@ -77,6 +78,19 @@ public:
}
}
/**
* Create a WValue from the given WVector_2.
* \param newValues The WVector_2 with the values..
*/
explicit WValue( const WVector_2& newValues )
: m_components( static_cast< std::size_t >( newValues.size() ) )
{
for ( std::size_t i = 0; i < m_components.size(); ++i )
{
m_components[ i ] = static_cast< T >( newValues( i ) );
}
}
/**
* Get number of components the value consists of.
*/
......@@ -320,6 +334,19 @@ public:
m_components.resize( size );
}
/**
* Returns this WValue as WVector_2.
*/
WVector_2 toWVector()
{
WVector_2 result( m_components.size() );
for ( size_t i = 0; i < m_components.size(); ++i )
{
result( i ) = static_cast<double>( m_components[ i ] );
}
return result;
}
protected:
private:
/**
......
......@@ -70,6 +70,14 @@ typedef WVector3D_2 WPosition_2;
*/
typedef Eigen::Matrix< double, Eigen::Dynamic, 1 > WVector_2;
/**
* A complex double vector of dynamic size. Heap-allocated.
*
* \see http://eigen.tuxfamily.org/dox/classEigen_1_1Matrix.html
* \see http://eigen.tuxfamily.org/dox/classEigen_1_1MatrixBase.html
*/
typedef Eigen::VectorXcd WVectorComplex_2;
/**
* Forward declare the OLD vector class. Needed for the conversion functions.
*/
......@@ -142,21 +150,21 @@ public:
WVector3D( osg::Vec3d::value_type x, osg::Vec3d::value_type y, osg::Vec3d::value_type z );
// NOTE: osg::Vec3d members made deprecated.
OW_API_DEPRECATED double length() const { return osg::Vec3d::length(); }
OW_API_DEPRECATED double length2() const { return osg::Vec3d::length2(); }
OW_API_DEPRECATED double normalize() { return osg::Vec3d::normalize(); }
OW_API_DEPRECATED void set (double x, double y, double z) { osg::Vec3d::set( x, y, z ); }
OW_API_DEPRECATED void set (const Vec3d &rhs) { osg::Vec3d::set( rhs ); }
OW_API_DEPRECATED double & operator[] (int i) { return osg::Vec3d::operator[]( i ); }
OW_API_DEPRECATED double operator[] (int i) const { return osg::Vec3d::operator[]( i ); }
OW_API_DEPRECATED double & x () { return osg::Vec3d::x(); }
OW_API_DEPRECATED double & y () { return osg::Vec3d::y(); }
OW_API_DEPRECATED double & z () { return osg::Vec3d::z(); }
OW_API_DEPRECATED double x () const { return osg::Vec3d::x(); }
OW_API_DEPRECATED double y () const { return osg::Vec3d::y(); }
OW_API_DEPRECATED double z () const { return osg::Vec3d::z(); }
OW_API_DEPRECATED bool valid() const { return osg::Vec3d::valid(); }
OW_API_DEPRECATED bool isNaN() const { return osg::Vec3d::isNaN(); }
OW_API_DEPRECATED double length() const { return osg::Vec3d::length(); } // NOLINT
OW_API_DEPRECATED double length2() const { return osg::Vec3d::length2(); } // NOLINT
OW_API_DEPRECATED double normalize() { return osg::Vec3d::normalize(); } // NOLINT
OW_API_DEPRECATED void set (double x, double y, double z) { osg::Vec3d::set( x, y, z ); } // NOLINT
OW_API_DEPRECATED void set (const Vec3d &rhs) { osg::Vec3d::set( rhs ); } // NOLINT
OW_API_DEPRECATED double & operator[] (int i) { return osg::Vec3d::operator[]( i ); } // NOLINT
OW_API_DEPRECATED double operator[] (int i) const { return osg::Vec3d::operator[]( i ); } // NOLINT
OW_API_DEPRECATED double & x () { return osg::Vec3d::x(); } // NOLINT
OW_API_DEPRECATED double & y () { return osg::Vec3d::y(); } // NOLINT
OW_API_DEPRECATED double & z () { return osg::Vec3d::z(); } // NOLINT
OW_API_DEPRECATED double x () const { return osg::Vec3d::x(); } // NOLINT
OW_API_DEPRECATED double y () const { return osg::Vec3d::y(); } // NOLINT
OW_API_DEPRECATED double z () const { return osg::Vec3d::z(); } // NOLINT
OW_API_DEPRECATED bool valid() const { return osg::Vec3d::valid(); } // NOLINT
OW_API_DEPRECATED bool isNaN() const { return osg::Vec3d::isNaN(); } // NOLINT
/**
* Calculate Euclidean square distance between this Position and another one.
......
......@@ -175,18 +175,58 @@ public:
TS_ASSERT( !linearIndependent( u, u ) );
}
/**
* Test SVD calculation
*/
void testComputeSVD( void )
{
const size_t nbRows = 3, nbCols = 3;
const double a = 1.2, b = 2.3, c = 3.4,
d = 4.5, e = 5.6, f = 6.7,
g = 3.4, h = 1.2, i = 7.0;
WMatrix_2 A( nbRows, nbCols );
A( 0, 0 ) = a;
A( 0, 1 ) = b;
A( 0, 2 ) = c;
A( 1, 0 ) = d;
A( 1, 1 ) = e;
A( 1, 2 ) = f;
A( 2, 0 ) = g;
A( 2, 1 ) = h;
A( 2, 2 ) = i;
WMatrix_2 U( A.rows(), A.cols() );
WMatrix_2 V( A.cols(), A.cols() );
WVector_2 Svec( A.cols() );
computeSVD( A, U, V, Svec );
WMatrix_2 S( Svec.size(), Svec.size() );
S.setZero();
for ( int i = 0; i < Svec.size(); ++i )
{
S( i, i ) = Svec( i );
}
WMatrix_2 A2( U*S*V.transpose() );
for ( int row = 0; row < A.rows(); ++row )
{
for ( int col = 0; col < A.cols(); ++col )
{
TS_ASSERT_DELTA( A( row, col ), A2( row, col ), 0.0001 );
}
}
}
/**
* Test pseudoInverse calculation
*/
void testPseudoInverse( void )
{
#ifdef OW_USE_OSSIM
{
const size_t nbRows = 3, nbCols = 3;
const double a = 1.2, b = 2.3, c = 3.4,
d = 4.5, e = 5.6, f = 6.7,
g = 3.4, h = 1.2, i = 7.0;
WMatrix< double > A( nbRows, nbCols );
WMatrix_2 A( nbRows, nbCols );
A( 0, 0 ) = a;
A( 0, 1 ) = b;
......@@ -197,12 +237,12 @@ public:
A( 2, 0 ) = g;
A( 2, 1 ) = h;
A( 2, 2 ) = i;
WMatrix<double> Ainvers( pseudoInverse( A ) );
WMatrix<double> I( A*Ainvers );
WMatrix_2 Ainvers( pseudoInverse( A ) );
WMatrix_2 I( A*Ainvers );
for ( size_t row = 0; row < I.getNbRows(); row++ )
for ( size_t row = 0; row < I.rows(); row++ )
{
for ( size_t col = 0; col < I.getNbCols(); col++ )
for ( size_t col = 0; col < I.cols(); col++ )
{
if ( row == col )
{
......@@ -216,7 +256,7 @@ public:
}
}
{
WMatrix< double > m( 6, 6 );
WMatrix_2 m( 6, 6 );
for( int j = 0; j < 6; ++j )
{
for( int i = 0; i < 6; ++i )
......@@ -233,7 +273,6 @@ public:
}
}
}
#endif
}
};
......
......@@ -27,10 +27,20 @@
#include <vector>
// the following block is only for the last termporarly test
// #include <boost/nondet_random.hpp>
// #include <boost/random.hpp>
// #include <boost/random/normal_distribution.hpp>
// #include <boost/random/uniform_real.hpp>
// #include <boost/random/linear_congruential.hpp>
// #include <boost/random/uniform_real.hpp>
// #include <boost/random/variate_generator.hpp>
#include <cxxtest/TestSuite.h>
#include "../WMatrix.h"
#include "../WValue.h"
#include "../WVector3D.h"
#include "../WGeometryFunctions.h"
#include "../WSymmetricSphericalHarmonic.h"
......@@ -51,8 +61,8 @@ public:
*/
void testCalcFRTMatrix( void )
{
WMatrix<double> result( WSymmetricSphericalHarmonic::calcFRTMatrix( 4 ) );
WMatrix<double> reference( 15, 15 );
WMatrix_2 result( WSymmetricSphericalHarmonic::calcFRTMatrix( 4 ) );
WMatrix_2 reference( 15, 15 );
// j 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
// lj 0 2 2 2 2 2 4 4 4 4 4 4 4 4 4
reference( 0, 0 ) = 2.0 * piDouble;
......@@ -73,8 +83,8 @@ public:
*/
void testCalcSmoothingMatrix( void )
{
WMatrix<double> result( WSymmetricSphericalHarmonic::calcSmoothingMatrix( 4 ) );
WMatrix<double> reference( 15, 15 );
WMatrix_2 result( WSymmetricSphericalHarmonic::calcSmoothingMatrix( 4 ) );
WMatrix_2 reference( 15, 15 );
// j 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
// lj 0 2 2 2 2 2 4 4 4 4 4 4 4 4 4
reference( 0, 0 ) = 0.0;
......@@ -96,7 +106,7 @@ public:
void testCalcSHtoTensorMatrix()
{
#ifdef OW_USE_OSSIM
WValue< double > w( 6 );
WVector_2 w( 6 );
for( int i = 0; i < 6; ++i )
{
w[ i ] = exp( i / 6.0 );
......@@ -114,11 +124,13 @@ public:
orientations.push_back( WUnitSphereCoordinates( WVector3D( 0.0, 0.0, -4.0 ).normalized() ) );
orientations.push_back( WUnitSphereCoordinates( WVector3D( 0.0, 4.0, 1.0 ).normalized() ) );
WMatrix< double > SHToTensor = WSymmetricSphericalHarmonic::calcSHToTensorSymMatrix( 2, orientations );
WTensorSym< 2, 3, double > t( SHToTensor * w );
WMatrix_2 SHToTensor = WSymmetricSphericalHarmonic::calcSHToTensorSymMatrix( 2, orientations );
// TODO(all): remove the WValue from the following line, when WTensorSym supports WVector_2
WTensorSym< 2, 3, double > t( WValue<double>( SHToTensor * w ) );
for( std::vector< WUnitSphereCoordinates >::iterator it = orientations.begin();
it != orientations.end(); ++it )
it != orientations.end();
++it )
{
TS_ASSERT_DELTA( i.getValue( *it ), evaluateSphericalFunction( t, it->getEuclidean() ), 0.001 );
}
......@@ -146,18 +158,18 @@ public:
}
grad.clear();
WValue< double > values( 15 );
WVector_2 values( 15 );
for( std::size_t i = 0; i < 15; ++i )
{
values[ i ] = i / 15.0;
}
WSymmetricSphericalHarmonic sh( values );
WValue< std::complex< double > > values2 = sh.getCoefficientsComplex();
WVectorComplex_2 values2 = sh.getCoefficientsComplex();
WMatrix< std::complex< double > > complexBaseMatrix = WSymmetricSphericalHarmonic::calcComplexBaseMatrix( orientations, 4 );
WMatrixComplex_2 complexBaseMatrix = WSymmetricSphericalHarmonic::calcComplexBaseMatrix( orientations, 4 );
WValue< std::complex< double > > res = complexBaseMatrix * values2;
WVectorComplex_2 res = complexBaseMatrix * values2;
for( std::size_t k = 0; k < orientations.size(); ++k )
{
......
......@@ -24,10 +24,13 @@
#include <stdint.h>
#include <cmath>
#include <string>
#include <vector>
#include "../common/WAssert.h"
#include "../common/math/WVector3D.h"
#include "../common/math/WPosition.h"
#include "WDataSetSingle.h"
#include "WDataSetSphericalHarmonics.h"
......@@ -38,6 +41,7 @@ WDataSetSphericalHarmonics::WDataSetSphericalHarmonics( boost::shared_ptr< WValu
boost::shared_ptr< WGrid > newGrid ) :
WDataSetSingle( newValueSet, newGrid ), m_valueSet( newValueSet )
{
m_gridRegular3D = boost::shared_dynamic_cast< WGridRegular3D >( newGrid );
WAssert( newValueSet, "No value set given." );
WAssert( newGrid, "No grid given." );
}
......@@ -78,12 +82,10 @@ boost::shared_ptr< WPrototyped > WDataSetSphericalHarmonics::getPrototype()
WSymmetricSphericalHarmonic WDataSetSphericalHarmonics::interpolate( const WPosition& pos, bool* success ) const
{
boost::shared_ptr< WGridRegular3D > grid = boost::shared_dynamic_cast< WGridRegular3D >( m_grid );
*success = grid->encloses( pos );
*success = m_gridRegular3D->encloses( pos );
bool isInside = true;
size_t cellId = grid->getCellId( pos, &isInside );
size_t cellId = m_gridRegular3D->getCellId( pos, &isInside );
if( !isInside )
{
......@@ -92,13 +94,13 @@ WSymmetricSphericalHarmonic WDataSetSphericalHarmonics::interpolate( const WPosi
}
// ids of vertices for interpolation
std::vector< size_t > vertexIds = grid->getCellVertexIds( cellId );
std::vector< size_t > vertexIds = m_gridRegular3D->getCellVertexIds( cellId );
WPosition localPos = pos - grid->getPosition( vertexIds[0] );
WPosition localPos = pos - m_gridRegular3D->getPosition( vertexIds[0] );
double lambdaX = localPos[0] / grid->getOffsetX();
double lambdaY = localPos[1] / grid->getOffsetY();
double lambdaZ = localPos[2] / grid->getOffsetZ();
double lambdaX = localPos[0] / m_gridRegular3D->getOffsetX();
double lambdaY = localPos[1] / m_gridRegular3D->getOffsetY();
double lambdaZ = localPos[2] / m_gridRegular3D->getOffsetZ();
std::vector< double > h( 8 );
// lZ lY
// | /
......@@ -119,10 +121,10 @@ WSymmetricSphericalHarmonic WDataSetSphericalHarmonics::interpolate( const WPosi
h[7] = ( lambdaX ) * ( lambdaY ) * ( lambdaZ );
// take
WValue< double > interpolatedCoefficients( m_valueSet->dimension() );
WVector_2 interpolatedCoefficients( m_valueSet->dimension() );
for( size_t i = 0; i < 8; ++i )
{
interpolatedCoefficients += h[i] * m_valueSet->getWValueDouble( vertexIds[i] );
interpolatedCoefficients += h[i] * m_valueSet->getWVector( vertexIds[i] );
}
*success = true;
......@@ -132,7 +134,7 @@ WSymmetricSphericalHarmonic WDataSetSphericalHarmonics::interpolate( const WPosi
WSymmetricSphericalHarmonic WDataSetSphericalHarmonics::getSphericalHarmonicAt( size_t index ) const
{
if ( index < m_valueSet->size() ) return WSymmetricSphericalHarmonic( m_valueSet->getWValueDouble( index ) );
if ( index < m_valueSet->size() ) return WSymmetricSphericalHarmonic( m_valueSet->getWVector( index ) );
return WSymmetricSphericalHarmonic();
}
......
......@@ -145,6 +145,7 @@ protected:
static boost::shared_ptr< WPrototyped > m_prototype;
private:
boost::shared_ptr< WGridRegular3D > m_gridRegular3D;
boost::shared_ptr< WValueSetBase > m_valueSet;