7 #ifndef BALL_NMR_SPECTRUM_H
8 #define BALL_NMR_SPECTRUM_H
10 #ifndef BALL_NMR_PEAKLIST_H
14 #ifndef BALL_DATATYPE_REGULARDATA1D_H
18 #ifndef BALL_DATATYPE_REGULARDATA2D_H
22 #ifndef BALL_DATATYPE_REGULARDATA3D_H
28 #ifndef BALL_MATHS_FFT1D_H
31 #ifndef BALL_MATHS_FFT2D_H
47 template <
typename DataT,
typename PeakT,
typename PositionT =
typename PeakT::Position>
99 const DataType& getData()
const;
103 const vector<float>& getHuInvariants()
const;
105 vector<float>& getHuInvariants();
109 virtual void clear();
110 virtual void clearSticks();
115 virtual void convertToGaussian();
116 virtual void convertToLorentzian();
117 virtual void computeAllMoments(
int moment_number);
119 virtual void setSpacing(
const PositionType& spacing);
120 virtual PositionType getSpacing()
const;
122 virtual void setSticks(std::vector<PeakType> sticks) {sticks_ = sticks;};
123 virtual std::vector<PeakType>
getSticks()
const {
return sticks_;};
127 virtual double getAbsIntegral()
const;
128 virtual void computeHuInvariants();
154 void binaryWrite(
const String& filename);
157 void binaryRead(
const String& filename);
171 template <
typename DataT,
typename PeakT,
typename PositionT>
178 template <
typename DataT,
typename PeakT,
typename PositionT>
188 template <
typename DataT,
typename PeakT,
typename PositionT>
197 template <
typename DataT,
typename PeakT,
typename PositionT>
205 template <
typename DataT,
typename PeakT,
typename PositionT>
214 template <
typename DataT,
typename PeakT,
typename PositionT>
220 template <
typename DataT,
typename PeakT,
typename PositionT>
223 if (normal_moments.size() != (
Size)moment_number)
224 computeAllMoments(moment_number);
229 for (
int current_moment=0; current_moment<moment_number; current_moment++)
230 diff += fabs(normal_moments[current_moment] - spectrum.
normal_moments[current_moment]);
235 template <
typename DataT,
typename PeakT,
typename PositionT>
238 if (central_moments.size() != (
Size)moment_number)
239 computeAllMoments(moment_number);
244 for (
int current_moment=0; current_moment<moment_number; current_moment++)
245 diff += fabs(central_moments[current_moment] - spectrum.
central_moments[current_moment]);
250 template <
typename DataT,
typename PeakT,
typename PositionT>
253 if (standardized_moments.size() != (
Size)moment_number)
254 computeAllMoments(moment_number);
259 for (
int current_moment=0; current_moment<moment_number; current_moment++)
260 diff += fabs(standardized_moments[current_moment] - spectrum.
standardized_moments[current_moment]);
265 template <
typename DataT,
typename PeakT,
typename PositionT>
271 template <
typename DataT,
typename PeakT,
typename PositionT>
280 template <
typename DataT,
typename PeakT,
typename PositionT>
283 return Hu_invariants_;
286 template <
typename DataT,
typename PeakT,
typename PositionT>
289 return Hu_invariants_;
294 template <
typename DataT,
typename PeakT,
typename PositionT>
297 Log.
error()<<
"computeHuInvariants() only implemented in 2D" << std::endl;
301 template <
typename DataT,
typename PeakT,
typename PositionT>
304 Log.
error()<<
"computeHuInvariantsDifferences() only implemented in 2D" << std::endl;
305 std::vector<float> result;
309 template <
typename DataT,
typename PeakT,
typename PositionT>
312 Log.
error() <<
"getFourierDifference only implemented in 1D and 2D" << std::endl;
330 template <
typename DataT,
typename PeakT,
typename PositionT>
331 std::ostream& operator << (std::ostream& os, const Spectrum<DataT, PeakT, PositionT>& spectrum);
333 template <
typename DataT,
typename PeakT,
typename PositionT>
336 # ifndef BALL_NO_INLINE_FUNCTIONS
337 # include <BALL/NMR/spectrum.iC>
342 #endif // BALL_NMR_SPECTRUM_H