ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkResourceProbe.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkResourceProbe_h
19 #define __itkResourceProbe_h
20 
21 #include "itkMacro.h"
22 #include "itkIntTypes.h"
23 #include <string>
24 
25 namespace itk
26 {
38 template< typename ValueType, typename MeanType >
40 {
41 public:
42 
46 
47 public:
48 
50  ResourceProbe(const std::string & type, const std::string & unit);
51 
53  virtual ~ResourceProbe();
54 
56  std::string GetType(void) const;
57 
59  std::string GetUnit(void) const;
60 
62  void Start(void);
63 
69  void Stop(void);
70 
72  CountType GetNumberOfStarts(void) const;
73 
75  CountType GetNumberOfStops(void) const;
76 
79  virtual ValueType GetInstantValue(void) const = 0;
80 
83  ValueType GetTotal(void) const;
84 
88  MeanType GetMean(void) const;
89 
91  void Reset(void);
92 
93 private:
94 
95  ValueType m_StartValue;
96  ValueType m_TotalValue;
97 
100 
101  std::string m_TypeString;
102  std::string m_UnitString;
103 };
104 } // end namespace itk
105 
106 #ifndef ITK_MANUAL_INSTANTIATION
107 #include "itkResourceProbe.hxx"
108 #endif
109 
110 #endif //__itkResourceProbe_h
MeanType GetMean(void) const
std::string GetUnit(void) const
ResourceProbe(const std::string &type, const std::string &unit)
*brief Mask an image with the negative of a mask **This class is templated over the types of the *input image type
CountType GetNumberOfStarts(void) const
std::string m_TypeString
unsigned long SizeValueType
Definition: itkIntTypes.h:143
std::string m_UnitString
ValueType GetTotal(void) const
CountType GetNumberOfStops(void) const
std::string GetType(void) const
CountType m_NumberOfStarts
virtual ~ResourceProbe()
SizeValueType CountType
virtual ValueType GetInstantValue(void) const =0
Computes the change of a value between two points in code.