]> Creatis software - STMS.git/blob - Lib/PrePostProcessing/itkSTMS_ArgumentsAnalysis_Spine.h
First Relase on creatis's public git!
[STMS.git] / Lib / PrePostProcessing / itkSTMS_ArgumentsAnalysis_Spine.h
1 /*
2  #
3  #  File        : itkSTMS_ArgumentsAnalysis_Spine.h
4  #                ( C++ header file - STMS )
5  #
6  #  Description : STMS lib that implements the STMS filter and clustering.
7  #                This file is a part of the STMS Library project.
8  #                ( https://www.creatis.insa-lyon.fr/site7/fr/realisations )
9  #
10  #  [1] S. Mure, Grenier, T., Meier, S., Guttmann, R. G., et Benoit-Cattin, H.,
11  #       « Unsupervised spatio-temporal filtering of image sequences. A mean-shift specification »,
12  #       Pattern Recognition Letters, vol. 68, Part 1, p. 48 - 55, 2015.
13  #
14  #  Copyright   : Thomas GRENIER - Simon MURE
15  #                ( https://www.creatis.insa-lyon.fr/~grenier/ )
16  #
17  #  License     : CeCILL C
18  #                ( http://www.cecill.info/licences/Licence_CeCILL-C_V1-en.txt )
19  #
20  #  This software is governed by the CeCILL  license under French law and
21  #  abiding by the rules of distribution of free software.  You can  use,
22  #  modify and/ or redistribute the software under the terms of the CeCILL
23  #  license as circulated by CEA, CNRS and INRIA at the following URL
24  #  "http://www.cecill.info".
25  #
26  #  As a counterpart to the access to the source code and  rights to copy,
27  #  modify and redistribute granted by the license, users are provided only
28  #  with a limited warranty  and the software's author,  the holder of the
29  #  economic rights,  and the successive licensors  have only  limited
30  #  liability.
31  #
32  #  In this respect, the user's attention is drawn to the risks associated
33  #  with loading,  using,  modifying and/or developing or reproducing the
34  #  software by the user in light of its specific status of free software,
35  #  that may mean  that it is complicated to manipulate,  and  that  also
36  #  therefore means  that it is reserved for developers  and  experienced
37  #  professionals having in-depth computer knowledge. Users are therefore
38  #  encouraged to load and test the software's suitability as regards their
39  #  requirements in conditions enabling the security of their systems and/or
40  #  data to be ensured and,  more generally, to use and operate it in the
41  #  same conditions as regards security.
42  #
43  #  The fact that you are presently reading this means that you have had
44  #  knowledge of the CeCILL license and that you accept its terms.
45  #
46 */
47 /* Please don't forget to cite our work :
48   @article {MURE-15a,
49     title = {Unsupervised spatio-temporal filtering of image sequences. A mean-shift specification},
50     journal = {Pattern Recognition Letters},
51     volume = {68, Part 1},
52     year = {2015},
53     pages = {48 - 55},
54     issn = {0167-8655},
55     doi = {http://dx.doi.org/10.1016/j.patrec.2015.07.021},
56     url = {http://www.sciencedirect.com/science/article/pii/S0167865515002305},
57     author = {S. Mure and T Grenier and Meier, S. and Guttmann, R.G. and H. Benoit-Cattin}
58 }
59 */
60 #ifndef itkSTMS_ArgumentsAnalysisSpine_H
61 #define itkSTMS_ArgumentsAnalysisSpine_H
62
63 #include <getopt.h>
64 #include <string>
65 #include <list>
66
67 namespace itkSTMS_Spine
68 {
69     static struct option long_options[] =
70     {
71         {"image",          required_argument, 0, 'd'},
72         {"mask",           required_argument, 0, 'l'},
73         {"outFolder",      required_argument, 0, 'o'},
74         {"imageDimension", required_argument, 0, 'i'},
75         {"imageExtension", required_argument, 0, 'q'},
76         {"xScale",         required_argument, 0, 'x'},
77         {"yScale",         required_argument, 0, 'y'},
78         {"zScale",         required_argument, 0, 'z'},
79         {"rScale",         required_argument, 0, 'r'},
80         {"epsilon",        required_argument, 0, 'e'},
81         {"maxIt",          required_argument, 0, 'm'},
82         {"merge",          no_argument      , 0, 'g'},
83         {"help",           no_argument      , 0, 'h'},
84         {0, 0, 0, 0}
85     };
86
87     struct ParamsAnalysisOutputType
88     {
89         std::list<std::string>  images;
90         std::string  mask;
91         std::string  outFolder;
92         float        spScales[3];
93         float        rScale;
94         float        epsilon;
95         unsigned int maxIt;
96         unsigned int dim;
97         unsigned int numTimePoints;
98         bool         merge;
99         std::string  imageExtension;
100
101         std::string help;
102         bool        isOk;
103     };
104
105
106     class itkSTMS_ArgumentsAnalysis{
107
108     public:
109         itkSTMS_ArgumentsAnalysis(int argc, char **argv);
110         void Update();
111         void ParametersDisplay();
112         void ParametersAnalysisInfo();
113         void CheckProvidedParameters();
114         inline ParamsAnalysisOutputType* GetSTMSParams(){ return &readParams; }
115
116     private:
117         ParamsAnalysisOutputType readParams;
118         int    argc;
119         char **argv;
120
121     };
122 } // end of namespace itkSTMS
123
124 #ifndef ITK_MANUAL_INSTANTIATION
125 #include "itkSTMS_ArgumentsAnalysis_Spine.hxx"
126 #endif
127
128 #endif // itkSTMS_ArgumentsAnalysisSpine_H