ITK  4.13.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:
80 
82  itkNewMacro(Self);
83 
85  itkTypeMacro(IsolatedConnectedImageFilter,
87  typedef TInputImage InputImageType;
88  typedef typename InputImageType::Pointer InputImagePointer;
89  typedef typename InputImageType::ConstPointer InputImageConstPointer;
90  typedef typename InputImageType::RegionType InputImageRegionType;
91  typedef typename InputImageType::PixelType InputImagePixelType;
95 
96  typedef TOutputImage OutputImageType;
97  typedef typename OutputImageType::Pointer OutputImagePointer;
98  typedef typename OutputImageType::RegionType OutputImageRegionType;
99  typedef typename OutputImageType::PixelType OutputImagePixelType;
100 
101  typedef std::vector< IndexType > SeedsContainerType;
102 
103  typedef typename NumericTraits<
105 
106  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
107 
110  void AddSeed1(const IndexType & seed);
111 
112 #if ! defined ( ITK_FUTURE_LEGACY_REMOVE )
113 
117  void SetSeed1(const IndexType & seed);
118 #endif
119 
121  void ClearSeeds1();
122 
124  void AddSeed2(const IndexType & seed);
125 
126 #if ! defined ( ITK_FUTURE_LEGACY_REMOVE )
127 
130  void SetSeed2(const IndexType & seed);
131 #endif
132 
134  void ClearSeeds2();
135 
137  virtual const SeedsContainerType &GetSeeds1() const;
138  virtual const SeedsContainerType &GetSeeds2() const;
140 
143  itkSetMacro(Lower, InputImagePixelType);
144  itkGetConstReferenceMacro(Lower, InputImagePixelType);
146 
149  itkSetMacro(Upper, InputImagePixelType);
150  itkGetConstReferenceMacro(Upper, InputImagePixelType);
152 
153 #if ! defined ( ITK_FUTURE_LEGACY_REMOVE )
154 
159  {
160  this->SetUpper(upperValue);
161  }
162 
164  {
165  return this->GetUpper();
166  }
167 #endif
168 
171  itkSetMacro(IsolatedValueTolerance, InputImagePixelType);
172  itkGetConstReferenceMacro(IsolatedValueTolerance, InputImagePixelType);
174 
178  itkSetMacro(ReplaceValue, OutputImagePixelType);
179  itkGetConstReferenceMacro(ReplaceValue, OutputImagePixelType);
181 
183  itkGetConstReferenceMacro(IsolatedValue, InputImagePixelType);
184 
187  itkSetMacro(FindUpperThreshold, bool);
188  itkBooleanMacro(FindUpperThreshold);
189  itkGetConstReferenceMacro(FindUpperThreshold, bool);
191 
194  itkGetConstReferenceMacro(ThresholdingFailed, bool);
195 
196 #ifdef ITK_USE_CONCEPT_CHECKING
197  // Begin concept checking
198  itkConceptMacro( InputHasNumericTraitsCheck,
200  // End concept checking
201 #endif
202 
203 protected:
208 
211 
213 
216 
219 
220  // Override since the filter needs all the data for the algorithm
221  void GenerateInputRequestedRegion() ITK_OVERRIDE;
222 
223  // Override since the filter produces the entire dataset
224  void EnlargeOutputRequestedRegion(DataObject *output) ITK_OVERRIDE;
225 
226  void GenerateData() ITK_OVERRIDE;
227 
228 private:
229  ITK_DISALLOW_COPY_AND_ASSIGN(IsolatedConnectedImageFilter);
230 };
231 } // end namespace itk
232 
233 #ifndef ITK_MANUAL_INSTANTIATION
234 #include "itkIsolatedConnectedImageFilter.hxx"
235 #endif
236 
237 #endif
Base class for all process objects that output image data.
void SetUpperValueLimit(InputImagePixelType upperValue)
InputImageType::ConstPointer InputImageConstPointer
OutputImageType::PixelType OutputImagePixelType
InputImageType::PixelType InputImagePixelType
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 additional traits for native types such as int or float.
Label pixels that are connected to one set of seeds but not another.
#define itkConceptMacro(name, concept)
NumericTraits< InputImagePixelType >::RealType InputRealType
Base class for all data objects in ITK.
ImageToImageFilter< TInputImage, TOutputImage > Superclass