ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkIsolatedConnectedImageFilter.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 itkIsolatedConnectedImageFilter_h
19 #define itkIsolatedConnectedImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 
23 namespace itk
24 {
70 template< typename TInputImage, typename TOutputImage >
71 class ITK_TEMPLATE_EXPORT IsolatedConnectedImageFilter:
72  public ImageToImageFilter< TInputImage, TOutputImage >
73 {
74 public:
75  ITK_DISALLOW_COPY_AND_ASSIGN(IsolatedConnectedImageFilter);
76 
82 
84  itkNewMacro(Self);
85 
87  itkTypeMacro(IsolatedConnectedImageFilter,
89  using InputImageType = TInputImage;
90  using InputImagePointer = typename InputImageType::Pointer;
91  using InputImageConstPointer = typename InputImageType::ConstPointer;
93  using InputImagePixelType = typename InputImageType::PixelType;
97 
98  using OutputImageType = TOutputImage;
99  using OutputImagePointer = typename OutputImageType::Pointer;
101  using OutputImagePixelType = typename OutputImageType::PixelType;
102 
103  using SeedsContainerType = std::vector< IndexType >;
104 
106 
107  void PrintSelf(std::ostream & os, Indent indent) const override;
108 
111  void AddSeed1(const IndexType & seed);
112 
118  void SetSeed1(const IndexType & seed);
119 
121  void ClearSeeds1();
122 
124  void AddSeed2(const IndexType & seed);
125 
130  void SetSeed2(const IndexType & seed);
131 
133  void ClearSeeds2();
134 
136  virtual const SeedsContainerType &GetSeeds1() const;
137  virtual const SeedsContainerType &GetSeeds2() const;
139 
142  itkSetMacro(Lower, InputImagePixelType);
143  itkGetConstReferenceMacro(Lower, InputImagePixelType);
145 
148  itkSetMacro(Upper, InputImagePixelType);
149  itkGetConstReferenceMacro(Upper, InputImagePixelType);
151 
152 #if ! defined ( ITK_LEGACY_REMOVE )
153 
157  void SetUpperValueLimit(InputImagePixelType upperValue)
158  {
159  this->SetUpper(upperValue);
160  }
161 
162  InputImagePixelType GetUpperValueLimit()
163  {
164  return this->GetUpper();
165  }
166 #endif
167 
170  itkSetMacro(IsolatedValueTolerance, InputImagePixelType);
171  itkGetConstReferenceMacro(IsolatedValueTolerance, InputImagePixelType);
173 
177  itkSetMacro(ReplaceValue, OutputImagePixelType);
178  itkGetConstReferenceMacro(ReplaceValue, OutputImagePixelType);
180 
182  itkGetConstReferenceMacro(IsolatedValue, InputImagePixelType);
183 
186  itkSetMacro(FindUpperThreshold, bool);
187  itkBooleanMacro(FindUpperThreshold);
188  itkGetConstReferenceMacro(FindUpperThreshold, bool);
190 
193  itkGetConstReferenceMacro(ThresholdingFailed, bool);
194 
195 #ifdef ITK_USE_CONCEPT_CHECKING
196  // Begin concept checking
197  itkConceptMacro( InputHasNumericTraitsCheck,
198  ( Concept::HasNumericTraits< InputImagePixelType > ) );
199  // End concept checking
200 #endif
201 
202 protected:
203  IsolatedConnectedImageFilter();
204  ~IsolatedConnectedImageFilter() override = default;
207 
210 
212 
215 
218 
219  // Override since the filter needs all the data for the algorithm
220  void GenerateInputRequestedRegion() override;
221 
222  // Override since the filter produces the entire dataset
223  void EnlargeOutputRequestedRegion(DataObject *output) override;
224 
225  void GenerateData() override;
226 };
227 } // end namespace itk
228 
229 #ifndef ITK_MANUAL_INSTANTIATION
230 #include "itkIsolatedConnectedImageFilter.hxx"
231 #endif
232 
233 #endif
typename OutputImageType::Pointer OutputImagePointer
Define numeric traits for std::vector.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
typename InputImageType::SizeType SizeType
Base class for all process objects that output image data.
typename OutputImageType::PixelType OutputImagePixelType
typename InputImageType::PixelType InputImagePixelType
typename InputImageType::Pointer InputImagePointer
typename OutputImageType::RegionType OutputImageRegionType
typename InputImageType::IndexType IndexType
TOutputImage OutputImageType
typename NumericTraits< InputImagePixelType >::RealType InputRealType
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
Label pixels that are connected to one set of seeds but not another.
#define itkConceptMacro(name, concept)
typename InputImageType::ConstPointer InputImageConstPointer
Base class for all data objects in ITK.