ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkKappaSigmaThresholdImageCalculator.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 itkKappaSigmaThresholdImageCalculator_h
19 #define itkKappaSigmaThresholdImageCalculator_h
20 
21 #include "itkMacro.h"
22 #include "itkImage.h"
23 
24 namespace itk
25 {
50 template< typename TInputImage, typename TMaskImage >
51 class ITK_TEMPLATE_EXPORT KappaSigmaThresholdImageCalculator:public Object
52 {
53 public:
54  ITK_DISALLOW_COPY_AND_ASSIGN(KappaSigmaThresholdImageCalculator);
55 
58  using Superclass = Object;
61 
63  itkNewMacro(Self);
64 
67 
69  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
70 
72  using InputImageType = TInputImage;
73  using MaskImageType = TMaskImage;
74 
76  using InputImagePointer = typename InputImageType::Pointer;
77  using InputImageConstPointer = typename InputImageType::ConstPointer;
78  using MaskImagePointer = typename MaskImageType::Pointer;
79  using MaskImageConstPointer = typename MaskImageType::ConstPointer;
80 
81  using InputPixelType = typename InputImageType::PixelType;
82  using MaskPixelType = typename MaskImageType::PixelType;
83 
85  itkSetConstObjectMacro(Image, InputImageType);
86 
90  itkSetConstObjectMacro(Mask, MaskImageType);
91 
95  itkSetMacro(MaskValue, MaskPixelType);
96  itkGetConstMacro(MaskValue, MaskPixelType);
98 
100  itkSetMacro(SigmaFactor, double);
101  itkGetConstMacro(SigmaFactor, double);
103 
105  itkSetMacro(NumberOfIterations, unsigned int);
106  itkGetConstMacro(NumberOfIterations, unsigned int);
108 
110  void Compute();
111 
113  const InputPixelType & GetOutput() const;
114 
115 protected:
117  ~KappaSigmaThresholdImageCalculator() override = default;
118  void PrintSelf(std::ostream & os, Indent indent) const override;
119 
120 private:
121  bool m_Valid{ false }; // Have moments been computed yet?
123  double m_SigmaFactor{ 2 };
124  unsigned int m_NumberOfIterations{ 2 };
126 
129 };
130 } // end namespace itk
131 
132 #ifndef ITK_MANUAL_INSTANTIATION
133 #include "itkKappaSigmaThresholdImageCalculator.hxx"
134 #endif
135 
136 #endif /* itkKappaSigmaThresholdImageCalculator_h */
Light weight base class for most itk classes.
typename MaskImageType::ConstPointer MaskImageConstPointer
Computes a Kappa-Sigma-Clipping threshold for an image.
typename InputImageType::ConstPointer InputImageConstPointer
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for most ITK classes.
Definition: itkObject.h:60
Templated n-dimensional image class.
Definition: itkImage.h:75