SimpleITK  
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::simple {
34 
48  public:
50 
52  virtual ~LabelStatisticsImageFilter();
53 
57 
60 
61 \
62 
65  SITK_RETURN_SELF_TYPE_HEADER SetUseHistograms ( bool UseHistograms ) { this->m_UseHistograms = UseHistograms; return *this; }
66 
68  SITK_RETURN_SELF_TYPE_HEADER UseHistogramsOn() { return this->SetUseHistograms(true); }
69  SITK_RETURN_SELF_TYPE_HEADER UseHistogramsOff() { return this->SetUseHistograms(false); }
70 
73  bool GetUseHistograms() const { return this->m_UseHistograms; }
81  double GetMinimum(int64_t label) const { return this->m_pfGetMinimum(label); };
82 
90  double GetMaximum(int64_t label) const { return this->m_pfGetMaximum(label); };
91 
99  double GetMean(int64_t label) const { return this->m_pfGetMean(label); };
100 
108  double GetMedian(int64_t label) const { return this->m_pfGetMedian(label); };
109 
117  double GetSigma(int64_t label) const { return this->m_pfGetSigma(label); };
118 
126  double GetVariance(int64_t label) const { return this->m_pfGetVariance(label); };
127 
135  double GetSum(int64_t label) const { return this->m_pfGetSum(label); };
136 
144  uint64_t GetCount(int64_t label) const { return this->m_pfGetCount(label); };
145 
153  std::vector<int> GetBoundingBox(int64_t label) const { return this->m_pfGetBoundingBox(label); };
154 
162  std::vector<unsigned int> GetRegion(int64_t label) const { return this->m_pfGetRegion(label); };
163 
170  std::vector<int64_t> GetLabels() const { return this->m_Labels; };
171 
172 
174  std::string GetName() const { return std::string ("LabelStatisticsImageFilter"); }
175 
177  std::string ToString() const;
178 
179 
182  void Execute ( const Image & image, const Image & labelImage );
183 
184 
186  bool HasLabel(int64_t label );
187 
189  uint64_t GetNumberOfLabels( );
190 
191 
192  private:
194  using MemberFunctionType = void (Self::*)( const Image * image, const Image * labelImage );
195 
197  template <class TImageType1, class TImageType2> void DualExecuteInternal ( const Image * image, const Image * labelImage );
198 
199 
200  std::unique_ptr<detail::DualMemberFunctionFactory<MemberFunctionType> > m_DualMemberFactory;
201 
202 
203 
204  bool m_UseHistograms{true};
205 
206 
207  std::function<double(int64_t)> m_pfGetMinimum;
208 
209  std::function<double(int64_t)> m_pfGetMaximum;
210 
211  std::function<double(int64_t)> m_pfGetMean;
212 
213  std::function<double(int64_t)> m_pfGetMedian;
214 
215  std::function<double(int64_t)> m_pfGetSigma;
216 
217  std::function<double(int64_t)> m_pfGetVariance;
218 
219  std::function<double(int64_t)> m_pfGetSum;
220 
221  std::function<uint64_t(int64_t)> m_pfGetCount;
222 
223  std::function<std::vector<int>(int64_t)> m_pfGetBoundingBox;
224 
225  std::function<std::vector<unsigned int>(int64_t)> m_pfGetRegion;
226 
227  std::vector<int64_t> m_Labels{std::vector<int64_t>()};
228 
229  // Holder of process object for active measurements
230  itk::ProcessObject *m_Filter{nullptr};
231 
232  };
233 
234 
235 }
236 #endif
itk::simple::Image
The Image class for SimpleITK.
Definition: sitkImage.h:76
sitkBasicFilters.h
itk::simple::LabelStatisticsImageFilter::GetRegion
std::vector< unsigned int > GetRegion(int64_t label) const
Definition: sitkLabelStatisticsImageFilter.h:162
itk::simple::LabelStatisticsImageFilter::GetCount
uint64_t GetCount(int64_t label) const
Definition: sitkLabelStatisticsImageFilter.h:144
itk::simple::LabelStatisticsImageFilter::m_pfGetRegion
std::function< std::vector< unsigned int >int64_t)> m_pfGetRegion
Definition: sitkLabelStatisticsImageFilter.h:225
itk::simple::LabelStatisticsImageFilter::UseHistogramsOn
Self & UseHistogramsOn()
Definition: sitkLabelStatisticsImageFilter.h:68
itk::simple::LabelStatisticsImageFilter::m_pfGetMedian
std::function< double(int64_t)> m_pfGetMedian
Definition: sitkLabelStatisticsImageFilter.h:213
itk::simple::LabelStatisticsImageFilter::GetVariance
double GetVariance(int64_t label) const
Definition: sitkLabelStatisticsImageFilter.h:126
itk::simple::BasicPixelIDTypeList
typelist2::typelist< BasicPixelID< int8_t >, BasicPixelID< uint8_t >, BasicPixelID< int16_t >, BasicPixelID< uint16_t >, BasicPixelID< int32_t >, BasicPixelID< uint32_t >, BasicPixelID< float >, BasicPixelID< double > > BasicPixelIDTypeList
Definition: sitkPixelIDTypeLists.h:51
itk::simple::LabelStatisticsImageFilter::GetMinimum
double GetMinimum(int64_t label) const
Definition: sitkLabelStatisticsImageFilter.h:81
itk::simple::LabelStatisticsImageFilter::m_pfGetSigma
std::function< double(int64_t)> m_pfGetSigma
Definition: sitkLabelStatisticsImageFilter.h:215
itk::simple::LabelStatisticsImageFilter::m_pfGetMaximum
std::function< double(int64_t)> m_pfGetMaximum
Definition: sitkLabelStatisticsImageFilter.h:209
itk::simple::LabelStatisticsImageFilter::GetMaximum
double GetMaximum(int64_t label) const
Definition: sitkLabelStatisticsImageFilter.h:90
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:47
itk::simple::LabelStatisticsImageFilter::m_pfGetBoundingBox
std::function< std::vector< int >int64_t)> m_pfGetBoundingBox
Definition: sitkLabelStatisticsImageFilter.h:223
itk::simple::LabelStatisticsImageFilter::m_pfGetVariance
std::function< double(int64_t)> m_pfGetVariance
Definition: sitkLabelStatisticsImageFilter.h:217
itk::simple::LabelStatisticsImageFilter::MemberFunctionType
void(Self::*)(const Image *image, const Image *labelImage) MemberFunctionType
Definition: sitkLabelStatisticsImageFilter.h:194
itk::simple::LabelStatisticsImageFilter::GetMean
double GetMean(int64_t label) const
Definition: sitkLabelStatisticsImageFilter.h:99
sitkDualMemberFunctionFactory.h
SITKBasicFilters_EXPORT
#define SITKBasicFilters_EXPORT
Definition: sitkBasicFilters.h:52
itk::simple::LabelStatisticsImageFilter::GetSigma
double GetSigma(int64_t label) const
Definition: sitkLabelStatisticsImageFilter.h:117
itk::simple::LabelStatisticsImageFilter::SetUseHistograms
Self & SetUseHistograms(bool UseHistograms)
Definition: sitkLabelStatisticsImageFilter.h:65
itk::simple::LabelStatisticsImageFilter::PixelIDTypeList
BasicPixelIDTypeList PixelIDTypeList
Definition: sitkLabelStatisticsImageFilter.h:59
itk::simple::detail::DualExecuteInternalAddressor
Definition: sitkDetail.h:40
itk::simple::LabelStatisticsImageFilter::GetName
std::string GetName() const
Definition: sitkLabelStatisticsImageFilter.h:174
itk::simple::LabelStatisticsImageFilter::GetSum
double GetSum(int64_t label) const
Definition: sitkLabelStatisticsImageFilter.h:135
itk::ProcessObject
itk::simple::LabelStatisticsImageFilter::m_pfGetSum
std::function< double(int64_t)> m_pfGetSum
Definition: sitkLabelStatisticsImageFilter.h:219
itk::simple::ImageFilter
The base interface for SimpleITK filters that take one input image.
Definition: sitkImageFilter.h:34
itk::simple::LabelStatisticsImageFilter::m_pfGetMinimum
std::function< double(int64_t)> m_pfGetMinimum
Definition: sitkLabelStatisticsImageFilter.h:207
itk::simple::LabelStatisticsImageFilter::GetLabels
std::vector< int64_t > GetLabels() const
Definition: sitkLabelStatisticsImageFilter.h:170
itk::simple::LabelStatisticsImageFilter::UseHistogramsOff
Self & UseHistogramsOff()
Definition: sitkLabelStatisticsImageFilter.h:69
itk::simple
Definition: sitkAdditionalProcedures.h:28
itk::simple::LabelStatisticsImageFilter::m_pfGetMean
std::function< double(int64_t)> m_pfGetMean
Definition: sitkLabelStatisticsImageFilter.h:211
itk::simple::LabelStatisticsImageFilter::GetBoundingBox
std::vector< int > GetBoundingBox(int64_t label) const
Definition: sitkLabelStatisticsImageFilter.h:153
itk::simple::LabelStatisticsImageFilter::m_DualMemberFactory
std::unique_ptr< detail::DualMemberFunctionFactory< MemberFunctionType > > m_DualMemberFactory
Definition: sitkLabelStatisticsImageFilter.h:200
itk::simple::LabelStatisticsImageFilter::m_pfGetCount
std::function< uint64_t(int64_t)> m_pfGetCount
Definition: sitkLabelStatisticsImageFilter.h:221
itk::simple::LabelStatisticsImageFilter::GetUseHistograms
bool GetUseHistograms() const
Definition: sitkLabelStatisticsImageFilter.h:73
itk::simple::LabelStatisticsImageFilter::GetMedian
double GetMedian(int64_t label) const
Definition: sitkLabelStatisticsImageFilter.h:108