ITK  5.2.0
Insight Toolkit
itkKappaSigmaThresholdImageCalculator.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 {
51 template <typename TInputImage, typename TMaskImage>
52 class ITK_TEMPLATE_EXPORT KappaSigmaThresholdImageCalculator : public Object
53 {
54 public:
55  ITK_DISALLOW_COPY_AND_ASSIGN(KappaSigmaThresholdImageCalculator);
56 
59  using Superclass = Object;
62 
64  itkNewMacro(Self);
65 
68 
70  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
71 
73  using InputImageType = TInputImage;
74  using MaskImageType = TMaskImage;
75 
77  using InputImagePointer = typename InputImageType::Pointer;
78  using InputImageConstPointer = typename InputImageType::ConstPointer;
79  using MaskImagePointer = typename MaskImageType::Pointer;
80  using MaskImageConstPointer = typename MaskImageType::ConstPointer;
81 
82  using InputPixelType = typename InputImageType::PixelType;
83  using MaskPixelType = typename MaskImageType::PixelType;
84 
86  itkSetConstObjectMacro(Image, InputImageType);
87 
91  itkSetConstObjectMacro(Mask, MaskImageType);
92 
96  itkSetMacro(MaskValue, MaskPixelType);
97  itkGetConstMacro(MaskValue, MaskPixelType);
99 
101  itkSetMacro(SigmaFactor, double);
102  itkGetConstMacro(SigmaFactor, double);
104 
106  itkSetMacro(NumberOfIterations, unsigned int);
107  itkGetConstMacro(NumberOfIterations, unsigned int);
109 
111  void
112  Compute();
113 
115  const InputPixelType &
116  GetOutput() const;
117 
118 protected:
120  ~KappaSigmaThresholdImageCalculator() override = default;
121  void
122  PrintSelf(std::ostream & os, Indent indent) const override;
123 
124 private:
125  bool m_Valid{ false }; // Have moments been computed yet?
127  double m_SigmaFactor{ 2 };
128  unsigned int m_NumberOfIterations{ 2 };
130 
133 };
134 } // end namespace itk
135 
136 #ifndef ITK_MANUAL_INSTANTIATION
137 # include "itkKappaSigmaThresholdImageCalculator.hxx"
138 #endif
139 
140 #endif /* itkKappaSigmaThresholdImageCalculator_h */
itk::KappaSigmaThresholdImageCalculator::MaskImageConstPointer
typename MaskImageType::ConstPointer MaskImageConstPointer
Definition: itkKappaSigmaThresholdImageCalculator.h:80
itk::KappaSigmaThresholdImageCalculator::MaskPixelType
typename MaskImageType::PixelType MaskPixelType
Definition: itkKappaSigmaThresholdImageCalculator.h:83
itkImage.h
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::KappaSigmaThresholdImageCalculator::m_MaskValue
MaskPixelType m_MaskValue
Definition: itkKappaSigmaThresholdImageCalculator.h:126
itk::KappaSigmaThresholdImageCalculator::MaskImageType
TMaskImage MaskImageType
Definition: itkKappaSigmaThresholdImageCalculator.h:74
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::KappaSigmaThresholdImageCalculator
Computes a Kappa-Sigma-Clipping threshold for an image.
Definition: itkKappaSigmaThresholdImageCalculator.h:52
itkMacro.h
itk::KappaSigmaThresholdImageCalculator::InputPixelType
typename InputImageType::PixelType InputPixelType
Definition: itkKappaSigmaThresholdImageCalculator.h:82
itk::KappaSigmaThresholdImageCalculator::MaskImagePointer
typename MaskImageType::Pointer MaskImagePointer
Definition: itkKappaSigmaThresholdImageCalculator.h:79
itk::KappaSigmaThresholdImageCalculator::m_Image
InputImageConstPointer m_Image
Definition: itkKappaSigmaThresholdImageCalculator.h:131
itk::KappaSigmaThresholdImageCalculator::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkKappaSigmaThresholdImageCalculator.h:77
itk::KappaSigmaThresholdImageCalculator::m_Mask
MaskImageConstPointer m_Mask
Definition: itkKappaSigmaThresholdImageCalculator.h:132
itk::KappaSigmaThresholdImageCalculator::InputImageConstPointer
typename InputImageType::ConstPointer InputImageConstPointer
Definition: itkKappaSigmaThresholdImageCalculator.h:78
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::KappaSigmaThresholdImageCalculator::m_Output
InputPixelType m_Output
Definition: itkKappaSigmaThresholdImageCalculator.h:129
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:62
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:86
itk::KappaSigmaThresholdImageCalculator::InputImageType
TInputImage InputImageType
Definition: itkKappaSigmaThresholdImageCalculator.h:73