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.jinja to make changes.
25 */
26
27#include <memory>
28
29#include "sitkBasicFilters.h"
30#include "sitkImageFilter.h"
32
33namespace itk::simple {
34
56public:
58
61
65
68
69
70
71
75 void
76 SetInsideValue(uint8_t InsideValue )
77 { this->m_InsideValue = InsideValue; }
78
81 uint8_t
82 GetInsideValue() const { return this->m_InsideValue; }
83
84
88 void
89 SetOutsideValue(uint8_t OutsideValue )
90 { this->m_OutsideValue = OutsideValue; }
91
94 uint8_t
95 GetOutsideValue() const { return this->m_OutsideValue; }
96
97
101 void
102 SetNumberOfHistogramBins(uint32_t NumberOfHistogramBins )
103 { this->m_NumberOfHistogramBins = NumberOfHistogramBins; }
104
106 uint32_t
108
109
113 void
114 SetMaskOutput(bool MaskOutput )
115 { this->m_MaskOutput = MaskOutput; }
116
118 void
119 MaskOutputOn() { return this->SetMaskOutput(true); }
120 void
121 MaskOutputOff() { return this->SetMaskOutput(false); }
124 bool
125 GetMaskOutput() const { return this->m_MaskOutput; }
126
127
132 void
133 SetMaskValue(uint8_t MaskValue )
134 { this->m_MaskValue = MaskValue; }
135
137 uint8_t
138 GetMaskValue() const { return this->m_MaskValue; }
139
140
144 void
145 SetReturnBinMidpoint(bool ReturnBinMidpoint )
146 { this->m_ReturnBinMidpoint = ReturnBinMidpoint; }
147
149 void
151 void
156 bool
158
159
165 double GetThreshold() const { return this->m_Threshold; }
166
168 std::string GetName() const { return std::string("OtsuThresholdImageFilter"); }
169
171 std::string ToString() const;
172
173
175 Image Execute(const Image &image, const Image &maskImage);
176 Image Execute(const Image &image);
177
178
179private:
181 using MemberFunctionType = Image (Self::*)(const Image *
182 image, const Image *
183 maskImage);
184 template <class TImageType> Image ExecuteInternal(const Image *
185 image, const Image *
186 maskImage);
189
190
191 uint8_t m_InsideValue{ 1u };
192
193 uint8_t m_OutsideValue{ 0u };
194
195 uint32_t m_NumberOfHistogramBins{ 128u };
196
197 bool m_MaskOutput{ true };
198
199 uint8_t m_MaskValue{ 255u };
200
201 bool m_ReturnBinMidpoint{ false };
202
203
204
205 double m_Threshold{ 0.0 };
206
207
208
209
210};
211
212
222 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
223);
224
226 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
227);
228
230
231}
232#endif
The Image class for SimpleITK.
Definition sitkImage.h:77
static const detail::MemberFunctionFactory< MemberFunctionType > & GetMemberFunctionFactory()
double GetThreshold() const
Get the computed threshold.
void SetNumberOfHistogramBins(uint32_t NumberOfHistogramBins)
Image Execute(const Image &image)
Image ExecuteInternal(const Image *image, const Image *maskImage)
Image(Self::*)(const Image * image, const Image * maskImage) MemberFunctionType
Image Execute(const Image &image, const Image &maskImage)
A class used to instantiate and generate function object to templated member functions.
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.
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
#define SITKBasicFilters_EXPORT