ITK  4.9.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 >
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;
59  typedef typename InputImageType::IndexType IndexType;
60  typedef typename std::vector<IndexType> SeedContainerType;
61  typedef typename InputImageType::SizeType SizeType;
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 
99  virtual void SetLowerInput(const InputPixelObjectType *);
100 
102  virtual InputImagePixelType GetUpper() const;
103 
104  virtual InputImagePixelType GetLower() const;
105 
108 
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 
139 
142  itkSetEnumMacro(Connectivity, ConnectivityEnumType);
143  itkGetEnumMacro(Connectivity, ConnectivityEnumType);
145 
146 protected:
150 
153 
155 
156  // Override since the filter needs all the data for the algorithm
157  void GenerateInputRequestedRegion() ITK_OVERRIDE;
158 
159  // Override since the filter produces the entire dataset
160  void EnlargeOutputRequestedRegion(DataObject *output) ITK_OVERRIDE;
161 
162  void GenerateData() ITK_OVERRIDE;
163 
164  // Type of connectivity to use.
166 
167 private:
168  ConnectedThresholdImageFilter(const Self &) ITK_DELETE_FUNCTION;
169  void operator=(const Self &) ITK_DELETE_FUNCTION;
170 };
171 } // end namespace itk
172 
173 #ifndef ITK_MANUAL_INSTANTIATION
174 #include "itkConnectedThresholdImageFilter.hxx"
175 #endif
176 
177 #endif
virtual void SetUpperInput(const InputPixelObjectType *)
virtual void SetLower(InputImagePixelType)
void PrintSelf(std::ostream &os, Indent indent) const override
virtual void SetLowerInput(const InputPixelObjectType *)
virtual InputImagePixelType GetUpper() const
void SetSeed(const IndexType &seed)
Base class for all process objects that output image data.
virtual InputImagePixelType GetLower() const
virtual InputPixelObjectType * GetUpperInput()
void EnlargeOutputRequestedRegion(DataObject *output) override
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...
void GenerateInputRequestedRegion() override
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
virtual void SetUpper(InputImagePixelType)
SimpleDataObjectDecorator< InputImagePixelType > InputPixelObjectType
#define itkConceptMacro(name, concept)
virtual const SeedContainerType & GetSeeds() const
void AddSeed(const IndexType &seed)
Base class for all data objects in ITK.
virtual InputPixelObjectType * GetLowerInput()
ImageToImageFilter< TInputImage, TOutputImage > Superclass