DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::RealFFT< HyperRectDomain< TSpace >, T > Class Template Reference

#include <DGtal/math/RealFFT.h>

Public Types

using Space = TSpace
 Space type.
 
using Real = T
 Real value type.
 
using Domain = HyperRectDomain<Space>
 Domain type.
 
using Point = typename Space::Point
 Point type.
 
using RealPoint = PointVector<Space::dimension, Real>
 Real point type.
 
using Dimension = typename Space::Dimension
 Space dimension type.
 
using Complex = std::complex<Real>
 Complex value type.
 
using Self = RealFFT< Domain, T >
 Self type.
 
using SpatialImage = ArrayImageAdapter< Real*, Domain >
 Mutable spatial image type.
 
using ConstSpatialImage = ArrayImageAdapter< const Real*, Domain >
 Constant spatial image type.
 
using FreqImage = ArrayImageAdapter< Complex*, Domain >
 Mutable frequency image type.
 
using ConstFreqImage = ArrayImageAdapter< const Complex*, Domain >
 Constant frequency image type.
 

Public Member Functions

 RealFFT (Domain const &aDomain)
 
 RealFFT (Domain const &aDomain, RealPoint const &aLowerBound, RealPoint const &anExtent)
 
 RealFFT (Self const &)=delete
 Copy constructor. Deleted.
 
 RealFFT (Self &&)=delete
 Move constructor. Deleted.
 
Selfoperator= (Self const &)=delete
 Copy assignment operator. Deleted.
 
Selfoperator= (Self &&)=delete
 Move assignment operator. Deleted.
 
 ~RealFFT ()
 Destructor.
 
Spatial domain services.
std::size_t getPadding () const noexcept
 
RealgetSpatialStorage () noexcept
 
const RealgetSpatialStorage () const noexcept
 
SpatialImage getSpatialImage () noexcept
 
ConstSpatialImage getSpatialImage () const noexcept
 
Domain const & getSpatialDomain () const noexcept
 
Point const & getSpatialExtent () const noexcept
 Gets the spatial domain extent.
 
Frequency domain services.
ComplexgetFreqStorage () noexcept
 
const ComplexgetFreqStorage () const noexcept
 
FreqImage getFreqImage () noexcept
 
ConstFreqImage getFreqImage () const noexcept
 
Domain const & getFreqDomain () const noexcept
 
Point const & getFreqExtent () const noexcept
 
Fast Fourier Transformations.
void createPlan (unsigned flags, int way)
 
void doFFT (unsigned flags=FFTW_ESTIMATE, int way=FFTW_FORWARD, bool normalized=false)
 
void forwardFFT (unsigned flags=FFTW_ESTIMATE)
 
void backwardFFT (unsigned flags=FFTW_ESTIMATE, bool normalized=true)
 
Spatial scaling definitions.
RealPoint getScaledSpatialExtent () const noexcept
 
void setScaledSpatialExtent (RealPoint const &anExtent) noexcept
 
RealPoint getScaledSpatialLowerBound () const noexcept
 
void setScaledSpatialLowerBound (RealPoint const &aPoint) noexcept
 
Scaling calculators.
RealPoint calcScaledSpatialCoords (Point const &aPoint) const noexcept
 
RealPoint calcScaledFreqCoords (Point const &aPoint) const noexcept
 
Complex calcScaledFreqValue (RealPoint const &aScaledPoint, Complex const &aValue) const noexcept
 
Point calcNativeSpatialCoords (RealPoint const &aScaledPoint) const noexcept
 
Point calcNativeFreqCoords (RealPoint const &aScaledPoint, bool &applyConj) const noexcept
 
Complex calcNativeFreqValue (RealPoint const &aScaledPoint, Complex const &aScaledValue) const noexcept
 
Scaled accessors.
Real getScaledSpatialValue (RealPoint const &aScaledPoint) const noexcept
 
void setScaledSpatialValue (RealPoint const &aScaledPoint, Real aValue) noexcept
 
Complex getScaledFreqValue (RealPoint const &aScaledPoint) const noexcept
 
void setScaledFreqValue (RealPoint const &aScaledPoint, Complex aScaledValue) noexcept
 
DGtal services.
bool isValid () const noexcept
 
void selfDisplay (std::ostream &out) const
 

Data Fields

const Real pi = boost::math::constants::pi<Real>()
 Pi.
 

Static Public Attributes

static const constexpr Dimension dimension = Domain::dimension
 Space dimension.
 

