- typedef typename I::PointType _P;
-
- std::vector< _P > path;
- std::vector< V > vertices = this->GetPath( a, b );
- for( unsigned int i = 0; i < vertices.size( ); ++i )
- {
- _P p;
- image->TransformIndexToPhysicalPoint( vertices[ i ], p );
- path.push_back( p );
-
- } // rof
-
- // Lowpass filter
- if( kernel > 0 )
- {
- int k = int( kernel ) >> 1;
- std::vector< _P > lowpass_path;
- for( unsigned int i = 0; i < path.size( ); ++i )
- {
- _P p;
- p.Fill( ( typename _P::ValueType )( 0 ) );
- unsigned int c = 0;
- for( int j = -k; j <= k; ++j )
- {
- int l = int( i ) + j;
- if( l >= 0 && l < path.size( ) )
- {
- p += path[ l ].GetVectorFromOrigin( );
- c++;
-
- } // fi
-
- } // rof
- if( c > 0 )
- for( unsigned int d = 0; d < _P::PointDimension; ++d )
- p[ d ] /= ( typename _P::ValueType )( c );
- lowpass_path.push_back( p );
-
- } // rof
-
- path = lowpass_path;
-
- } // fi
- return( path );