ITK  5.0.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:
41  ITK_DISALLOW_COPY_AND_ASSIGN(ConnectedThresholdImageFilter);
42 
48 
50  itkNewMacro(Self);
51 
53  itkTypeMacro(ConnectedThresholdImageFilter,
55 
56  using InputImageType = TInputImage;
57  using InputImagePointer = typename InputImageType::Pointer;
58  using InputImageConstPointer = typename InputImageType::ConstPointer;
60  using InputImagePixelType = typename InputImageType::PixelType;
62  using SeedContainerType = typename std::vector<IndexType>;
64 
65  using OutputImageType = TOutputImage;
66  using OutputImagePointer = typename OutputImageType::Pointer;
68  using OutputImagePixelType = typename OutputImageType::PixelType;
69 
70  void PrintSelf(std::ostream & os, Indent indent) const override;
71 
73  void SetSeed(const IndexType & seed);
74 
75  void AddSeed(const IndexType & seed);
76 
78  void ClearSeeds();
79 
81  virtual const SeedContainerType &GetSeeds() const;
82 
86  itkSetMacro(ReplaceValue, OutputImagePixelType);
87  itkGetConstMacro(ReplaceValue, OutputImagePixelType);
89 
92 
94  virtual void SetUpper(InputImagePixelType);
95  virtual void SetLower(InputImagePixelType);
97 
99  virtual void SetUpperInput(const InputPixelObjectType *);
100  virtual void SetLowerInput(const InputPixelObjectType *);
102 
104  virtual InputImagePixelType GetUpper() const;
105  virtual InputImagePixelType GetLower() const;
107 
109  virtual InputPixelObjectType * GetUpperInput();
110  virtual InputPixelObjectType * GetLowerInput();
112 
114  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
115  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
116 
117 #ifdef ITK_USE_CONCEPT_CHECKING
118  // Begin concept checking
119  itkConceptMacro( OutputEqualityComparableCheck,
121  itkConceptMacro( InputEqualityComparableCheck,
123  itkConceptMacro( InputConvertibleToOutputCheck,
125  itkConceptMacro( SameDimensionCheck,
127  itkConceptMacro( IntConvertibleToInputCheck,
129  itkConceptMacro( OutputOStreamWritableCheck,
131  // End concept checking
132 #endif
133 
137  typedef enum {
139  FullConnectivity
140  } ConnectivityEnumType;
141 
144  itkSetEnumMacro(Connectivity, ConnectivityEnumType);
145  itkGetEnumMacro(Connectivity, ConnectivityEnumType);
147 
148 protected:
150  ~ConnectedThresholdImageFilter() override = default;
151 
152  // Override since the filter needs all the data for the algorithm.
153  void GenerateInputRequestedRegion() override;
154 
155  // Override since the filter produces the entire dataset.
156  void EnlargeOutputRequestedRegion(DataObject *output) override;
157 
158  void GenerateData() override;
159 
160 private:
162 
164 
166 };
167 } // end namespace itk
168 
169 #ifndef ITK_MANUAL_INSTANTIATION
170 #include "itkConnectedThresholdImageFilter.hxx"
171 #endif
172 
173 #endif
typename std::vector< IndexType > SeedContainerType
typename OutputImageType::Pointer OutputImagePointer
typename InputImageType::SizeType SizeType
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Base class for all process objects that output image data.
typename OutputImageType::PixelType OutputImagePixelType
typename InputImageType::PixelType InputImagePixelType
typename InputImageType::Pointer InputImagePointer
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...
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
typename InputImageType::IndexType IndexType
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
#define itkConceptMacro(name, concept)
typename InputImageType::ConstPointer InputImageConstPointer
Base class for all data objects in ITK.