Private Types

using FFTW = detail::FFTWWrapper<T>
 

Private Attributes

const Domain mySpatialDomain
 Spatial domain (real).
 
const Point mySpatialExtent
 Extent of the spatial domain.
 
const Point myFreqExtent
 Extent of the frequential domain.
 
const Domain myFreqDomain
 Frequential domain (complex).
 
const Domain myFullSpatialDomain
 Full spatial domain (real) including the padding.
 
void * myStorage
 Storage.
 
RealPoint myScaledSpatialExtent
 Extent of the scaled spatial domain.
 
RealPoint myScaledSpatialLowerBound
 Lower bound of the scaled spatial domain.
 
Real myScaledFreqMag
 Magnitude ratio for the scaled frequency values.
 

Detailed Description

template<typename TSpace, typename T>
class DGtal::RealFFT< HyperRectDomain< TSpace >, T >

Real-complex backward and forward Fast Fourier Transform over HyperRectDomain.

Template Parameters
TSpaceType of the space.
TValues type.

Definition at line 211 of file RealFFT.h.

Member Typedef Documentation

◆ Complex

template<typename TSpace , typename T >
using DGtal::RealFFT< HyperRectDomain< TSpace >, T >::Complex = std::complex<Real>

Complex value type.

Definition at line 224 of file RealFFT.h.

◆ ConstFreqImage

template<typename TSpace , typename T >
using DGtal::RealFFT< HyperRectDomain< TSpace >, T >::ConstFreqImage = ArrayImageAdapter< const Complex*, Domain >

Constant frequency image type.

Definition at line 230 of file RealFFT.h.

◆ ConstSpatialImage

template<typename TSpace , typename T >
using DGtal::RealFFT< HyperRectDomain< TSpace >, T >::ConstSpatialImage = ArrayImageAdapter< const Real*, Domain >

Constant spatial image type.

Definition at line 228 of file RealFFT.h.

◆ Dimension

template<typename TSpace , typename T >
using DGtal::RealFFT< HyperRectDomain< TSpace >, T >::Dimension = typename Space::Dimension

Space dimension type.

Definition at line 223 of file RealFFT.h.

◆ Domain

template<typename TSpace , typename T >
using DGtal::RealFFT< HyperRectDomain< TSpace >, T >::Domain = HyperRectDomain<Space>

Domain type.

Definition at line 220 of file RealFFT.h.

◆ FFTW

template<typename TSpace , typename T >
using DGtal::RealFFT< HyperRectDomain< TSpace >, T >::FFTW = detail::FFTWWrapper<T>
private

Definition at line 214 of file RealFFT.h.

◆ FreqImage

template<typename TSpace , typename T >
using DGtal::RealFFT< HyperRectDomain< TSpace >, T >::FreqImage = ArrayImageAdapter< Complex*, Domain >

Mutable frequency image type.

Definition at line 229 of file RealFFT.h.

◆ Point

template<typename TSpace , typename T >
using DGtal::RealFFT< HyperRectDomain< TSpace >, T >::Point = typename Space::Point

Point type.

Definition at line 221 of file RealFFT.h.

◆ Real

template<typename TSpace , typename T >
using DGtal::RealFFT< HyperRectDomain< TSpace >, T >::Real = T

Real value type.

Definition at line 219 of file RealFFT.h.

◆ RealPoint

template<typename TSpace , typename T >
using DGtal::RealFFT< HyperRectDomain< TSpace >, T >::RealPoint = PointVector<Space::dimension, Real>

Real point type.

Definition at line 222 of file RealFFT.h.

◆ Self

template<typename TSpace , typename T >
using DGtal::RealFFT< HyperRectDomain< TSpace >, T >::Self = RealFFT< Domain, T >

Self type.

Definition at line 225 of file RealFFT.h.

◆ Space

template<typename TSpace , typename T >
using DGtal::RealFFT< HyperRectDomain< TSpace >, T >::Space = TSpace

Space type.

Definition at line 218 of file RealFFT.h.

◆ SpatialImage

template<typename TSpace , typename T >
using DGtal::RealFFT< HyperRectDomain< TSpace >, T >::SpatialImage = ArrayImageAdapter< Real*, Domain >

Mutable spatial image type.

Definition at line 227 of file RealFFT.h.

Constructor & Destructor Documentation

◆ RealFFT() [1/4]

template<typename TSpace , typename T >
DGtal::RealFFT< HyperRectDomain< TSpace >, T >::RealFFT ( Domain const & aDomain)

