BALL
1.4.79
|
#include <BALL/MATHS/FFT2D.h>
Public Types | |
typedef std::complex< typename ComplexTraits::ComplexPrecision > | Complex |
typedef TRegularData2D < std::complex< typename ComplexTraits::ComplexPrecision > > | ComplexVector |
typedef TRegularData2D < std::complex< typename ComplexTraits::ComplexPrecision > >::IndexType | IndexType |
Public Types inherited from BALL::TRegularData2D< std::complex< ComplexTraits::ComplexPrecision > > | |
typedef std::complex < ComplexTraits::ComplexPrecision > | value_type |
typedef std::vector < std::complex < ComplexTraits::ComplexPrecision > >::iterator | iterator |
typedef std::vector < std::complex < ComplexTraits::ComplexPrecision > >::const_iterator | const_iterator |
typedef std::vector < std::complex < ComplexTraits::ComplexPrecision > >::reference | reference |
typedef std::vector < std::complex < ComplexTraits::ComplexPrecision > >::const_reference | const_reference |
typedef std::vector < std::complex < ComplexTraits::ComplexPrecision > >::pointer | pointer |
typedef std::vector < std::complex < ComplexTraits::ComplexPrecision > >::difference_type | difference_type |
typedef std::vector < std::complex < ComplexTraits::ComplexPrecision > >::size_type | size_type |
typedef std::vector < std::complex < ComplexTraits::ComplexPrecision > > | VectorType |
The type containing an STL vector of the appropriate type. More... | |
typedef TVector2< float > | CoordinateType |
The coordinate type. More... | |
typedef std::vector < std::complex < ComplexTraits::ComplexPrecision > >::iterator | Iterator |
A mutable iterator. More... | |
typedef std::vector < std::complex < ComplexTraits::ComplexPrecision > >::const_iterator | ConstIterator |
A nonmutable iterator. More... | |
Public Member Functions | |
void | doFFT () |
void | doiFFT () |
bool | translate (const Vector2 &trans_origin) |
bool | setPhysStepWidth (double new_width_x, double new_width_y) |
double | getPhysStepWidthX () const |
double | getPhysStepWidthY () const |
double | getFourierStepWidthX () const |
double | getFourierStepWidthY () const |
double | getPhysSpaceMinX () const |
double | getPhysSpaceMinY () const |
double | getPhysSpaceMaxX () const |
double | getPhysSpaceMaxY () const |
double | getFourierSpaceMinX () const |
double | getFourierSpaceMinY () const |
double | getFourierSpaceMaxX () const |
double | getFourierSpaceMaxY () const |
Size | getMaxXIndex () const |
Size | getMaxYIndex () const |
Size | getNumberOfInverseTransforms () const |
Vector2 | getGridCoordinates (Position position) const |
Complex | getData (const Vector2 &pos) const |
Complex | getInterpolatedValue (const Vector2 &pos) const |
void | setData (const Vector2 &pos, Complex val) |
Complex & | operator[] (const Vector2 &pos) |
const Complex & | operator[] (const Vector2 &pos) const |
const Complex & | operator[] (const IndexType &index) const |
Complex & | operator[] (const IndexType &index) |
Complex & | operator[] (const Position &pos) |
const Complex & | operator[] (const Position &pos) const |
void | setNumberOfFFTTransforms (Size num) |
void | setNumberOfiFFTTransforms (Size num) |
Complex | phase (const Vector2 &pos) const |
bool | isInFourierSpace () const |
Constructors and Destructors | |
TFFT2D () | |
Default constructor. More... | |
TFFT2D (const TFFT2D &data) | |
Copy constructor. More... | |
TFFT2D (Size nX, Size nY, double stepPhysX=1., double stepPhysY=1., Vector2 origin=Vector2(0., 0.), bool inFourierSpace=false) | |
virtual | ~TFFT2D () |
Destructor. More... | |
Assignment | |
const TFFT2D & | operator= (const TFFT2D &fft_2d) |
Assignment operator. More... | |
virtual void | clear () |
virtual void | destroy () |
Predicates | |
bool | operator== (const TFFT2D &fft_2d) const |
Public Member Functions inherited from BALL::TRegularData2D< std::complex< ComplexTraits::ComplexPrecision > > | |
TRegularData2D () | |
TRegularData2D (const TRegularData2D< std::complex< ComplexTraits::ComplexPrecision > > &data) | |
TRegularData2D (const CoordinateType &origin, const CoordinateType &dimension, const CoordinateType &spacing) | |
TRegularData2D (const IndexType &size, const CoordinateType &origin=CoordinateType(0.0), const CoordinateType &dimension=CoordinateType(1.0)) | |
virtual | ~TRegularData2D () |
TRegularData2D & | operator= (const TRegularData2D< std::complex< ComplexTraits::ComplexPrecision > > &data) |
bool | operator== (const TRegularData2D< std::complex< ComplexTraits::ComplexPrecision > > &data) const |
BALL_INLINE bool | operator!= (const TRegularData2D< std::complex< ComplexTraits::ComplexPrecision > > &data) const |
Inequality operator. More... | |
BALL_INLINE bool | empty () const |
Empty predicate. More... | |
bool | isInside (const CoordinateType &x) const |
Test if a given point is inside the grid. More... | |
BALL_INLINE ConstIterator | begin () const |
BALL_INLINE Iterator | begin () |
BALL_INLINE ConstIterator | end () const |
BALL_INLINE Iterator | end () |
BALL_INLINE size_type | size () const |
BALL_INLINE size_type | max_size () const |
BALL_INLINE void | swap (TRegularData2D< std::complex< ComplexTraits::ComplexPrecision > > &data) |
const std::complex < ComplexTraits::ComplexPrecision > & | getData (const IndexType &index) const |
std::complex < ComplexTraits::ComplexPrecision > & | getData (const IndexType &index) |
const std::complex < ComplexTraits::ComplexPrecision > & | getData (Position index) const |
std::complex < ComplexTraits::ComplexPrecision > & | getData (Position index) |
const std::complex < ComplexTraits::ComplexPrecision > & | operator[] (const IndexType &index) const |
std::complex < ComplexTraits::ComplexPrecision > & | operator[] (const IndexType &index) |
const std::complex < ComplexTraits::ComplexPrecision > & | operator[] (Position index) const |
std::complex < ComplexTraits::ComplexPrecision > & | operator[] (Position index) |
std::complex < ComplexTraits::ComplexPrecision > | operator() (const CoordinateType &x) const |
std::complex < ComplexTraits::ComplexPrecision > | getInterpolatedValue (const CoordinateType &x) const |
const std::complex < ComplexTraits::ComplexPrecision > & | getClosestValue (const CoordinateType &x) const |
std::complex < ComplexTraits::ComplexPrecision > & | getClosestValue (const CoordinateType &x) |
IndexType | getLowerIndex (const CoordinateType &v) const |
IndexType | getClosestIndex (const CoordinateType &v) const |
const IndexType & | getSize () const |
const CoordinateType & | getOrigin () const |
const CoordinateType & | getSpacing () const |
void | setOrigin (const CoordinateType &origin) |
const CoordinateType & | getDimension () const |
void | setDimension (const CoordinateType &dimension) |
void | resize (const IndexType &new_size) |
void | rescale (const IndexType &new_size) |
CoordinateType | getCoordinates (const IndexType &index) const |
CoordinateType | getCoordinates (Position index) const |
void | getEnclosingIndices (const CoordinateType &r, Position &ll, Position &lr, Position &ul, Position &ur) const |
void | getEnclosingValues (const CoordinateType &r, std::complex< ComplexTraits::ComplexPrecision > &ll, std::complex< ComplexTraits::ComplexPrecision > &lr, std::complex< ComplexTraits::ComplexPrecision > &ul, std::complex< ComplexTraits::ComplexPrecision > &ur) const |
std::complex < ComplexTraits::ComplexPrecision > | calculateMean () const |
std::complex < ComplexTraits::ComplexPrecision > | calculateSD () const |
void | binaryWrite (const String &filename) const |
void | binaryRead (const String &filename) |
Protected Attributes | |
Size | lengthX_ |
Size | lengthY_ |
bool | inFourierSpace_ |
Size | numPhysToFourier_ |
Size | numFourierToPhys_ |
Vector2 | origin_ |
double | stepPhysX_ |
double | stepPhysY_ |
double | stepFourierX_ |
double | stepFourierY_ |
Vector2 | minPhys_ |
Vector2 | maxPhys_ |
Vector2 | minFourier_ |
Vector2 | maxFourier_ |
ComplexTraits::FftwPlan | planForward_ |
ComplexTraits::FftwPlan | planBackward_ |
Size | dataLength_ |
Complex * | dataAdress_ |
bool | planCalculated_ |
Protected Attributes inherited from BALL::TRegularData2D< std::complex< ComplexTraits::ComplexPrecision > > | |
VectorType | data_ |
The grid data. More... | |
CoordinateType | origin_ |
Origin of the grid (offset) More... | |
CoordinateType | dimension_ |
Dimension of the grid. More... | |
CoordinateType | spacing_ |
Grid spacing. More... | |
IndexType | size_ |
The dimensions in grid points. More... | |
A class to perform Fast Fourier Transforms and inverse Fast Fourier Transforms on regularly spaced two dimensional data.
typedef std::complex<typename ComplexTraits::ComplexPrecision> BALL::TFFT2D< ComplexTraits >::Complex |
typedef TRegularData2D<std::complex<typename ComplexTraits::ComplexPrecision> > BALL::TFFT2D< ComplexTraits >::ComplexVector |
typedef TRegularData2D<std::complex<typename ComplexTraits::ComplexPrecision> >::IndexType BALL::TFFT2D< ComplexTraits >::IndexType |
BALL::TFFT2D< ComplexTraits >::TFFT2D | ( | ) |
BALL::TFFT2D< ComplexTraits >::TFFT2D | ( | const TFFT2D< ComplexTraits > & | data | ) |
Copy constructor.
BALL::TFFT2D< ComplexTraits >::TFFT2D | ( | Size | nX, |
Size | nY, | ||
double | stepPhysX = 1. , |
||
double | stepPhysY = 1. , |
||
Vector2 | origin = Vector2(0., 0.) , |
||
bool | inFourierSpace = false |
||
) |
Detailed constructor.
nX | The number of grid points in X direction |
nY | The number of grid points in Y direction |
stepPhysX | The step width in X direction in physical space |
stepPhysY | The step width in Y direction in physical space |
origin | The origin of the coordinate system |
inFourierSpace | Flag to decide whether the data is assumed to be in physical or fourier space |
|
virtual |
Destructor.
|
virtual |
Clear the contents.
Reimplemented from BALL::TRegularData2D< std::complex< ComplexTraits::ComplexPrecision > >.
|
virtual |
Clear the contents and reset all attributes.
void BALL::TFFT2D< ComplexTraits >::doFFT | ( | ) |
Perform a single fast fourier transform on the data.
void BALL::TFFT2D< ComplexTraits >::doiFFT | ( | ) |
Perform a single inverse fourier transform on the data.
TFFT2D< ComplexTraits >::Complex BALL::TFFT2D< ComplexTraits >::getData | ( | const Vector2 & | pos | ) | const |
Returns the data at the grid position closest to pos , and automatically includes the correct phase factor and (symmetric) normalization.
Exception::OutOfGrid | if pos is outside the grid boundaries |
double BALL::TFFT2D< ComplexTraits >::getFourierSpaceMaxX | ( | ) | const |
double BALL::TFFT2D< ComplexTraits >::getFourierSpaceMaxY | ( | ) | const |
double BALL::TFFT2D< ComplexTraits >::getFourierSpaceMinX | ( | ) | const |
double BALL::TFFT2D< ComplexTraits >::getFourierSpaceMinY | ( | ) | const |
double BALL::TFFT2D< ComplexTraits >::getFourierStepWidthX | ( | ) | const |
double BALL::TFFT2D< ComplexTraits >::getFourierStepWidthY | ( | ) | const |
Vector2 BALL::TFFT2D< ComplexTraits >::getGridCoordinates | ( | Position | position | ) | const |
TFFT2D< ComplexTraits >::Complex BALL::TFFT2D< ComplexTraits >::getInterpolatedValue | ( | const Vector2 & | pos | ) | const |
Returns the data at point pos. If pos is not a point on the grid, the data is linearly interpolated. This method automatically includes the correct phase factor and (symmetric) normalization.
Exception::OutOfGrid | if pos is outside the grid boundaries |
Size BALL::TFFT2D< ComplexTraits >::getMaxXIndex | ( | ) | const |
Size BALL::TFFT2D< ComplexTraits >::getMaxYIndex | ( | ) | const |
Size BALL::TFFT2D< ComplexTraits >::getNumberOfInverseTransforms | ( | ) | const |
double BALL::TFFT2D< ComplexTraits >::getPhysSpaceMaxX | ( | ) | const |
double BALL::TFFT2D< ComplexTraits >::getPhysSpaceMaxY | ( | ) | const |
double BALL::TFFT2D< ComplexTraits >::getPhysSpaceMinX | ( | ) | const |
double BALL::TFFT2D< ComplexTraits >::getPhysSpaceMinY | ( | ) | const |
double BALL::TFFT2D< ComplexTraits >::getPhysStepWidthX | ( | ) | const |
double BALL::TFFT2D< ComplexTraits >::getPhysStepWidthY | ( | ) | const |
bool BALL::TFFT2D< ComplexTraits >::isInFourierSpace | ( | ) | const |
const TFFT2D& BALL::TFFT2D< ComplexTraits >::operator= | ( | const TFFT2D< ComplexTraits > & | fft_2d | ) |
Assignment operator.
bool BALL::TFFT2D< ComplexTraits >::operator== | ( | const TFFT2D< ComplexTraits > & | fft_2d | ) | const |
TFFT2D< ComplexTraits >::Complex & BALL::TFFT2D< ComplexTraits >::operator[] | ( | const Vector2 & | pos | ) |
Access the data at the grid position closest to pos . This function returns the "raw" data at that position.
Exception::OutOfGrid | if pos is outside the grid boundaries |
const TFFT2D< ComplexTraits >::Complex & BALL::TFFT2D< ComplexTraits >::operator[] | ( | const Vector2 & | pos | ) | const |
Access the data at the grid position closest to pos . This function returns the "raw" data at that position.
Exception::OutOfGrid | if pos is outside the grid boundaries |
|
inline |
|
inline |
|
inline |
Access the (raw) data at Position pos.
Exception::OutOfGrid | if pos is outside the grid boundaries |
|
inline |
Access the (raw) data at Position pos. Const method.
Exception::OutOfGrid | if pos is outside the grid boundaries |
TFFT2D< ComplexTraits >::Complex BALL::TFFT2D< ComplexTraits >::phase | ( | const Vector2 & | pos | ) | const |
void BALL::TFFT2D< ComplexTraits >::setData | ( | const Vector2 & | pos, |
Complex | val | ||
) |
Sets the data point at the grid position closest to pos to the value val , and – if called in fourier space – automatically includes the correct phase factor and (symmetric) normalization.
Exception::OutOfGrid | if pos is outside the grid boundaries |
|
inline |
|
inline |
bool BALL::TFFT2D< ComplexTraits >::setPhysStepWidth | ( | double | new_width_x, |
double | new_width_y | ||
) |
bool BALL::TFFT2D< ComplexTraits >::translate | ( | const Vector2 & | trans_origin | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |