SimpleITK  
sitkOtsuThresholdImageFilter.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 sitkOtsuThresholdImageFilter_h
19 #define sitkOtsuThresholdImageFilter_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 sitkImageFilterTemplate.h.in to make changes.
25  */
26 
27 #include <memory>
28 
29 #include "sitkBasicFilters.h"
30 #include "sitkImageFilter.h"
31 
32 namespace itk::simple {
33 
52  public:
54 
56  virtual ~OtsuThresholdImageFilter();
57 
61 
64 \
65 
70  SITK_RETURN_SELF_TYPE_HEADER SetInsideValue ( uint8_t InsideValue ) { this->m_InsideValue = InsideValue; return *this; }
71 
76  uint8_t GetInsideValue() const { return this->m_InsideValue; }\
77 
82  SITK_RETURN_SELF_TYPE_HEADER SetOutsideValue ( uint8_t OutsideValue ) { this->m_OutsideValue = OutsideValue; return *this; }
83 
88  uint8_t GetOutsideValue() const { return this->m_OutsideValue; }\
89 
94  SITK_RETURN_SELF_TYPE_HEADER SetNumberOfHistogramBins ( uint32_t NumberOfHistogramBins ) { this->m_NumberOfHistogramBins = NumberOfHistogramBins; return *this; }
95 
98  uint32_t GetNumberOfHistogramBins() const { return this->m_NumberOfHistogramBins; }\
99 
103  SITK_RETURN_SELF_TYPE_HEADER SetMaskOutput ( bool MaskOutput ) { this->m_MaskOutput = MaskOutput; return *this; }
104 
106  SITK_RETURN_SELF_TYPE_HEADER MaskOutputOn() { return this->SetMaskOutput(true); }
107  SITK_RETURN_SELF_TYPE_HEADER MaskOutputOff() { return this->SetMaskOutput(false); }
108 
111  bool GetMaskOutput() const { return this->m_MaskOutput; }\
112 
116  SITK_RETURN_SELF_TYPE_HEADER SetMaskValue ( uint8_t MaskValue ) { this->m_MaskValue = MaskValue; return *this; }
117 
120  uint8_t GetMaskValue() const { return this->m_MaskValue; }\
121 
125  SITK_RETURN_SELF_TYPE_HEADER SetReturnBinMidpoint ( bool ReturnBinMidpoint ) { this->m_ReturnBinMidpoint = ReturnBinMidpoint; return *this; }
126 
128  SITK_RETURN_SELF_TYPE_HEADER ReturnBinMidpointOn() { return this->SetReturnBinMidpoint(true); }
129  SITK_RETURN_SELF_TYPE_HEADER ReturnBinMidpointOff() { return this->SetReturnBinMidpoint(false); }
130 
134  bool GetReturnBinMidpoint() const { return this->m_ReturnBinMidpoint; }
141  double GetThreshold() const { return this->m_Threshold; };
142 
143 
145  std::string GetName() const { return std::string ("OtsuThresholdImageFilter"); }
146 
148  std::string ToString() const;
149 
150 
153  Image Execute ( const Image & image, const Image & maskImage );
154  Image Execute ( const Image & image );
155 
156  private:
157 
160  using MemberFunctionType = Image (Self::*)( const Image * image, const Image * maskImage );
161  template <class TImageType> Image ExecuteInternal ( const Image * image, const Image * maskImage );
162 
163 
165 
166  std::unique_ptr<detail::MemberFunctionFactory<MemberFunctionType> > m_MemberFactory;
167 
168 
169  uint8_t m_InsideValue{1u};
170 
171  uint8_t m_OutsideValue{0u};
172 
173  uint32_t m_NumberOfHistogramBins{128u};
174 
175  bool m_MaskOutput{true};
176 
177  uint8_t m_MaskValue{255u};
178 
179  bool m_ReturnBinMidpoint{false};
180 
181  /* Docs */
182  double m_Threshold{0.0};
183 
184 
185  };
186 
197  SITKBasicFilters_EXPORT Image OtsuThreshold ( const Image & image, const Image & maskImage, uint8_t insideValue = 1u, uint8_t outsideValue = 0u, uint32_t numberOfHistogramBins = 128u, bool maskOutput = true, uint8_t maskValue = 255u, bool returnBinMidpoint = false );
198  SITKBasicFilters_EXPORT Image OtsuThreshold ( const Image & image, uint8_t insideValue = 1u, uint8_t outsideValue = 0u, uint32_t numberOfHistogramBins = 128u, bool maskOutput = true, uint8_t maskValue = 255u, bool returnBinMidpoint = false );
200 }
201 #endif
itk::simple::Image
The Image class for SimpleITK.
Definition: sitkImage.h:76
sitkBasicFilters.h
itk::simple::detail::MemberFunctionAddressor
Definition: sitkDetail.h:29
itk::simple::OtsuThresholdImageFilter::SetMaskOutput
Self & SetMaskOutput(bool MaskOutput)
Definition: sitkOtsuThresholdImageFilter.h:103
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::OtsuThresholdImageFilter::SetNumberOfHistogramBins
Self & SetNumberOfHistogramBins(uint32_t NumberOfHistogramBins)
Definition: sitkOtsuThresholdImageFilter.h:94
itk::simple::OtsuThresholdImageFilter::m_MemberFactory
std::unique_ptr< detail::MemberFunctionFactory< MemberFunctionType > > m_MemberFactory
Definition: sitkOtsuThresholdImageFilter.h:166
itk::simple::OtsuThresholdImageFilter::ReturnBinMidpointOn
Self & ReturnBinMidpointOn()
Definition: sitkOtsuThresholdImageFilter.h:128
itk::simple::OtsuThresholdImageFilter::MaskOutputOn
Self & MaskOutputOn()
Definition: sitkOtsuThresholdImageFilter.h:106
sitkImageFilter.h
itk::simple::OtsuThresholdImageFilter::GetNumberOfHistogramBins
uint32_t GetNumberOfHistogramBins() const
Definition: sitkOtsuThresholdImageFilter.h:98
itk::simple::OtsuThresholdImageFilter::SetReturnBinMidpoint
Self & SetReturnBinMidpoint(bool ReturnBinMidpoint)
Definition: sitkOtsuThresholdImageFilter.h:125
itk::simple::OtsuThreshold
Image OtsuThreshold(const Image &image, const Image &maskImage, uint8_t insideValue=1u, uint8_t outsideValue=0u, uint32_t numberOfHistogramBins=128u, bool maskOutput=true, uint8_t maskValue=255u, bool returnBinMidpoint=false)
Threshold an image using the Otsu Threshold.
itk::simple::OtsuThresholdImageFilter::GetMaskOutput
bool GetMaskOutput() const
Definition: sitkOtsuThresholdImageFilter.h:111
itk::simple::OtsuThresholdImageFilter::PixelIDTypeList
BasicPixelIDTypeList PixelIDTypeList
Definition: sitkOtsuThresholdImageFilter.h:63
itk::simple::OtsuThresholdImageFilter::SetMaskValue
Self & SetMaskValue(uint8_t MaskValue)
Definition: sitkOtsuThresholdImageFilter.h:116
itk::simple::OtsuThresholdImageFilter::SetInsideValue
Self & SetInsideValue(uint8_t InsideValue)
Definition: sitkOtsuThresholdImageFilter.h:70
itk::simple::OtsuThresholdImageFilter
Threshold an image using the Otsu Threshold.
Definition: sitkOtsuThresholdImageFilter.h:51
itk::simple::OtsuThresholdImageFilter::ReturnBinMidpointOff
Self & ReturnBinMidpointOff()
Definition: sitkOtsuThresholdImageFilter.h:129
SITKBasicFilters_EXPORT
#define SITKBasicFilters_EXPORT
Definition: sitkBasicFilters.h:52
itk::simple::OtsuThresholdImageFilter::GetInsideValue
uint8_t GetInsideValue() const
Definition: sitkOtsuThresholdImageFilter.h:76
itk::simple::OtsuThresholdImageFilter::GetMaskValue
uint8_t GetMaskValue() const
Definition: sitkOtsuThresholdImageFilter.h:120
itk::simple::OtsuThresholdImageFilter::GetReturnBinMidpoint
bool GetReturnBinMidpoint() const
Definition: sitkOtsuThresholdImageFilter.h:134
itk::simple::OtsuThresholdImageFilter::SetOutsideValue
Self & SetOutsideValue(uint8_t OutsideValue)
Definition: sitkOtsuThresholdImageFilter.h:82
itk::simple::OtsuThresholdImageFilter::GetOutsideValue
uint8_t GetOutsideValue() const
Definition: sitkOtsuThresholdImageFilter.h:88
itk::simple::ImageFilter
The base interface for SimpleITK filters that take one input image.
Definition: sitkImageFilter.h:35
itk::simple::OtsuThresholdImageFilter::GetName
std::string GetName() const
Definition: sitkOtsuThresholdImageFilter.h:145
itk::Image
Definition: sitkPixelIDTypes.h:28
itk::simple::OtsuThresholdImageFilter::MaskOutputOff
Self & MaskOutputOff()
Definition: sitkOtsuThresholdImageFilter.h:107
itk::simple
Definition: sitkAdditionalProcedures.h:28
itk::simple::OtsuThresholdImageFilter::MemberFunctionType
Image(Self::*)(const Image *image, const Image *maskImage) MemberFunctionType
Definition: sitkOtsuThresholdImageFilter.h:160
itk::simple::OtsuThresholdImageFilter::GetThreshold
double GetThreshold() const
Get the computed threshold.
Definition: sitkOtsuThresholdImageFilter.h:141