-// -------------------------------------------------------------------------
-/* TODO
- template< class _TImage >
- void fpaPluginsExperiments::InsertNoiseIntoPoints::
- _GD0( _TImage* image )
- {
- typedef fpa::Image::InsertNoiseIntoPoints< _TImage > _TFilter;
- auto filter = this->_CreateITK< _TFilter >( );
- filter->SetInput( image );
-
- if( seeds != NULL )
- {
- typename _TImage::PointType pnt;
- typename _TImage::IndexType idx;
- unsigned int dim =
- ( _TImage::ImageDimension < 3 )? _TImage::ImageDimension: 3;
-
- for( int i = 0; i < seeds->GetNumberOfPoints( ); ++i )
- {
- double buf[ 3 ];
- seeds->GetPoint( i, buf );
- pnt.Fill( 0 );
- for( unsigned int d = 0; d < dim; ++d )
- pnt[ d ] = buf[ d ];
-
- if( image->TransformPhysicalPointToIndex( pnt, idx ) )
- filter->AddSeed( idx, 0 );
+ if( this->m_Parameters.GetBool( "InsertNoise" ) )
+ {
+ int ijk[ 3 ];
+ dmap->ComputeStructuredCoordinates( buf, ijk, pcoords );
+ double radius =
+ dmap->GetScalarComponentAsDouble( ijk[ 0 ], ijk[ 1 ], ijk[ 2 ], 0 );
+ double rad_dis = _TDist( 1e-5, radius * 0.9 )( gen );
+ double the_dis = _TDist( 0, 3.14159265359 )( gen );
+ double phi_dis = _TDist( 0, 6.28318530718 )( gen );
+ buf[ 0 ] += rad_dis * std::sin( the_dis ) * std::cos( phi_dis );
+ buf[ 1 ] += rad_dis * std::sin( the_dis ) * std::sin( phi_dis );
+ buf[ 2 ] += rad_dis * std::cos( the_dis );