SimpleITK  2.0.0
sitkLabelStatisticsImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 *
3 * Copyright NumFOCUS
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 sitkLabelStatisticsImageFilter_h
19 #define sitkLabelStatisticsImageFilter_h
20 
21 /*
22  * WARNING: DO NOT EDIT THIS FILE!
23  * THIS FILE IS AUTOMATICALLY GENERATED BY THE SIMPLEITK BUILD PROCESS.
24  * Please look at sitkDualImageFilterTemplate.h.in to make changes.
25  */
26 
27 #include <memory>
28 
29 #include "sitkImageFilter.h"
31 #include "sitkBasicFilters.h"
32 
33 namespace itk {
34  namespace simple {
35 
49  public:
51 
53  virtual ~LabelStatisticsImageFilter();
54 
58 
61 
62 \
63 
66  SITK_RETURN_SELF_TYPE_HEADER SetUseHistograms ( bool UseHistograms ) { this->m_UseHistograms = UseHistograms; return *this; }
67 
69  SITK_RETURN_SELF_TYPE_HEADER UseHistogramsOn() { return this->SetUseHistograms(true); }
70  SITK_RETURN_SELF_TYPE_HEADER UseHistogramsOff() { return this->SetUseHistograms(false); }
71 
74  bool GetUseHistograms() const { return this->m_UseHistograms; }
82  double GetMinimum(int64_t label) const { return this->m_pfGetMinimum(label); };
83 
91  double GetMaximum(int64_t label) const { return this->m_pfGetMaximum(label); };
92 
100  double GetMean(int64_t label) const { return this->m_pfGetMean(label); };
101 
109  double GetMedian(int64_t label) const { return this->m_pfGetMedian(label); };
110 
118  double GetSigma(int64_t label) const { return this->m_pfGetSigma(label); };
119 
127  double GetVariance(int64_t label) const { return this->m_pfGetVariance(label); };
128 
136  double GetSum(int64_t label) const { return this->m_pfGetSum(label); };
137 
145  uint64_t GetCount(int64_t label) const { return this->m_pfGetCount(label); };
146 
154  std::vector<int> GetBoundingBox(int64_t label) const { return this->m_pfGetBoundingBox(label); };
155 
163  std::vector<unsigned int> GetRegion(int64_t label) const { return this->m_pfGetRegion(label); };
164 
171  std::vector<int64_t> GetLabels() const { return this->m_Labels; };
172 
173 
175  std::string GetName() const { return std::string ("LabelStatisticsImageFilter"); }
176 
178  std::string ToString() const;
179 
180 
183  void Execute ( const Image & image, const Image & labelImage );
184 
185 
187  bool HasLabel(int64_t label );
188 
190  uint64_t GetNumberOfLabels( );
191 
192 
193  private:
195  using MemberFunctionType = void (Self::*)( const Image * image, const Image * labelImage );
196 
198  template <class TImageType1, class TImageType2> void DualExecuteInternal ( const Image * image, const Image * labelImage );
199 
200 
201  std::unique_ptr<detail::DualMemberFunctionFactory<MemberFunctionType> > m_DualMemberFactory;
202 
203 
204 
205  bool m_UseHistograms{true};
206 
207 
208  std::function<double(int64_t)> m_pfGetMinimum;
209 
210  std::function<double(int64_t)> m_pfGetMaximum;
211 
212  std::function<double(int64_t)> m_pfGetMean;
213 
214  std::function<double(int64_t)> m_pfGetMedian;
215 
216  std::function<double(int64_t)> m_pfGetSigma;
217 
218  std::function<double(int64_t)> m_pfGetVariance;
219 
220  std::function<double(int64_t)> m_pfGetSum;
221 
222  std::function<uint64_t(int64_t)> m_pfGetCount;
223 
224  std::function<std::vector<int>(int64_t)> m_pfGetBoundingBox;
225 
226  std::function<std::vector<unsigned int>(int64_t)> m_pfGetRegion;
227 
228  std::vector<int64_t> m_Labels{std::vector<int64_t>()};
229 
230  // Holder of process object for active measurements
231  itk::ProcessObject *m_Filter{nullptr};
232 
233  };
234 
235 
236  }
237 }
238 #endif
itk::simple::Image
The Image class for SimpleITK.
Definition: sitkImage.h:75
sitkBasicFilters.h
itk::simple::LabelStatisticsImageFilter::GetRegion
std::vector< unsigned int > GetRegion(int64_t label) const
Definition: sitkLabelStatisticsImageFilter.h:163
itk::simple::LabelStatisticsImageFilter::GetCount
uint64_t GetCount(int64_t label) const
Definition: sitkLabelStatisticsImageFilter.h:145
itk::simple::LabelStatisticsImageFilter::m_pfGetRegion
std::function< std::vector< unsigned int >int64_t)> m_pfGetRegion
Definition: sitkLabelStatisticsImageFilter.h:226
itk::simple::LabelStatisticsImageFilter::UseHistogramsOn
Self & UseHistogramsOn()
Definition: sitkLabelStatisticsImageFilter.h:69
itk::simple::LabelStatisticsImageFilter::m_pfGetMedian
std::function< double(int64_t)> m_pfGetMedian
Definition: sitkLabelStatisticsImageFilter.h:214
itk::simple::LabelStatisticsImageFilter::GetVariance
double GetVariance(int64_t label) const
Definition: sitkLabelStatisticsImageFilter.h:127
itk::simple::LabelStatisticsImageFilter::GetMinimum
double GetMinimum(int64_t label) const
Definition: sitkLabelStatisticsImageFilter.h:82
itk::simple::LabelStatisticsImageFilter::m_pfGetSigma
std::function< double(int64_t)> m_pfGetSigma
Definition: sitkLabelStatisticsImageFilter.h:216
itk::simple::LabelStatisticsImageFilter::m_pfGetMaximum
std::function< double(int64_t)> m_pfGetMaximum
Definition: sitkLabelStatisticsImageFilter.h:210
itk::simple::LabelStatisticsImageFilter::GetMaximum
double GetMaximum(int64_t label) const
Definition: sitkLabelStatisticsImageFilter.h:91
itk::simple::BasicPixelIDTypeList
typelist::MakeTypeList< BasicPixelID< int8_t >, BasicPixelID< uint8_t >, BasicPixelID< int16_t >, BasicPixelID< uint16_t >, BasicPixelID< int32_t >, BasicPixelID< uint32_t >, BasicPixelID< float >, BasicPixelID< double > >::Type BasicPixelIDTypeList
Definition: sitkPixelIDTypeLists.h:53
sitkImageFilter.h
itk::simple::LabelStatisticsImageFilter
Given an intensity image and a label map, compute min, max, variance and mean of the pixels associate...
Definition: sitkLabelStatisticsImageFilter.h:48
itk::int64_t
::int64_t int64_t
itk::simple::LabelStatisticsImageFilter::m_pfGetBoundingBox
std::function< std::vector< int >int64_t)> m_pfGetBoundingBox
Definition: sitkLabelStatisticsImageFilter.h:224
itk::simple::LabelStatisticsImageFilter::m_pfGetVariance
std::function< double(int64_t)> m_pfGetVariance
Definition: sitkLabelStatisticsImageFilter.h:218
itk::uint64_t
::uint64_t uint64_t
itk::simple::LabelStatisticsImageFilter::MemberFunctionType
void(Self::*)(const Image *image, const Image *labelImage) MemberFunctionType
Definition: sitkLabelStatisticsImageFilter.h:195
itk::simple::LabelStatisticsImageFilter::GetMean
double GetMean(int64_t label) const
Definition: sitkLabelStatisticsImageFilter.h:100
sitkDualMemberFunctionFactory.h
SITKBasicFilters_EXPORT
#define SITKBasicFilters_EXPORT
Definition: sitkBasicFilters.h:52
itk::simple::LabelStatisticsImageFilter::GetSigma
double GetSigma(int64_t label) const
Definition: sitkLabelStatisticsImageFilter.h:118
itk::simple::LabelStatisticsImageFilter::SetUseHistograms
Self & SetUseHistograms(bool UseHistograms)
Definition: sitkLabelStatisticsImageFilter.h:66
itk::simple::LabelStatisticsImageFilter::PixelIDTypeList
BasicPixelIDTypeList PixelIDTypeList
Definition: sitkLabelStatisticsImageFilter.h:60
itk::simple::detail::DualExecuteInternalAddressor
Definition: sitkDetail.h:44
itk::simple::LabelStatisticsImageFilter::GetName
std::string GetName() const
Definition: sitkLabelStatisticsImageFilter.h:175
itk
itk::simple::LabelStatisticsImageFilter::GetSum
double GetSum(int64_t label) const
Definition: sitkLabelStatisticsImageFilter.h:136
itk::ProcessObject
itk::simple::LabelStatisticsImageFilter::m_pfGetSum
std::function< double(int64_t)> m_pfGetSum
Definition: sitkLabelStatisticsImageFilter.h:220
itk::simple::ImageFilter
The base interface for SimpleITK filters that take one input image.
Definition: sitkImageFilter.h:36
itk::simple::LabelStatisticsImageFilter::m_pfGetMinimum
std::function< double(int64_t)> m_pfGetMinimum
Definition: sitkLabelStatisticsImageFilter.h:208
itk::simple::LabelStatisticsImageFilter::GetLabels
std::vector< int64_t > GetLabels() const
Definition: sitkLabelStatisticsImageFilter.h:171
itk::simple::LabelStatisticsImageFilter::UseHistogramsOff
Self & UseHistogramsOff()
Definition: sitkLabelStatisticsImageFilter.h:70
itk::simple::LabelStatisticsImageFilter::m_pfGetMean
std::function< double(int64_t)> m_pfGetMean
Definition: sitkLabelStatisticsImageFilter.h:212
itk::simple::LabelStatisticsImageFilter::GetBoundingBox
std::vector< int > GetBoundingBox(int64_t label) const
Definition: sitkLabelStatisticsImageFilter.h:154
itk::simple::LabelStatisticsImageFilter::m_DualMemberFactory
std::unique_ptr< detail::DualMemberFunctionFactory< MemberFunctionType > > m_DualMemberFactory
Definition: sitkLabelStatisticsImageFilter.h:201
itk::simple::LabelStatisticsImageFilter::m_pfGetCount
std::function< uint64_t(int64_t)> m_pfGetCount
Definition: sitkLabelStatisticsImageFilter.h:222
itk::simple::LabelStatisticsImageFilter::GetUseHistograms
bool GetUseHistograms() const
Definition: sitkLabelStatisticsImageFilter.h:74
itk::simple::LabelStatisticsImageFilter::GetMedian
double GetMedian(int64_t label) const
Definition: sitkLabelStatisticsImageFilter.h:109