~ubuntu-branches/ubuntu/wily/openms/wily

« back to all changes in this revision

Viewing changes to include/OpenMS/TRANSFORMATIONS/FEATUREFINDER/Fitter1D.h

  • Committer: Package Import Robot
  • Author(s): Filippo Rusconi
  • Date: 2012-11-12 15:58:12 UTC
  • Revision ID: package-import@ubuntu.com-20121112155812-vr15wtg9b50cuesg
Tags: upstream-1.9.0
ImportĀ upstreamĀ versionĀ 1.9.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- mode: C++; tab-width: 2; -*-
 
2
// vi: set ts=2:
 
3
//
 
4
// --------------------------------------------------------------------------
 
5
//                   OpenMS Mass Spectrometry Framework
 
6
// --------------------------------------------------------------------------
 
7
//  Copyright (C) 2003-2011 -- Oliver Kohlbacher, Knut Reinert
 
8
//
 
9
//  This library is free software; you can redistribute it and/or
 
10
//  modify it under the terms of the GNU Lesser General Public
 
11
//  License as published by the Free Software Foundation; either
 
12
//  version 2.1 of the License, or (at your option) any later version.
 
13
//
 
14
//  This library is distributed in the hope that it will be useful,
 
15
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
17
//  Lesser General Public License for more details.
 
18
//
 
19
//  You should have received a copy of the GNU Lesser General Public
 
20
//  License along with this library; if not, write to the Free Software
 
21
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
22
//
 
23
// --------------------------------------------------------------------------
 
24
// $Maintainer: Clemens Groepl $
 
25
// $Authors: $
 
26
// --------------------------------------------------------------------------
 
27
 
 
28
#ifndef OPENMS_TRANSFORMATIONS_FEATUREFINDER_FITTER1D_H
 
29
#define OPENMS_TRANSFORMATIONS_FEATUREFINDER_FITTER1D_H
 
30
 
 
31
#include <OpenMS/DATASTRUCTURES/IsotopeCluster.h>
 
32
#include <OpenMS/DATASTRUCTURES/DefaultParamHandler.h>
 
33
#include <OpenMS/CONCEPT/Exception.h>
 
34
#include <OpenMS/KERNEL/Feature.h>
 
35
#include <OpenMS/MATH/STATISTICS/BasicStatistics.h>
 
36
#include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/FeatureFinderDefs.h>
 
37
 
 
38
namespace OpenMS
 
39
{
 
40
        class InterpolationModel;
 
41
 
 
42
        /**
 
43
        @brief Abstract base class for all 1D-dimensional model fitter.
 
44
 
 
45
        Every derived class has to implement the static functions
 
46
        "T* create()" and "const String getProductName()" (see DefaultParamHandler for details)
 
47
                
 
48
        @htmlinclude OpenMS_Fitter1D.parameters
 
49
  
 
50
        @ingroup FeatureFinder
 
51
        */
 
52
        class OPENMS_DLLAPI Fitter1D
 
53
    : public DefaultParamHandler,
 
54
      public FeatureFinderDefs
 
55
        {
 
56
         public:
 
57
            
 
58
                /// IndexSet
 
59
                typedef IsotopeCluster::IndexSet IndexSet;
 
60
                /// IndexSet with charge information
 
61
                typedef IsotopeCluster::ChargedIndexSet ChargedIndexSet;
 
62
                /// Single coordinate
 
63
                typedef Feature::CoordinateType CoordinateType;
 
64
                /// Quality of a feature
 
65
                typedef Feature::QualityType QualityType;
 
66
                /// Raw data point type
 
67
                typedef Peak1D PeakType;
 
68
                /// Raw data container type using for the temporary storage of the input data
 
69
                typedef std::vector<PeakType > RawDataArrayType;
 
70
                /// Raw data iterator
 
71
                typedef RawDataArrayType::iterator PeakIterator;
 
72
          
 
73
                /// Default constructor.
 
74
                Fitter1D();
 
75
            
 
76
                /// copy constructor
 
77
                Fitter1D(const Fitter1D& source);
 
78
    
 
79
                /// destructor
 
80
                virtual ~Fitter1D()
 
81
                {
 
82
                }
 
83
    
 
84
                /// assignment operator
 
85
                virtual Fitter1D& operator = (const Fitter1D& source);
 
86
                            
 
87
                /// return interpolation model
 
88
                virtual QualityType fit1d(const RawDataArrayType& /* range */, InterpolationModel*& /* model */)
 
89
                {
 
90
                        throw Exception::NotImplemented(__FILE__,__LINE__,__PRETTY_FUNCTION__);
 
91
                }
 
92
    
 
93
                /// register all derived classes here
 
94
                static void registerChildren();
 
95
                
 
96
         protected:
 
97
                
 
98
                /// standard derivation in bounding box         
 
99
                CoordinateType tolerance_stdev_box_;
 
100
                /// minimum of the bounding box
 
101
                CoordinateType min_;
 
102
                /// maximum of the bounding box
 
103
                CoordinateType max_;
 
104
                /// standard derivation
 
105
                CoordinateType stdev1_; 
 
106
                /// standard derivation            
 
107
                CoordinateType stdev2_;
 
108
                /// basic statistics           
 
109
                Math::BasicStatistics<> statistics_;
 
110
                /// interpolation step size
 
111
                CoordinateType interpolation_step_;
 
112
            
 
113
                virtual void updateMembers_();
 
114
                                
 
115
        };
 
116
 
 
117
}
 
118
 
 
119
#endif // OPENMS_TRANSFORMATIONS_FEATUREFINDER_FITTER1D_H