ITK  6.0.0
Insight Toolkit
itkDoubleThresholdImageFilter.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  * https://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 itkDoubleThresholdImageFilter_h
19 #define itkDoubleThresholdImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 
23 namespace itk
24 {
53 template <typename TInputImage, typename TOutputImage>
54 class ITK_TEMPLATE_EXPORT DoubleThresholdImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
55 {
56 public:
57  ITK_DISALLOW_COPY_AND_MOVE(DoubleThresholdImageFilter);
58 
64 
66  itkNewMacro(Self);
67 
69  itkOverrideGetNameOfClassMacro(DoubleThresholdImageFilter);
70 
72  using typename Superclass::InputImagePointer;
73  using typename Superclass::InputImageType;
74 
76  using InputPixelType = typename TInputImage::PixelType;
77  using OutputPixelType = typename TOutputImage::PixelType;
78 
81  itkSetMacro(OutsideValue, OutputPixelType);
82 
84  itkGetConstMacro(OutsideValue, OutputPixelType);
85 
88  itkSetMacro(InsideValue, OutputPixelType);
89 
91  itkGetConstMacro(InsideValue, OutputPixelType);
92 
98  itkSetMacro(Threshold1, InputPixelType);
99  itkSetMacro(Threshold2, InputPixelType);
100  itkSetMacro(Threshold3, InputPixelType);
101  itkSetMacro(Threshold4, InputPixelType);
105  itkGetConstMacro(Threshold1, InputPixelType);
106  itkGetConstMacro(Threshold2, InputPixelType);
107  itkGetConstMacro(Threshold3, InputPixelType);
108  itkGetConstMacro(Threshold4, InputPixelType);
117  itkSetMacro(FullyConnected, bool);
118  itkGetConstReferenceMacro(FullyConnected, bool);
119  itkBooleanMacro(FullyConnected);
122 #ifdef ITK_USE_CONCEPT_CHECKING
123  // Begin concept checking
124  itkConceptMacro(OutputEqualityComparableCheck, (Concept::EqualityComparable<OutputPixelType>));
125  itkConceptMacro(InputComparableCheck, (Concept::Comparable<InputPixelType>));
126  itkConceptMacro(InputOStreamWritableCheck, (Concept::OStreamWritable<InputPixelType>));
127  itkConceptMacro(OutputOStreamWritableCheck, (Concept::OStreamWritable<OutputPixelType>));
128  // End concept checking
129 #endif
130 
131 protected:
133  ~DoubleThresholdImageFilter() override = default;
134  void
135  PrintSelf(std::ostream & os, Indent indent) const override;
136 
139  void
140  GenerateInputRequestedRegion() override;
141 
144  void
145  EnlargeOutputRequestedRegion(DataObject * itkNotUsed(output)) override;
146 
150  void
151  GenerateData() override;
152 
153 private:
154  InputPixelType m_Threshold1{};
155  InputPixelType m_Threshold2{};
156  InputPixelType m_Threshold3{};
157  InputPixelType m_Threshold4{};
158 
159  OutputPixelType m_InsideValue{};
160  OutputPixelType m_OutsideValue{};
161 
162  unsigned long m_NumberOfIterationsUsed{ 1 };
163 
164  bool m_FullyConnected{};
165 };
166 } // end namespace itk
167 
168 #ifndef ITK_MANUAL_INSTANTIATION
169 # include "itkDoubleThresholdImageFilter.hxx"
170 #endif
171 
172 #endif
itk::DoubleThresholdImageFilter::OutputPixelType
typename TOutputImage::PixelType OutputPixelType
Definition: itkDoubleThresholdImageFilter.h:77
itk::Concept::OStreamWritable
Definition: itkConceptChecking.h:639
itk::DoubleThresholdImageFilter::InputPixelType
typename TInputImage::PixelType InputPixelType
Definition: itkDoubleThresholdImageFilter.h:76
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::DoubleThresholdImageFilter
Binarize an input image using double thresholding.
Definition: itkDoubleThresholdImageFilter.h:54
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itkImageToImageFilter.h
itk::Concept::Comparable
Definition: itkConceptChecking.h:332
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::Concept::EqualityComparable
Definition: itkConceptChecking.h:307
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293