ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkValuedRegionalExtremaImageFilter.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 itkValuedRegionalExtremaImageFilter_h
19 #define itkValuedRegionalExtremaImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
24 #include <stack>
25 
26 namespace itk
27 {
77 template< typename TInputImage, typename TOutputImage,
78  typename TFunction1, typename TFunction2 >
79 class ITK_TEMPLATE_EXPORT ValuedRegionalExtremaImageFilter:
80  public ImageToImageFilter< TInputImage, TOutputImage >
81 {
82 public:
83  ITK_DISALLOW_COPY_AND_ASSIGN(ValuedRegionalExtremaImageFilter);
84 
90 
92  using InputImageType = TInputImage;
93  using OutputImageType = TOutputImage;
94  using InputImagePointer = typename InputImageType::Pointer;
95  using InputImageConstPointer = typename InputImageType::ConstPointer;
97  using InputImagePixelType = typename InputImageType::PixelType;
99  using OutputImagePointer = typename OutputImageType::Pointer;
100  using OutputImageConstPointer = typename OutputImageType::ConstPointer;
102  using OutputImagePixelType = typename OutputImageType::PixelType;
103 
105  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
106  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
107 
109  itkNewMacro(Self);
110 
113 
120  itkSetMacro(FullyConnected, bool);
121  itkGetConstReferenceMacro(FullyConnected, bool);
122  itkBooleanMacro(FullyConnected);
124 
128  itkSetMacro(MarkerValue, typename TInputImage::PixelType);
129  itkGetConstReferenceMacro(MarkerValue, typename TInputImage::PixelType);
131 
135  itkGetConstMacro(Flat, bool);
136 
137 #ifdef ITK_USE_CONCEPT_CHECKING
138  // Begin concept checking
139  itkConceptMacro( InputHasPixelTraitsCheck,
141  itkConceptMacro( InputHasNumericTraitsCheck,
143  // End concept checking
144 #endif
145 
146 protected:
148  ~ValuedRegionalExtremaImageFilter() override = default;
149  void PrintSelf(std::ostream & os, Indent indent) const override;
150 
154  void GenerateInputRequestedRegion() override;
155 
157  void EnlargeOutputRequestedRegion( DataObject *itkNotUsed(output) ) override;
158 
159  void GenerateData() override;
160 
161 private:
162  typename TInputImage::PixelType m_MarkerValue;
163 
164  bool m_FullyConnected{ false };
165  bool m_Flat{ false };
166 
171  using IndexStack = std::stack< OutIndexType >;
172 }; // end of class
173 } // end namespace itk
174 
175 #ifndef ITK_MANUAL_INSTANTIATION
176 #include "itkValuedRegionalExtremaImageFilter.hxx"
177 #endif
178 
179 #endif
Uses a flooding algorithm to set all voxels that are not a regional extrema to the max or min of the ...
Const version of ShapedNeighborhoodIterator, defining iteration of a local N-dimensional neighborhood...
typename OutputImageType::Pointer OutputImagePointer
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.
A neighborhood iterator which can take on an arbitrary shape.
typename OutputImageType::PixelType OutputImagePixelType
typename InputImageType::PixelType InputImagePixelType
typename InputImageType::Pointer InputImagePointer
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
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.