]> Creatis software - clitk.git/blob - tools/clitkSignalMeanPositionFilter.h
still pb with signal...
[clitk.git] / tools / clitkSignalMeanPositionFilter.h
1 /*=========================================================================
2                                                                                 
3   Program:   clitk
4   Language:  C++
5                                                                                 
6   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
7   l'Image). All rights reserved. See Doc/License.txt or
8   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
9                                                                                 
10      This software is distributed WITHOUT ANY WARRANTY; without even
11      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12      PURPOSE.  See the above copyright notices for more information.
13                                                                              
14 =========================================================================*/
15
16 #ifndef CLITKSIGNALMEANPOSITIONFILTER_H
17 #define CLITKSIGNALMEANPOSITIONFILTER_H
18
19 #include "clitkSignalMeanPositionTracking_ggo.h"
20 #include "clitkSignal.h"
21 #include "clitkEllipse.h"
22 #include "itkVector.h"
23
24 namespace clitk {
25
26   //---------------------------------------------------------------------
27   class SignalMeanPositionFilter {
28   public:
29     typedef itk::Vector<double,2> Vector2d;
30
31     void SetParameters(args_info_clitkSignalMeanPositionTracking & args_info);
32     void Update();
33     
34   protected:    
35     args_info_clitkSignalMeanPositionTracking args_info;
36     clitk::Signal mInput;
37     clitk::Signal mAugmentedInputX;
38     clitk::Signal mAugmentedInputY;
39     int mAugmentationDelay;
40     int mMaxIteration;
41     double mEta;
42     bool mEtaIsSet;
43     bool mOutputFilenameIsSet;
44     bool mOutputResidualFilenameIsSet;
45     bool mOutputAugmentedFilenameIsSet;
46     std::string mOutputFilename;
47     std::string mOutputResidualFilename;
48     std::string mOutputAugmentedFilename;
49     bool mVerbose;
50     bool mVerboseIteration;
51     bool mIsAdaptiveMethod;
52     std::vector<double> mCurrentResidual;
53     int mWindowLength;
54     std::vector<Vector2d> mCenters;
55
56     void FitEllipse(clitk::Ellipse & An);
57     void AdaptiveFitEllipse(clitk::Ellipse & An);
58
59     void ComputeAugmentedSpace(const clitk::Signal & input, 
60                                clitk::Signal & outputX, 
61                                clitk::Signal & outputY, 
62                                unsigned int delay);
63   };
64   //---------------------------------------------------------------------
65   
66 } // end namespace
67
68 #endif