ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkConnectedThresholdImageFilter.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 itkConnectedThresholdImageFilter_h
19 #define itkConnectedThresholdImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
23 
24 namespace itk
25 {
36 template< typename TInputImage, typename TOutputImage >
37 class ITK_TEMPLATE_EXPORT ConnectedThresholdImageFilter:
38  public ImageToImageFilter< TInputImage, TOutputImage >
39 {
40 public:
46 
48  itkNewMacro(Self);
49 
51  itkTypeMacro(ConnectedThresholdImageFilter,
53 
54  typedef TInputImage InputImageType;
55  typedef typename InputImageType::Pointer InputImagePointer;
56  typedef typename InputImageType::ConstPointer InputImageConstPointer;
57  typedef typename InputImageType::RegionType InputImageRegionType;
58  typedef typename InputImageType::PixelType InputImagePixelType;
60  typedef typename std::vector<IndexType> SeedContainerType;
62 
63  typedef TOutputImage OutputImageType;
64  typedef typename OutputImageType::Pointer OutputImagePointer;
65  typedef typename OutputImageType::RegionType OutputImageRegionType;
66  typedef typename OutputImageType::PixelType OutputImagePixelType;
67 
68  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
69 
71  void SetSeed(const IndexType & seed);
72 
73  void AddSeed(const IndexType & seed);
74 
76  void ClearSeeds();
77 
79  virtual const SeedContainerType &GetSeeds() const;
80 
84  itkSetMacro(ReplaceValue, OutputImagePixelType);
85  itkGetConstMacro(ReplaceValue, OutputImagePixelType);
87 
90 
92  virtual void SetUpper(InputImagePixelType);
93  virtual void SetLower(InputImagePixelType);
95 
97  virtual void SetUpperInput(const InputPixelObjectType *);
98  virtual void SetLowerInput(const InputPixelObjectType *);
100 
102  virtual InputImagePixelType GetUpper() const;
103  virtual InputImagePixelType GetLower() const;
105 
107  virtual InputPixelObjectType * GetUpperInput();
108  virtual InputPixelObjectType * GetLowerInput();
110 
112  itkStaticConstMacro(InputImageDimension, unsigned int,
113  TInputImage::ImageDimension);
114  itkStaticConstMacro(OutputImageDimension, unsigned int,
115  TOutputImage::ImageDimension);
117 
118 #ifdef ITK_USE_CONCEPT_CHECKING
119  // Begin concept checking
120  itkConceptMacro( OutputEqualityComparableCheck,
122  itkConceptMacro( InputEqualityComparableCheck,
124  itkConceptMacro( InputConvertibleToOutputCheck,
126  itkConceptMacro( SameDimensionCheck,
128  itkConceptMacro( IntConvertibleToInputCheck,
130  itkConceptMacro( OutputOStreamWritableCheck,
132  // End concept checking
133 #endif
134 
138  typedef enum {
140  FullConnectivity
141  } ConnectivityEnumType;
142 
145  itkSetEnumMacro(Connectivity, ConnectivityEnumType);
146  itkGetEnumMacro(Connectivity, ConnectivityEnumType);
148 
149 protected:
152 
153  // Override since the filter needs all the data for the algorithm.
154  void GenerateInputRequestedRegion() ITK_OVERRIDE;
155 
156  // Override since the filter produces the entire dataset.
157  void EnlargeOutputRequestedRegion(DataObject *output) ITK_OVERRIDE;
158 
159  void GenerateData() ITK_OVERRIDE;
160 
161 private:
162  ITK_DISALLOW_COPY_AND_ASSIGN(ConnectedThresholdImageFilter);
163 
164  SeedContainerType m_Seeds;
165 
166  OutputImagePixelType m_ReplaceValue;
167 
168  ConnectivityEnumType m_Connectivity;
169 };
170 } // end namespace itk
171 
172 #ifndef ITK_MANUAL_INSTANTIATION
173 #include "itkConnectedThresholdImageFilter.hxx"
174 #endif
175 
176 #endif
Base class for all process objects that output image data.
Label pixels that are connected to a seed and lie within a range of values.
Decorates any &quot;simple&quot; data type (data types without smart pointers) with a DataObject API...
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
SimpleDataObjectDecorator< InputImagePixelType > InputPixelObjectType
#define itkConceptMacro(name, concept)
Base class for all data objects in ITK.
ImageToImageFilter< TInputImage, TOutputImage > Superclass