clipper::MapFilter_fft< T > Class Template Reference

Simple fft-based radial mapfiltering implementation. More...

#include <mapfilter.h>

Inheritance diagram for clipper::MapFilter_fft< T >:
clipper::MapFilter_base< T >

List of all members.

Public Types

enum  TYPE { NONE, Absolute, Relative }

Scaling modes.

Public Member Functions

 MapFilter_fft (const MapFilterFn_base &fltr, const ftype scale=1.0, const TYPE type=NONE)
 MapFilter_fft (clipper::Xmap< T > &result, const clipper::Xmap< T > &xmap, MapFilterFn_base &fltr, const ftype scale=1.0, const TYPE type=NONE)
 constructor: shorthand for constructor+operator
bool operator() (clipper::Xmap< T > &result, const clipper::Xmap< T > &xmap) const
bool operator() (clipper::NXmap< T > &result, const clipper::NXmap< T > &nxmap) const

Detailed Description

template<class T>
class clipper::MapFilter_fft< T >

Simple fft-based radial mapfiltering implementation.

The FFT method is fast, and also gives good precision.

The following example demonstrates how to use the MapFilter to calculate the local mean and local deviation of an electron density map, in 'xmap':

 make squared map
    clipper::Xmap<float> xmap2( xmap );
    clipper::Xmap<float>::Map_reference_index ix;
    for ( ix = xmap2.first(); !ix.last(); )
      xmap2[ix] = pow( xmap2[ix], 2.0 );

 now calculate local mean, local mean squared
    clipper::MapFilterFn_step fn( filter_radius );
    clipper::MapFilter_fft<float> fltr( fn, 1.0, clipper::MapFilter_fft<float>::Relative );
    clipper::Xmap<float> lmean, lsigm;
    fltr( lmean, xmap );
    fltr( lsigm, xmap2 );

 calculate std deviation
    for ( ix = lmean.first(); !ix.last(); )
      lsigm[ix] = sqrt( lsigm[ix] - pow( lmean[ix], 2.0 ) );

This would be a useful step in solvent mask determination, for example.

Constructor & Destructor Documentation

template<class T >
clipper::MapFilter_fft< T >::MapFilter_fft ( const MapFilterFn_base fltr,
const ftype  scale = 1.0,
const TYPE  type = NONE 
) [inline]


The filter function is constructed with the given filter. Scaling may also be optionally applied. This may be absolute, which just applies a scale factor to the result, or relative, which scales the filter relative to its own integral. Therefore, relative scaling with a scale factor of 1.0 gives an output map on the same scale as the input map.

Note that the filter is not stored internally, and so must persist as long as the MapFilter is required.

fltr The radial filter to apply.
scale The scale factor to apply (default = 1.0).
type The type of scaling to apply: NONE, Absolute, Relative.

Member Function Documentation

template<class T >
bool clipper::MapFilter_fft< T >::operator() ( clipper::Xmap< T > &  result,
const clipper::Xmap< T > &  xmap 
) const [inline, virtual]
template<class T >
bool clipper::MapFilter_fft< T >::operator() ( clipper::NXmap< T > &  result,
const clipper::NXmap< T > &  nxmap 
) const [inline]

The documentation for this class was generated from the following files:

Generated on 4 Jan 2010 for Clipper_contrib by  doxygen 1.6.1