Constructor from the spatial domain.

Parameters
aDomainThe domain over which the transform will be performed.

The scaled lower bound and extent is initialized from the given domain.

Note
The data storage (spatial or frequency image) is not zeroed at RealFFT construction.

◆ RealFFT() [2/4]

template<typename TSpace , typename T >
DGtal::RealFFT< HyperRectDomain< TSpace >, T >::RealFFT ( Domain const & aDomain,
RealPoint const & aLowerBound,
RealPoint const & anExtent )

Constructor from the spatial domain and scaled lower bound and extent.

Parameters
aDomainThe domain over which the transform will be performed.
aLowerBoundThe lower bound of the scaled spatial domain.
anExtentThe extent of the scaled spatial domain.
Note
The data storage (spatial or frequency image) is not zeroed at RealFFT construction.

◆ RealFFT() [3/4]

template<typename TSpace , typename T >
DGtal::RealFFT< HyperRectDomain< TSpace >, T >::RealFFT ( Self const & )
delete

Copy constructor. Deleted.

◆ RealFFT() [4/4]

template<typename TSpace , typename T >
DGtal::RealFFT< HyperRectDomain< TSpace >, T >::RealFFT ( Self && )
delete

Move constructor. Deleted.

◆ ~RealFFT()

template<typename TSpace , typename T >
DGtal::RealFFT< HyperRectDomain< TSpace >, T >::~RealFFT ( )

Destructor.

Member Function Documentation

◆ backwardFFT()

template<typename TSpace , typename T >
void DGtal::RealFFT< HyperRectDomain< TSpace >, T >::backwardFFT ( unsigned flags = FFTW_ESTIMATE,
bool normalized = true )

In-place backward FFT transformation (frequential -> spatial)

The transformation is done as if the lower bound of the spatial domain is the origin but with the same extent as the domain given at construction. See the scaling services provided by this class in order to take into account a different lower bound or extent.

