BALL
1.5.0
|
#include <BALL/MATHS/FFT3D.h>
Public Types | |
typedef std::complex< typename ComplexTraits::ComplexPrecision > | Complex |
typedef TRegularData3D< std::complex< typename ComplexTraits::ComplexPrecision > > | ComplexVector |
![]() | |
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... | |
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 |
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 () |
![]() | |
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 bool | isOrthogonal () const |
State whether grid is orthogonal or not. 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 | |
![]() | |
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... | |
![]() | |
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... | |
bool | is_orthogonal_ |
A flag deciding whether the grid is orthogonal or not. More... | |
std::vector< double > | mapping_ |
mapping matrix and its inverse More... | |
std::vector< double > | inverse_mapping_ |
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 |
double BALL::TFFT3D< ComplexTraits >::getFourierSpaceMaxY |
double BALL::TFFT3D< ComplexTraits >::getFourierSpaceMaxZ |
double BALL::TFFT3D< ComplexTraits >::getFourierSpaceMinX |
double BALL::TFFT3D< ComplexTraits >::getFourierSpaceMinY |
double BALL::TFFT3D< ComplexTraits >::getFourierSpaceMinZ |
double BALL::TFFT3D< ComplexTraits >::getFourierStepWidthX |
double BALL::TFFT3D< ComplexTraits >::getFourierStepWidthY |
double BALL::TFFT3D< ComplexTraits >::getFourierStepWidthZ |
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 |
Size BALL::TFFT3D< ComplexTraits >::getMaxYIndex |
Size BALL::TFFT3D< ComplexTraits >::getMaxZIndex |
Size BALL::TFFT3D< ComplexTraits >::getNumberOfInverseTransforms |
double BALL::TFFT3D< ComplexTraits >::getPhysSpaceMaxX |
double BALL::TFFT3D< ComplexTraits >::getPhysSpaceMaxY |
double BALL::TFFT3D< ComplexTraits >::getPhysSpaceMaxZ |
double BALL::TFFT3D< ComplexTraits >::getPhysSpaceMinX |
double BALL::TFFT3D< ComplexTraits >::getPhysSpaceMinY |
double BALL::TFFT3D< ComplexTraits >::getPhysSpaceMinZ |
double BALL::TFFT3D< ComplexTraits >::getPhysStepWidthX |
double BALL::TFFT3D< ComplexTraits >::getPhysStepWidthY |
double BALL::TFFT3D< ComplexTraits >::getPhysStepWidthZ |
bool BALL::TFFT3D< ComplexTraits >::isInFourierSpace |
const TFFT3D& BALL::TFFT3D< ComplexTraits >::operator= | ( | const TFFT3D< ComplexTraits > & | fft_3d | ) |
Assignment operator.
bool BALL::TFFT3D< ComplexTraits >::operator== | ( | const TFFT3D< ComplexTraits > & | fft3d | ) | const |
|
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 >::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 |
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 |