ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkRobustAutomaticThresholdImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 itkRobustAutomaticThresholdImageFilter_h
19 #define itkRobustAutomaticThresholdImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
23 
24 namespace itk
25 {
50 template< typename TInputImage, typename TGradientImage = TInputImage, typename TOutputImage = TInputImage >
51 class ITK_TEMPLATE_EXPORT RobustAutomaticThresholdImageFilter:
52  public ImageToImageFilter< TInputImage, TOutputImage >
53 {
54 public:
55  ITK_DISALLOW_COPY_AND_ASSIGN(RobustAutomaticThresholdImageFilter);
56 
62 
64  itkNewMacro(Self);
65 
68 
70  using InputImageType = TInputImage;
71  using GradientImageType = TGradientImage;
72 
74  using InputPixelType = typename TInputImage::PixelType;
75  using OutputPixelType = typename TOutputImage::PixelType;
76  using GradientPixelType = typename TGradientImage::PixelType;
77 
79  using InputImagePointer = typename TInputImage::Pointer;
80  using OutputImagePointer = typename TOutputImage::Pointer;
81  using GradientImagePointer = typename TGradientImage::Pointer;
82 
89 
90  using CalculatorType =
92 
94  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
95  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
96 
99  itkSetMacro(OutsideValue, OutputPixelType);
100 
102  itkGetConstMacro(OutsideValue, OutputPixelType);
103 
106  itkSetMacro(InsideValue, OutputPixelType);
107 
109  itkGetConstMacro(InsideValue, OutputPixelType);
110 
112  itkGetConstMacro(Threshold, InputPixelType);
113 
114  itkSetMacro(Pow, double);
115  itkGetConstMacro(Pow, double);
116 
117 #ifdef ITK_USE_CONCEPT_CHECKING
118  // Begin concept checking
119  itkConceptMacro( OutputComparableCheck,
121  itkConceptMacro( OutputOStreamWritableCheck,
123  // End concept checking
124 #endif
125 
128  {
129  // Process object is not const-correct so the const casting is required.
130  this->SetNthInput( 1, const_cast< GradientImageType * >( input ) );
131  }
132 
135  {
136  return static_cast< GradientImageType * >( const_cast< DataObject * >( this->ProcessObject::GetInput(1) ) );
137  }
138 
140  void SetInput1(TInputImage *input)
141  {
142  this->SetInput(input);
143  }
144 
147  {
148  this->SetGradientImage(input);
149  }
150 
151 protected:
154  void PrintSelf(std::ostream & os, Indent indent) const override;
155 
156  void GenerateInputRequestedRegion() override;
157 
158  void GenerateData() override;
159 
160 private:
161  double m_Pow;
165 };
166 } // end namespace itk
167 
168 #ifndef ITK_MANUAL_INSTANTIATION
169 #include "itkRobustAutomaticThresholdImageFilter.hxx"
170 #endif
171 
172 #endif
typename OutputImageType::Pointer OutputImagePointer
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Base class for all process objects that output image data.
Threshold an image using robust automatic threshold selection (RATS) method.
typename InputImageType::Pointer InputImagePointer
typename OutputImageType::RegionType OutputImageRegionType
DataObject * GetInput(const DataObjectIdentifierType &key)
Return an input.
typename InputImageType::RegionType InputImageRegionType
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
#define itkConceptMacro(name, concept)
Base class for all data objects in ITK.