Parameters
flagsPlanner flags.
See also
http://www.fftw.org/fftw3_doc/Planner-Flags.html#Planner-Flags
Parameters
normalizedWhen applying the backward transformation, if normalized is true, then the transformation is normalized (all values are divided by the size of the domain). Otherwise, applying a forward transformation followed by a backward transformation will multiply the input by the size of the spatial domain (see http://www.fftw.org/fftw3_doc/The-1d-Real_002ddata-DFT.html#The-1d-Real_002ddata-DFT).
Note
If the transformation result will be afterward modified or copied in an another image, prefer set normalized to false and postpone the normalization.
For planner other than FFTW_ESTIMATE and if not plan has been generated before, a temporary image will be allocated in order to find an optimal transformation plan.
Warning
Since this class uses an in-place algorithm, the frequency image will be overwriten during the transformation.

◆ calcNativeFreqCoords()

template<typename TSpace , typename T >
Point DGtal::RealFFT< HyperRectDomain< TSpace >, T >::calcNativeFreqCoords ( RealPoint const & aScaledPoint,
bool & applyConj ) const
noexcept

From the scaled frequency coordinates, calculates the nearest corresponding coordinates in the native frequency image.

Since the frequency image's domain is half the size of the spatial domain due to the hermitian symmetry, if the given point lies into the stripped part, then the given parameter applyConj is set to true to indicate that the frequency image value at the returned coordinates must be conjugate.

Parameters
aScaledPointCoordinates in the scaled domain of the frequency image.
[out]applyConjSet to true if you must take the conjugate of the frequency image value at the returned coordinates.
Returns
integer coordinates lying into the frequency image returned by getFreqImage().
See also
calcScaledFreqCoords()

◆ calcNativeFreqValue()

template<typename TSpace , typename T >
Complex DGtal::RealFFT< HyperRectDomain< TSpace >, T >::calcNativeFreqValue ( RealPoint const & aScaledPoint,
Complex const & aScaledValue ) const
noexcept

From a complex value of the scaled frequency image, calculates the corresponding value (undoing scaling and rotation) in the native frequency image.

Parameters
aScaledPointCoordinates in the scaled domain of the frequency image.
aScaledValueComplex value from the scaled frequency image.
Returns
corresponding complex value from the native frequency image.
See also
calcScaledFreqValue()

◆ calcNativeSpatialCoords()

template<typename TSpace , typename T >
Point DGtal::RealFFT< HyperRectDomain< TSpace >, T >::calcNativeSpatialCoords ( RealPoint const & aScaledPoint) const
noexcept

From the scaled spatial coordinates, calculates the nearest corresponding coordinates in the native spatial image.

Parameters
aScaledPointCoordinates in the scaled domain of the spatial image.
Returns
integer coordinates lying into the spatial image returned by getSpatialImage().
See also
calcScaledSpatialCoords()

◆ calcScaledFreqCoords()

template<typename TSpace , typename T >
RealPoint DGtal::RealFFT< HyperRectDomain< TSpace >, T >::calcScaledFreqCoords ( Point const & aPoint) const
noexcept

Scales coordinates from the frequency image taking into account the extent and lower bound of the scaled spatial domain.

Along each dimension, the first half of the space is composed of positive frequencies and the second half maps to the negative frequencies.

Parameters
aPointCoordinates in the domain of the frequency image.
Returns
Corresponding coordinates (the frequencies) in the scaled frequency domain.
See also
http://www.fftw.org/fftw3_doc/The-1d-Discrete-Fourier-Transform-_0028DFT_0029.html#The-1d-Discrete-Fourier-Transform-_0028DFT_0029
calcNativeFreqCoords()

◆ calcScaledFreqValue()

template<typename TSpace , typename T >
Complex DGtal::RealFFT< HyperRectDomain< TSpace >, T >::calcScaledFreqValue ( RealPoint const & aScaledPoint,
Complex const & aValue ) const
noexcept

Scales and rotates a complex value from the frequency image taking into account the extent and lower bound of the scaled spatial domain.

Parameters
aScaledPointCoordinates in the scaled domain of the frequency image.
aValueComplex value from the frequency image.
Returns
corresponding complex value from the scaled frequency image.
Note
Prefer translating data in the spatial space instead of using this method.
See also
calcNativeFreqValue()

◆ calcScaledSpatialCoords()

template<typename TSpace , typename T >
RealPoint DGtal::RealFFT< HyperRectDomain< TSpace >, T >::calcScaledSpatialCoords ( Point const & aPoint) const
noexcept

Scales coordinates from the spatial image taking into account the extent and lower bound of the scaled spatial domain.

Parameters
aPointCoordinates in the domain of the spatial image.
Returns
Corresponding coordinates in the scaled spatial domain.
See also
calcNativeSpatialCoords().

◆ createPlan()

template<typename TSpace , typename T >
void DGtal::RealFFT< HyperRectDomain< TSpace >, T >::createPlan ( unsigned flags,
int way )

Creates a transformation plan for the specified transformation direction.

Parameters
flagsPlanner flags (see http://www.fftw.org/fftw3_doc/Planner-Flags.html#Planner-Flags).
wayThe direction of the transformation: FFTW_FORWARD for real->complex, FFTW_BACKWARD for complex->real.

The created plan is immediately destroyed but the associated wisdom is keeped by FFTW3, so that future creation of similar plan (same image dimension, size and precision, same number of process, same flags and way) will be costless.

It is only usefull when using a plan flag other than FFTW_ESTIMATE, when the allocation of a temporary image is not wanted and when the spatial or frequency image has not been already initialized. Otherwise, consider using doFFT(), forwardFFT() or backwardFFT() directly.

Warning
For planners other than FFTW_ESTIMATE and if no plan has been generated before, the spatial and frequency image will be overwriten. See doFFT(), forwardFFT() or backwardFFT() if it is not the wanted behavior.

◆ doFFT()

template<typename TSpace , typename T >
void DGtal::RealFFT< HyperRectDomain< TSpace >, T >::doFFT ( unsigned flags = FFTW_ESTIMATE,
int way = FFTW_FORWARD,
bool normalized = false )

In-place Fast Fourier Transformation.

The transformation is done as if the lower bound of the spatial domain is the origin but with the same extent as the domain given at construction. See the scaling services provided by this class in order to take into account a different lower bound or extent.

Parameters
flagsPlanner flags (see http://www.fftw.org/fftw3_doc/Planner-Flags.html#Planner-Flags).
wayThe direction of the transformation: FFTW_FORWARD for real->complex,FFTW_BACKWARD for complex->real.
normalizedWhen applying the backward transformation, if normalized is true, then the transformation is normalized (all values are divided by the size of the domain). Otherwise, applying a forward transformation followed by a backward transformation will multiply the input by the size of the spatial domain (see http://www.fftw.org/fftw3_doc/The-1d-Real_002ddata-DFT.html#The-1d-Real_002ddata-DFT).
Note
For planner other than FFTW_ESTIMATE and if no plan has been generated before, a temporary image will be allocated in order to find an optimal transformation plan without modifiying the user data. See createPlan() if you want to avoid this extra-memory cost.
Warning
Since this class uses an in-place algorithm, if way is equal to FFTW_FORWARD then the spatial image will be overwriten, and if way is equal to FFTW_BACKWARD then the frequency image will be overwriten.

◆ forwardFFT()

template<typename TSpace , typename T >
void DGtal::RealFFT< HyperRectDomain< TSpace >, T >::forwardFFT ( unsigned flags = FFTW_ESTIMATE)

In-place forward FFT transformation (spatial -> frequential)

The transformation is done as if the lower bound of the spatial domain is the origin but with the same extent as the domain given at construction. See the scaling services provided by this class in order to take into account a different lower bound or extent.

Parameters
flagsPlanner flags.
See also
http://www.fftw.org/fftw3_doc/Planner-Flags.html#Planner-Flags
Note
For planner other than FFTW_ESTIMATE and if not plan has been generated before, a temporary image will be allocated in order to find an optimal transformation plan.
Warning
Since this class uses an in-place algorithm, the spatial image will be overwriten during the transformation.

◆ getFreqDomain()

template<typename TSpace , typename T >
Domain const & DGtal::RealFFT< HyperRectDomain< TSpace >, T >::getFreqDomain ( ) const
noexcept

Gets the frequency domain.

Warning
The frequency image's domain is smaller (about the half-size) of the spatial image's domain (see http://www.fftw.org/fftw3_doc/Multi_002dDimensional-DFTs-of-Real-Data.html#Multi_002dDimensional-DFTs-of-Real-Data).

◆ getFreqExtent()

template<typename TSpace , typename T >
Point const & DGtal::RealFFT< HyperRectDomain< TSpace >, T >::getFreqExtent ( ) const
noexcept

Gets the frequency domain extent.

Warning
The frequency image's domain is smaller (about the half-size) of the spatial image's domain (see http://www.fftw.org/fftw3_doc/Multi_002dDimensional-DFTs-of-Real-Data.html#Multi_002dDimensional-DFTs-of-Real-Data).

◆ getFreqImage() [1/2]

template<typename TSpace , typename T >
ConstFreqImage DGtal::RealFFT< HyperRectDomain< TSpace >, T >::getFreqImage ( ) const
noexcept

Gets frequential image.

Returns
a CImage or a CConstImage model on the frequency data.
Warning
The frequency image is not zeroed during RealFFT construction.
Remember that the spatial and frequency image share the same memory location. Therefore, modifying one image erases the data from the other image.
The frequency image's domain is smaller (about the half-size) of the spatial image's domain (see http://www.fftw.org/fftw3_doc/Multi_002dDimensional-DFTs-of-Real-Data.html#Multi_002dDimensional-DFTs-of-Real-Data).
See also
ArrayImageAdapter

◆ getFreqImage() [2/2]

template<typename TSpace , typename T >
FreqImage DGtal::RealFFT< HyperRectDomain< TSpace >, T >::getFreqImage ( )
noexcept

Gets frequential image.

Returns
a CImage or a CConstImage model on the frequency data.
Warning
The frequency image is not zeroed during RealFFT construction.
Remember that the spatial and frequency image share the same memory location. Therefore, modifying one image erases the data from the other image.
The frequency image's domain is smaller (about the half-size) of the spatial image's domain (see http://www.fftw.org/fftw3_doc/Multi_002dDimensional-DFTs-of-Real-Data.html#Multi_002dDimensional-DFTs-of-Real-Data).
See also
ArrayImageAdapter

◆ getFreqStorage() [1/2]

template<typename TSpace , typename T >
const Complex * DGtal::RealFFT< HyperRectDomain< TSpace >, T >::getFreqStorage ( ) const
noexcept

Gets frequential raw storage.

Warning
Remember that the spatial and frequency image share the same memory location. Therefore, modifying one image erases the data from the other image.

◆ getFreqStorage() [2/2]

template<typename TSpace , typename T >
Complex * DGtal::RealFFT< HyperRectDomain< TSpace >, T >::getFreqStorage ( )
noexcept

Gets frequential raw storage.

Warning
Remember that the spatial and frequency image share the same memory location. Therefore, modifying one image erases the data from the other image.

◆ getPadding()

template<typename TSpace , typename T >
std::size_t DGtal::RealFFT< HyperRectDomain< TSpace >, T >::getPadding ( ) const
noexcept

Padding used with real datas.

Returns
the number of real values used as padding along the last dimension.
See also
http://www.fftw.org/doc/Multi_002dDimensional-DFTs-of-Real-Data.html#Multi_002dDimensional-DFTs-of-Real-Data

◆ getScaledFreqValue()

template<typename TSpace , typename T >
Complex DGtal::RealFFT< HyperRectDomain< TSpace >, T >::getScaledFreqValue ( RealPoint const & aScaledPoint) const
inlinenoexcept

Reads a scaled frequency value at the nearest native coordinates corresponding to the given scaled frequency coordinates.

Parameters
aScaledPointCoordinates in the scaled domain of the frequency image.
Returns
scaled value from the native frequency image taken at the nearest corresponding coordinates.

Definition at line 634 of file RealFFT.h.

641 {
642 bool apply_conj;
643 const auto aPoint = calcNativeFreqCoords( aScaledPoint, apply_conj );
644 const Complex aScaledValue = calcScaledFreqValue( aScaledPoint, getFreqImage()( aPoint ) );
645 return apply_conj ? std::conj( aScaledValue ) : aScaledValue;
646 }
647
655 inline
656 void setScaledFreqValue( RealPoint const& aScaledPoint, Complex aScaledValue ) noexcept
657 {
658 bool apply_conj;
659 const auto aPoint = calcNativeFreqCoords( aScaledPoint, apply_conj );
660 const Complex aValue = calcNativeFreqValue( aScaledPoint, aScaledValue );
661
662 if ( apply_conj )
663 getFreqImage().setValue( aPoint, std::conj( aValue ) );
664 else
665 getFreqImage().setValue( aPoint, aValue );
666 }
668
670
674
678 bool isValid() const noexcept;
679
684 void selfDisplay ( std::ostream & out ) const;
685
687
688 // ------------------------- Public Datas --------------------------------
689 public:
690 const Real pi = boost::math::constants::pi<Real>();
691
692 // ------------------------- Private Datas --------------------------------
693 private:
694 const Domain mySpatialDomain;
695 const Point mySpatialExtent;
696 const Point myFreqExtent;
697 const Domain myFreqDomain;
699 void* myStorage;
703
704 };
705
712 template <
713 class TDomain,
714 typename T
715 >
716 std::ostream&
717 operator<< ( std::ostream & out, const RealFFT<TDomain,T> & object );
718
719} // namespace DGtal
720
722// Includes inline functions.
723#include "DGtal/math/RealFFT.ih"
724
725// //
727
728#endif // !defined RealFFT_h
729
730#undef RealFFT_RECURSES
731#endif // else defined(RealFFT_RECURSES)
732
const Domain myFreqDomain
Frequential domain (complex).
Definition RealFFT.h:691
void setScaledFreqValue(RealPoint const &aScaledPoint, Complex aScaledValue) noexcept
Definition RealFFT.h:650
const Point mySpatialExtent
Extent of the spatial domain.
Definition RealFFT.h:689
const Domain mySpatialDomain
Spatial domain (real).
Definition RealFFT.h:688
Complex calcNativeFreqValue(RealPoint const &aScaledPoint, Complex const &aScaledValue) const noexcept
RealPoint myScaledSpatialExtent
Extent of the scaled spatial domain.
Definition RealFFT.h:694
const Domain myFullSpatialDomain
Full spatial domain (real) including the padding.
Definition RealFFT.h:692
void selfDisplay(std::ostream &out) const
std::complex< Real > Complex
Complex value type.
Definition RealFFT.h:224
Point calcNativeFreqCoords(RealPoint const &aScaledPoint, bool &applyConj) const noexcept
Real myScaledFreqMag
Magnitude ratio for the scaled frequency values.
Definition RealFFT.h:696
const Point myFreqExtent
Extent of the frequential domain.
Definition RealFFT.h:690
RealPoint myScaledSpatialLowerBound
Lower bound of the scaled spatial domain.
Definition RealFFT.h:695
Complex calcScaledFreqValue(RealPoint const &aScaledPoint, Complex const &aValue) const noexcept
STL namespace.
MyPointD Point
const Point aPoint(3, 4)
HyperRectDomain< Space > Domain
PointVector< 3, double > RealPoint

◆ getScaledSpatialExtent()

template<typename TSpace , typename T >
RealPoint DGtal::RealFFT< HyperRectDomain< TSpace >, T >::getScaledSpatialExtent ( ) const
noexcept

Gets the extent of the scaled spatial domain.

◆ getScaledSpatialLowerBound()

template<typename TSpace , typename T >
RealPoint DGtal::RealFFT< HyperRectDomain< TSpace >, T >::getScaledSpatialLowerBound ( ) const
noexcept

Gets the lower bound of the scaled spatial domain.

◆ getScaledSpatialValue()

template<typename TSpace , typename T >
Real DGtal::RealFFT< HyperRectDomain< TSpace >, T >::getScaledSpatialValue ( RealPoint const & aScaledPoint) const
inlinenoexcept

Reads a spatial value at the nearest native coordinates corresponding to the given scaled spatial coordinates.

Parameters
aScaledPointCoordinates in the scaled domain of the spatial image.
Returns
value from the native spatial image taken at the nearest corresponding coordinates.

Definition at line 606 of file RealFFT.h.

◆ getSpatialDomain()

template<typename TSpace , typename T >
Domain const & DGtal::RealFFT< HyperRectDomain< TSpace >, T >::getSpatialDomain ( ) const
noexcept

Gets the spatial domain.

◆ getSpatialExtent()

template<typename TSpace , typename T >
Point const & DGtal::RealFFT< HyperRectDomain< TSpace >, T >::getSpatialExtent ( ) const
noexcept

Gets the spatial domain extent.

◆ getSpatialImage() [1/2]

template<typename TSpace , typename T >
ConstSpatialImage DGtal::RealFFT< HyperRectDomain< TSpace >, T >::getSpatialImage ( ) const
noexcept

Gets the spatial image.

Returns
a CImage or a CConstImage model on the spatial data.
Warning
The spatial image is not zeroed during RealFFT construction.
Remember that the spatial and frequency image share the same memory location. Therefore, modifying one image erases the data from the other image.
See also
ArrayImageAdapter

◆ getSpatialImage() [2/2]

template<typename TSpace , typename T >
SpatialImage DGtal::RealFFT< HyperRectDomain< TSpace >, T >::getSpatialImage ( )
noexcept

Gets the spatial image.

Returns
a CImage or a CConstImage model on the spatial data.
Warning
The spatial image is not zeroed during RealFFT construction.
Remember that the spatial and frequency image share the same memory location. Therefore, modifying one image erases the data from the other image.
See also
ArrayImageAdapter

◆ getSpatialStorage() [1/2]

template<typename TSpace , typename T >
const Real * DGtal::RealFFT< HyperRectDomain< TSpace >, T >::getSpatialStorage ( ) const
noexcept

Gets spatial raw storage.

Warning
There is a padding at the end of the first dimension (see getPadding()).
Remember that the spatial and frequency image share the same memory location. Therefore, modifying one image erases the data from the other image.

◆ getSpatialStorage() [2/2]

template<typename TSpace , typename T >
Real * DGtal::RealFFT< HyperRectDomain< TSpace >, T >::getSpatialStorage ( )
noexcept

Gets spatial raw storage.

Warning
There is a padding at the end of the first dimension (see getPadding()).
Remember that the spatial and frequency image share the same memory location. Therefore, modifying one image erases the data from the other image.

◆ isValid()

template<typename TSpace , typename T >
bool DGtal::RealFFT< HyperRectDomain< TSpace >, T >::isValid ( ) const
noexcept

Checks if storage is valid.

Returns
true if there is an allocated storage, false otherwise.

◆ operator=() [1/2]

template<typename TSpace , typename T >
Self & DGtal::RealFFT< HyperRectDomain< TSpace >, T >::operator= ( Self && )
delete

Move assignment operator. Deleted.

◆ operator=() [2/2]

template<typename TSpace , typename T >
Self & DGtal::RealFFT< HyperRectDomain< TSpace >, T >::operator= ( Self const & )
delete

Copy assignment operator. Deleted.

◆ selfDisplay()

template<typename TSpace , typename T >
void DGtal::RealFFT< HyperRectDomain< TSpace >, T >::selfDisplay ( std::ostream & out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

◆ setScaledFreqValue()

template<typename TSpace , typename T >
void DGtal::RealFFT< HyperRectDomain< TSpace >, T >::setScaledFreqValue ( RealPoint const & aScaledPoint,
Complex aScaledValue )
inlinenoexcept

Writes a scaled frequency value at the nearest native coordinates corresponding to the given scaled frequency coordinates.

Parameters
aScaledPointCoordinates in the scaled domain of the frequency image.
aScaledValueScaled value to set in the native frequency image at the nearest corresponding coordinates.

Definition at line 650 of file RealFFT.h.

657 {
658 bool apply_conj;
659 const auto aPoint = calcNativeFreqCoords( aScaledPoint, apply_conj );
660 const Complex aValue = calcNativeFreqValue( aScaledPoint, aScaledValue );

◆ setScaledSpatialExtent()

template<typename TSpace , typename T >
void DGtal::RealFFT< HyperRectDomain< TSpace >, T >::setScaledSpatialExtent ( RealPoint const & anExtent)
noexcept

Sets the extent of the scaled spatial domain.

Parameters
anExtentThe extent.

◆ setScaledSpatialLowerBound()

template<typename TSpace , typename T >
void DGtal::RealFFT< HyperRectDomain< TSpace >, T >::setScaledSpatialLowerBound ( RealPoint const & aPoint)
noexcept

Sets the lower bound of the scaled spatial domain.

Parameters
aPointThe lower bound.

◆ setScaledSpatialValue()

template<typename TSpace , typename T >
void DGtal::RealFFT< HyperRectDomain< TSpace >, T >::setScaledSpatialValue ( RealPoint const & aScaledPoint,
Real aValue )
inlinenoexcept

Writes a spatial value at the nearest native coordinates corresponding to the given scaled spatial coordinates.

Parameters
aScaledPointCoordinates in the scaled domain of the spatial image.
aValueValue to set in the native spatial image at the nearest corresponding coordinates.

Definition at line 618 of file RealFFT.h.

Field Documentation

◆ dimension

template<typename TSpace , typename T >
const constexpr Dimension DGtal::RealFFT< HyperRectDomain< TSpace >, T >::dimension = Domain::dimension
staticconstexpr

Space dimension.

Definition at line 232 of file RealFFT.h.

◆ myFreqDomain

template<typename TSpace , typename T >
const Domain DGtal::RealFFT< HyperRectDomain< TSpace >, T >::myFreqDomain
private

Frequential domain (complex).

Definition at line 691 of file RealFFT.h.

◆ myFreqExtent

template<typename TSpace , typename T >
const Point DGtal::RealFFT< HyperRectDomain< TSpace >, T >::myFreqExtent
private

Extent of the frequential domain.

Definition at line 690 of file RealFFT.h.

◆ myFullSpatialDomain

template<typename TSpace , typename T >
const Domain DGtal::RealFFT< HyperRectDomain< TSpace >, T >::myFullSpatialDomain
private

Full spatial domain (real) including the padding.

Definition at line 692 of file RealFFT.h.

◆ myScaledFreqMag

template<typename TSpace , typename T >
Real DGtal::RealFFT< HyperRectDomain< TSpace >, T >::myScaledFreqMag
private

Magnitude ratio for the scaled frequency values.

Definition at line 696 of file RealFFT.h.

◆ myScaledSpatialExtent

template<typename TSpace , typename T >
RealPoint DGtal::RealFFT< HyperRectDomain< TSpace >, T >::myScaledSpatialExtent
private

Extent of the scaled spatial domain.

Definition at line 694 of file RealFFT.h.

◆ myScaledSpatialLowerBound

template<typename TSpace , typename T >
RealPoint DGtal::RealFFT< HyperRectDomain< TSpace >, T >::myScaledSpatialLowerBound
private

Lower bound of the scaled spatial domain.

Definition at line 695 of file RealFFT.h.

◆ mySpatialDomain

template<typename TSpace , typename T >
const Domain DGtal::RealFFT< HyperRectDomain< TSpace >, T >::mySpatialDomain
private

Spatial domain (real).

Definition at line 688 of file RealFFT.h.

◆ mySpatialExtent

template<typename TSpace , typename T >
const Point DGtal::RealFFT< HyperRectDomain< TSpace >, T >::mySpatialExtent
private

Extent of the spatial domain.

Definition at line 689 of file RealFFT.h.

◆ myStorage

template<typename TSpace , typename T >
void* DGtal::RealFFT< HyperRectDomain< TSpace >, T >::myStorage
private

Storage.

Definition at line 693 of file RealFFT.h.

◆ pi

template<typename TSpace , typename T >
const Real DGtal::RealFFT< HyperRectDomain< TSpace >, T >::pi = boost::math::constants::pi<Real>()

Pi.

Definition at line 684 of file RealFFT.h.


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