ITK  4.2.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< class TInputImage, class TOutputImage >
72  public ImageToImageFilter< TInputImage, TOutputImage >
73 {
74 public:
80 
82  itkNewMacro(Self);
83 
85  itkTypeMacro(IsolatedConnectedImageFilter,
87 
88  typedef TInputImage InputImageType;
89  typedef typename InputImageType::Pointer InputImagePointer;
90  typedef typename InputImageType::ConstPointer InputImageConstPointer;
91  typedef typename InputImageType::RegionType InputImageRegionType;
92  typedef typename InputImageType::PixelType InputImagePixelType;
93  typedef typename InputImageType::IndexType IndexType;
94  typedef typename InputImageType::SizeType SizeType;
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;
107 
111  void SetSeed1(const IndexType & seed);
112 
114  void ClearSeeds1();
115 
117  void AddSeed1(const IndexType & seed);
118 
121  void SetSeed2(const IndexType & seed);
122 
124  void ClearSeeds2();
125 
127  void AddSeed2(const IndexType & seed);
128 
130  virtual const SeedsContainerType &GetSeeds1() const;
131  virtual const SeedsContainerType &GetSeeds2() const;
133 
136  itkSetMacro(Lower, InputImagePixelType);
137  itkGetConstReferenceMacro(Lower, InputImagePixelType);
139 
142  itkSetMacro(Upper, InputImagePixelType);
143  itkGetConstReferenceMacro(Upper, InputImagePixelType);
145 
149  void SetUpperValueLimit(InputImagePixelType upperValue)
150  {
151  this->SetUpper(upperValue);
152  }
153 
154  InputImagePixelType GetUpperValueLimit()
155  {
156  return this->GetUpper();
157  }
158 
161  itkSetMacro(IsolatedValueTolerance, InputImagePixelType);
162  itkGetConstReferenceMacro(IsolatedValueTolerance, InputImagePixelType);
164 
168  itkSetMacro(ReplaceValue, OutputImagePixelType);
169  itkGetConstReferenceMacro(ReplaceValue, OutputImagePixelType);
171 
173  itkGetConstReferenceMacro(IsolatedValue, InputImagePixelType);
174 
177  itkSetMacro(FindUpperThreshold, bool);
178  itkBooleanMacro(FindUpperThreshold);
179  itkGetConstReferenceMacro(FindUpperThreshold, bool);
181 
184  itkGetConstReferenceMacro(ThresholdingFailed, bool);
185 
186 #ifdef ITK_USE_CONCEPT_CHECKING
187 
188  itkConceptMacro( InputHasNumericTraitsCheck,
190 
192 #endif
193 protected:
199 
202 
204 
207 
210 
211  // Override since the filter needs all the data for the algorithm
212  void GenerateInputRequestedRegion();
213 
214  // Override since the filter produces the entire dataset
215  void EnlargeOutputRequestedRegion(DataObject *output);
216 
217  void GenerateData();
218 
219 private:
220  IsolatedConnectedImageFilter(const Self &); //purposely not implemented
221  void operator=(const Self &); //purposely not implemented
222 };
223 } // end namespace itk
224 
225 #ifndef ITK_MANUAL_INSTANTIATION
226 #include "itkIsolatedConnectedImageFilter.hxx"
227 #endif
228 
229 #endif
230