#define DEBUGing #include "itkSWaveletTest.h" #include #include int main( int argc, char * argv [] ) { if (argc != 3) { cerr<<"format: itkSWaveletTest levelOfWaveletFn levelOfSubdivision"<=7 || n<0 || w<=0 || w>n ) { std::cerr<<"Finest resolution should be from 0 to 6. Level of wavelet function should be greater or equal to 1 and less or equal than finest resolution."<SetCenter( center ); mySphereMeshSource->SetResolution( n ); mySphereMeshSource->SetScale( scale ); mySphereMeshSource->Modified(); try { mySphereMeshSource->Update(); } catch( itk::ExceptionObject & excp ) { std::cerr << "Error during Update() " << std::endl; std::cerr << excp << std::endl; } // testing task 4: std::cerr<<"testing task 4:"< v = mySphereMeshSource->GetVerts(); std::vector< PointType >::const_iterator itv = v.begin(); std::vector< PointType >::const_iterator itvEnd = v.end(); std::vector< double > f( v.size() ); std::vector< double >::iterator itf = f.begin(); for ( ; itv != itvEnd; ++itv, ++itf ) { *itf = (*itv)[2]; } mySphereMeshSource->SetScalarFunction( f ); mySphereMeshSource->SWaveletTransform(); mySphereMeshSource->SetAllCoarsestScalingCoefficients(0); mySphereMeshSource->SetAllWaveletCoefficientsOfAllScales(0); mySphereMeshSource->SetWaveletCoefficientAtScale(w, 0, 1); mySphereMeshSource->inverseSWaveletTransform(); mySphereMeshSource->WriteReconstructedScalarFunctionForKWVisu("WaveletFnKWVisu.txt"); return EXIT_SUCCESS; }