ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkConfidenceConnectedImageFilter.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 itkConfidenceConnectedImageFilter_h
19 #define itkConfidenceConnectedImageFilter_h
20 
21 #include "itkImage.h"
22 #include "itkImageToImageFilter.h"
23 
24 namespace itk
25 {
62 template< typename TInputImage, typename TOutputImage >
63 class ITK_TEMPLATE_EXPORT ConfidenceConnectedImageFilter:
64  public ImageToImageFilter< TInputImage, TOutputImage >
65 {
66 public:
67  ITK_DISALLOW_COPY_AND_ASSIGN(ConfidenceConnectedImageFilter);
68 
74 
76  itkNewMacro(Self);
77 
79  itkTypeMacro(ConfidenceConnectedImageFilter,
81 
82  using InputImageType = TInputImage;
83  using InputImagePointer = typename InputImageType::Pointer;
85  using InputImagePixelType = typename InputImageType::PixelType;
88 
89  using OutputImageType = TOutputImage;
90  using OutputImagePointer = typename OutputImageType::Pointer;
92  using OutputImagePixelType = typename OutputImageType::PixelType;
93 
94  using SeedsContainerType = std::vector< IndexType >;
95 
97 
98  void PrintSelf(std::ostream & os, Indent indent) const override;
99 
101  void SetSeed(const IndexType & seed);
102 
104  void ClearSeeds();
105 
107  void AddSeed(const IndexType & seed);
108 
111  itkSetMacro(Multiplier, double);
112  itkGetConstMacro(Multiplier, double);
114 
116  itkSetMacro(NumberOfIterations, unsigned int);
117  itkGetConstMacro(NumberOfIterations, unsigned int);
119 
121  itkSetMacro(ReplaceValue, OutputImagePixelType);
122  itkGetConstMacro(ReplaceValue, OutputImagePixelType);
124 
127  itkSetMacro(InitialNeighborhoodRadius, unsigned int);
128  itkGetConstReferenceMacro(InitialNeighborhoodRadius, unsigned int);
130 
134  itkGetConstReferenceMacro(Mean, InputRealType);
135 
139  itkGetConstReferenceMacro(Variance, InputRealType);
140 
142  virtual const SeedsContainerType &GetSeeds() const;
143 
144 #ifdef ITK_USE_CONCEPT_CHECKING
145  // Begin concept checking
146  itkConceptMacro( InputHasNumericTraitsCheck,
148  itkConceptMacro( OutputHasNumericTraitsCheck,
150  // End concept checking
151 #endif
152 
153 protected:
155  ~ConfidenceConnectedImageFilter() override = default;
156 
157  // Override since the filter needs all the data for the algorithm
158  void GenerateInputRequestedRegion() override;
159 
160  // Override since the filter produces the entire dataset
161  void EnlargeOutputRequestedRegion(DataObject *output) override;
162 
163  void GenerateData() override;
164 
165 private:
167  double m_Multiplier;
168  unsigned int m_NumberOfIterations;
173 };
174 } // end namespace itk
175 
176 #ifndef ITK_MANUAL_INSTANTIATION
177 #include "itkConfidenceConnectedImageFilter.hxx"
178 #endif
179 
180 #endif
typename OutputImageType::Pointer OutputImagePointer
Define numeric traits for std::vector.
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 NumericTraits< InputImagePixelType >::RealType InputRealType
typename InputImageType::Pointer InputImagePointer
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
Segment pixels with similar statistics using connectivity.
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
typename InputImageType::IndexType IndexType
#define itkConceptMacro(name, concept)
Base class for all data objects in ITK.