BALL
1.4.2
|
#include <BALL/MATHS/FFT3D.h>
Public Types | |
typedef std::complex< typename ComplexTraits::ComplexPrecision > | Complex |
typedef TRegularData3D < std::complex< typename ComplexTraits::ComplexPrecision > > | ComplexVector |
Public Types inherited from BALL::TRegularData3D< 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 TVector3< 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 | |
Constructors and Destructors | |
TFFT3D () | |
Default constructor. More... | |
TFFT3D (const TFFT3D &data) | |
Copy constructor. More... | |
TFFT3D (Size ldnX, Size ldnY, Size ldnZ, double stepPhysX=1., double stepPhysY=1., double stepPhysZ=1., Vector3 origin=Vector3(0., 0., 0), bool inFourierSpace=false) | |
virtual | ~TFFT3D () |
Destructor. More... | |
Assignment | |
const TFFT3D & | operator= (const TFFT3D &fft_3d) |
Assignment operator. More... | |
virtual void | clear () |
virtual void | destroy () |
Predicates | |
bool | operator== (const TFFT3D &fft3d) const |
bool | isInFourierSpace () const |
void | doFFT () |
void | doiFFT () |
bool | translate (const Vector3 &trans_origin) |
bool | setPhysStepWidth (double new_width_x, double new_width_y, double new_width_z) |
double | getPhysStepWidthX () const |
double | getPhysStepWidthY () const |
double | getPhysStepWidthZ () const |
double | getFourierStepWidthX () const |
double | getFourierStepWidthY () const |
double | getFourierStepWidthZ () const |
double | getPhysSpaceMinX () const |
double | getPhysSpaceMinY () const |
double | getPhysSpaceMinZ () const |
double | getPhysSpaceMaxX () const |
double | getPhysSpaceMaxY () const |
double | getPhysSpaceMaxZ () const |
double | getFourierSpaceMinX () const |
double | getFourierSpaceMinY () const |
double | getFourierSpaceMinZ () const |
double | getFourierSpaceMaxX () const |
double | getFourierSpaceMaxY () const |
double | getFourierSpaceMaxZ () const |
Size | getMaxXIndex () const |
Size | getMaxYIndex () const |
Size | getMaxZIndex () const |
Size | getNumberOfInverseTransforms () const |
Vector3 | getGridCoordinates (Position position) const |
Complex | getData (const Vector3 &pos) const |
Complex | getInterpolatedValue (const Vector3 &pos) const |
void | setData (const Vector3 &pos, Complex val) |
Complex & | operator[] (const Vector3 &pos) |
const Complex & | operator[] (const Vector3 &pos) const |
Complex & | operator[] (const Position &pos) |
const Complex & | operator[] (const Position &pos) const |
void | setNumberOfFFTTransforms (Size num) |
void | setNumberOfiFFTTransforms (Size num) |
Complex | phase (const Vector3 &pos) const |
Public Member Functions inherited from BALL::TRegularData3D< std::complex< ComplexTraits::ComplexPrecision > > | |
BALL_INLINE bool | isOrthogonal () const |
State whether grid is orthogonal or not. More... | |
TRegularData3D () | |
TRegularData3D (const TRegularData3D< std::complex< ComplexTraits::ComplexPrecision > > &grid) | |
TRegularData3D (const CoordinateType &origin, const CoordinateType &dimension, const CoordinateType &spacing) | |
TRegularData3D (const CoordinateType &origin, const CoordinateType &x_axis, const CoordinateType &y_axis, const CoordinateType &z_axis, const IndexType &size) | |
TRegularData3D (const IndexType &size, const CoordinateType &origin=CoordinateType(0.0), const CoordinateType &dimension=CoordinateType(1.0)) | |
virtual | ~TRegularData3D () |
TRegularData3D & | operator= (const TRegularData3D< std::complex< ComplexTraits::ComplexPrecision > > &data) |
bool | operator== (const TRegularData3D< std::complex< ComplexTraits::ComplexPrecision > > &grid) const |
BALL_INLINE bool | operator!= (const TRegularData3D< std::complex< ComplexTraits::ComplexPrecision > > &grid) const |
BALL_INLINE bool | empty () const |
Empty predicate. More... | |
bool | isInside (const CoordinateType &r) 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 (TRegularData3D< std::complex< ComplexTraits::ComplexPrecision > > &grid) |
const vector< std::complex < ComplexTraits::ComplexPrecision > > & | getData () const |
Get the full data. More... | |
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 | getClosestIndex (const CoordinateType &v) const |
IndexType | getLowerIndex (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 &size) |
void | rescale (const IndexType &new_size) |
CoordinateType | getCoordinates (const IndexType &index) const |
CoordinateType | getCoordinates (Position index) const |
void | getEnclosingIndices (const CoordinateType &r, Position &llf, Position &rlf, Position &luf, Position &ruf, Position &llb, Position &rlb, Position &lub, Position &rub) const |
void | getEnclosingValues (const CoordinateType &r, std::complex< ComplexTraits::ComplexPrecision > &llf, std::complex< ComplexTraits::ComplexPrecision > &rlf, std::complex< ComplexTraits::ComplexPrecision > &luf, std::complex< ComplexTraits::ComplexPrecision > &ruf, std::complex< ComplexTraits::ComplexPrecision > &llb, std::complex< ComplexTraits::ComplexPrecision > &rlb, std::complex< ComplexTraits::ComplexPrecision > &lub, std::complex< ComplexTraits::ComplexPrecision > &rub) const |
std::complex < ComplexTraits::ComplexPrecision > | calculateMean () const |
std::complex < ComplexTraits::ComplexPrecision > | calculateSD () const |
void | binaryWrite (const String &filename) const |
void | binaryWriteRaw (const String &filename) const |
void | binaryRead (const String &filename) |
Additional Inherited Members | |
Protected Member Functions inherited from BALL::TRegularData3D< std::complex< ComplexTraits::ComplexPrecision > > | |
const CoordinateType | mapToCartesian_ (CoordinateType r) const |
map indices to Cartesian coordinates More... | |
const CoordinateType | mapInverse_ (CoordinateType r) const |
map Cartesian coordinates to indices (note: this does not yet convert the double values to Index) More... | |
A class to perform Fast Fourier Transforms and inverse Fast Fourier Transforms on regularly spaced three dimensional data.
typedef std::complex<typename ComplexTraits::ComplexPrecision> BALL::TFFT3D< ComplexTraits >::Complex |
typedef TRegularData3D<std::complex<typename ComplexTraits::ComplexPrecision> > BALL::TFFT3D< ComplexTraits >::ComplexVector |
BALL::TFFT3D< ComplexTraits >::TFFT3D | ( | ) |
BALL::TFFT3D< ComplexTraits >::TFFT3D | ( | const TFFT3D< ComplexTraits > & | data | ) |
Copy constructor.
BALL::TFFT3D< ComplexTraits >::TFFT3D | ( | Size | ldnX, |
Size | ldnY, | ||
Size | ldnZ, | ||
double | stepPhysX = 1. , |
||
double | stepPhysY = 1. , |
||
double | stepPhysZ = 1. , |
||
Vector3 | origin = Vector3(0., 0., 0) , |
||
bool | inFourierSpace = false |
||
) |
Detailed constructor.
ldnX | The binary logarithm of the number of grid points in X direction (we use the logarithm to ensure that the number of points is a power of two, which is important for the FFT) |
ldnY | The binary logarithm of the number of grid points in Y direction |
ldnZ | The binary logarithm of the number of grid points in Z direction |
stepPhysX | The step width in X direction in physical space |
stepPhysY | The step width in Y direction in physical space |
stepPhysZ | The step width in Z 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::TRegularData3D< std::complex< ComplexTraits::ComplexPrecision > >.
|
virtual |
Clear the contents and reset all attributes.
void BALL::TFFT3D< ComplexTraits >::doFFT | ( | ) |
Perform a single fast Fourier transform on the data.
void BALL::TFFT3D< ComplexTraits >::doiFFT | ( | ) |
Perform a single inverse Fourier transform on the data.
TFFT3D< ComplexTraits >::Complex BALL::TFFT3D< ComplexTraits >::getData | ( | const Vector3 & | 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::TFFT3D< ComplexTraits >::getFourierSpaceMaxX | ( | ) | const |
double BALL::TFFT3D< ComplexTraits >::getFourierSpaceMaxY | ( | ) | const |
double BALL::TFFT3D< ComplexTraits >::getFourierSpaceMaxZ | ( | ) | const |
double BALL::TFFT3D< ComplexTraits >::getFourierSpaceMinX | ( | ) | const |
double BALL::TFFT3D< ComplexTraits >::getFourierSpaceMinY | ( | ) | const |
double BALL::TFFT3D< ComplexTraits >::getFourierSpaceMinZ | ( | ) | const |
double BALL::TFFT3D< ComplexTraits >::getFourierStepWidthX | ( | ) | const |
double BALL::TFFT3D< ComplexTraits >::getFourierStepWidthY | ( | ) | const |
double BALL::TFFT3D< ComplexTraits >::getFourierStepWidthZ | ( | ) | const |
Vector3 BALL::TFFT3D< ComplexTraits >::getGridCoordinates | ( | Position | position | ) | const |
TFFT3D< ComplexTraits >::Complex BALL::TFFT3D< ComplexTraits >::getInterpolatedValue | ( | const Vector3 & | 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::TFFT3D< ComplexTraits >::getMaxXIndex | ( | ) | const |
Size BALL::TFFT3D< ComplexTraits >::getMaxYIndex | ( | ) | const |
Size BALL::TFFT3D< ComplexTraits >::getMaxZIndex | ( | ) | const |
Size BALL::TFFT3D< ComplexTraits >::getNumberOfInverseTransforms | ( | ) | const |
double BALL::TFFT3D< ComplexTraits >::getPhysSpaceMaxX | ( | ) | const |
double BALL::TFFT3D< ComplexTraits >::getPhysSpaceMaxY | ( | ) | const |
double BALL::TFFT3D< ComplexTraits >::getPhysSpaceMaxZ | ( | ) | const |
double BALL::TFFT3D< ComplexTraits >::getPhysSpaceMinX | ( | ) | const |
double BALL::TFFT3D< ComplexTraits >::getPhysSpaceMinY | ( | ) | const |
double BALL::TFFT3D< ComplexTraits >::getPhysSpaceMinZ | ( | ) | const |
double BALL::TFFT3D< ComplexTraits >::getPhysStepWidthX | ( | ) | const |
double BALL::TFFT3D< ComplexTraits >::getPhysStepWidthY | ( | ) | const |
double BALL::TFFT3D< ComplexTraits >::getPhysStepWidthZ | ( | ) | const |
bool BALL::TFFT3D< ComplexTraits >::isInFourierSpace | ( | ) | const |
const TFFT3D& BALL::TFFT3D< ComplexTraits >::operator= | ( | const TFFT3D< ComplexTraits > & | fft_3d | ) |
Assignment operator.
bool BALL::TFFT3D< ComplexTraits >::operator== | ( | const TFFT3D< ComplexTraits > & | fft3d | ) | const |
TFFT3D< ComplexTraits >::Complex & BALL::TFFT3D< ComplexTraits >::operator[] | ( | const Vector3 & | 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 TFFT3D< ComplexTraits >::Complex & BALL::TFFT3D< ComplexTraits >::operator[] | ( | const Vector3 & | 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 |
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 |
TFFT3D< ComplexTraits >::Complex BALL::TFFT3D< ComplexTraits >::phase | ( | const Vector3 & | pos | ) | const |
void BALL::TFFT3D< ComplexTraits >::setData | ( | const Vector3 & | 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::TFFT3D< ComplexTraits >::setPhysStepWidth | ( | double | new_width_x, |
double | new_width_y, | ||
double | new_width_z | ||
) |
Set the step width in physical space to {new_width_x, new_width_y, new_width_z}. The step width in Fourier space is automatically adjusted accordingly. {new_width_x, new_width_y and new_width_z} must be positive, otherwise the function does nothing and retuns false .
bool BALL::TFFT3D< ComplexTraits >::translate | ( | const Vector3 & | trans_origin | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |