BALL
1.4.2
|
#include <BALL/NMR/spectrum.h>
Public Types | |
typedef DataT | DataType |
The datatype used to store the spectrum. More... | |
typedef PositionT | PositionType |
the data type used to store a position (for peaks and data) More... | |
typedef PeakT | PeakType |
The peak type. More... | |
typedef DataT::Iterator | Iterator |
An iterator. More... | |
typedef DataT::ConstIterator | ConstIterator |
A constant iterator. More... | |
Public Member Functions | |
virtual void | clear () |
virtual void | clearSticks () |
virtual double | difference (const Spectrum< DataT, PeakT, PositionT > &spectrum) const |
virtual Spectrum< DataT, PeakT, PositionT > | differenceSpectrum (const Spectrum< DataT, PeakT, PositionT > &spectrum) |
virtual double | earthMoversDistance (const Spectrum< DataT, PeakT, PositionT > &spectrum) const |
virtual void | convertToGaussian () |
virtual void | convertToLorentzian () |
virtual void | computeAllMoments (int moment_number) |
virtual void | setSpacing (const PositionType &spacing) |
virtual PositionType | getSpacing () const |
virtual void | setSticks (std::vector< PeakType > sticks) |
virtual std::vector< PeakType > | getSticks () const |
virtual double | getAbsIntegral () const |
virtual void | computeHuInvariants () |
virtual vector< float > | computeHuInvariantsDifferences (vector< Spectrum< DataT, PeakT, PositionT > > &spectra) |
virtual double | getFourierDifference (const Spectrum< DataT, PeakT, PositionT > &spectrum, float min_freq=1e6, float max_freq=-1e6) |
virtual double | getNormalMomentsDifference (Spectrum< DataT, PeakT, PositionT > &spectrum, int moment_number) |
virtual double | getCentralMomentsDifference (Spectrum< DataT, PeakT, PositionT > &spectrum, int moment_number) |
virtual double | getStandardizedMomentsDifference (Spectrum< DataT, PeakT, PositionT > &spectrum, int moment_number) |
void | binaryWrite (const String &filename) |
This function requires that DataT has a binaryWrite method. More... | |
void | binaryRead (const String &filename) |
This function requires that DataT has a binaryRead method. More... | |
Spectrum () | |
Spectrum (const DataType &data) | |
Spectrum (const std::vector< PeakType > &peaks, const PositionType &origin, const PositionType &dimension, const PositionType &spacing) | |
virtual | ~Spectrum () |
Accessors | |
const DataType & | getData () const |
DataType & | getData () |
const vector< float > & | getHuInvariants () const |
vector< float > & | getHuInvariants () |
Public Attributes | |
std::vector< float > | normal_moments |
precomputed normal moments More... | |
std::vector< float > | central_moments |
precomputed central moments More... | |
std::vector< float > | standardized_moments |
precomputed standardized moments More... | |
Protected Attributes | |
DataType | data_ |
std::vector< PeakType > | sticks_ |
PositionType | spacing_ |
PositionType | min_ |
PositionType | max_ |
std::vector< float > | Hu_invariants_ |
A generic NMR spectrum class.
Definition at line 48 of file spectrum.h.
typedef DataT::ConstIterator BALL::Spectrum< DataT, PeakT, PositionT >::ConstIterator |
A constant iterator.
Definition at line 64 of file spectrum.h.
typedef DataT BALL::Spectrum< DataT, PeakT, PositionT >::DataType |
typedef DataT::Iterator BALL::Spectrum< DataT, PeakT, PositionT >::Iterator |
An iterator.
Definition at line 62 of file spectrum.h.
typedef PeakT BALL::Spectrum< DataT, PeakT, PositionT >::PeakType |
The peak type.
Definition at line 60 of file spectrum.h.
typedef PositionT BALL::Spectrum< DataT, PeakT, PositionT >::PositionType |
the data type used to store a position (for peaks and data)
Definition at line 58 of file spectrum.h.
|
inline |
Constructors and Destructor
Definition at line 71 of file spectrum.h.
|
inline |
Definition at line 79 of file spectrum.h.
|
inline |
Definition at line 87 of file spectrum.h.
|
inlinevirtual |
Destructor
Definition at line 92 of file spectrum.h.
void BALL::Spectrum< DataT, PeakT, PositionT >::binaryRead | ( | const String & | filename | ) |
This function requires that DataT has a binaryRead method.
void BALL::Spectrum< DataT, PeakT, PositionT >::binaryWrite | ( | const String & | filename | ) |
This function requires that DataT has a binaryWrite method.
|
virtual |
Clear the spectrum. Sets all data to zero. // TODO: what about the spacing?
Definition at line 172 of file spectrum.h.
|
virtual |
Definition at line 179 of file spectrum.h.
|
virtual |
|
virtual |
Definition at line 295 of file spectrum.h.
|
virtual |
Definition at line 302 of file spectrum.h.
|
virtual |
|
virtual |
|
virtual |
Calculate the difference between two spectra.
Definition at line 189 of file spectrum.h.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Definition at line 236 of file spectrum.h.
const DataT & BALL::Spectrum< DataT, PeakT, PositionT >::getData | ( | ) | const |
Definition at line 266 of file spectrum.h.
DataT & BALL::Spectrum< DataT, PeakT, PositionT >::getData | ( | ) |
Definition at line 272 of file spectrum.h.
|
virtual |
Computes the difference between the spectra in Fourier space. max_freq and min_freq can be used to include only a certain range into the comparison. In this case, we only use the positive frequencies (the negative ones are redundant anyhow) and assume that 0<=min_freq<max_freq<=1, where min_freq and max_freq are interpreted as percentages, e.g. calling this function with min_freq=0 and max_freq=0.5 would include the lower half of the positive frequencies.
Definition at line 310 of file spectrum.h.
const vector< float > & BALL::Spectrum< DataT, PeakT, PositionT >::getHuInvariants | ( | ) | const |
Definition at line 281 of file spectrum.h.
vector< float > & BALL::Spectrum< DataT, PeakT, PositionT >::getHuInvariants | ( | ) |
Definition at line 287 of file spectrum.h.
|
virtual |
Computes the difference according to the precomputed normal moments up to moment_number. If the values have not been precomputed so far, we regenerate them.
Definition at line 221 of file spectrum.h.
|
virtual |
Return the spacing.
Definition at line 198 of file spectrum.h.
|
virtual |
Definition at line 251 of file spectrum.h.
|
inlinevirtual |
Definition at line 123 of file spectrum.h.
|
virtual |
Set the spacing.
Definition at line 206 of file spectrum.h.
|
inlinevirtual |
Definition at line 122 of file spectrum.h.
std::vector<float> BALL::Spectrum< DataT, PeakT, PositionT >::central_moments |
precomputed central moments
Definition at line 149 of file spectrum.h.
|
protected |
Definition at line 160 of file spectrum.h.
|
protected |
Definition at line 165 of file spectrum.h.
|
protected |
Definition at line 164 of file spectrum.h.
|
protected |
Definition at line 163 of file spectrum.h.
std::vector<float> BALL::Spectrum< DataT, PeakT, PositionT >::normal_moments |
precomputed normal moments
Definition at line 147 of file spectrum.h.
|
protected |
Definition at line 162 of file spectrum.h.
std::vector<float> BALL::Spectrum< DataT, PeakT, PositionT >::standardized_moments |
precomputed standardized moments
Definition at line 151 of file spectrum.h.
|
protected |
Definition at line 161 of file spectrum.h.