ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkKappaSigmaThresholdImageFilter.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 * https://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 itkKappaSigmaThresholdImageFilter_h
19#define itkKappaSigmaThresholdImageFilter_h
20
23
24namespace itk
25{
45
46template <typename TInputImage,
48 class TOutputImage = TInputImage>
49class ITK_TEMPLATE_EXPORT KappaSigmaThresholdImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
50{
51public:
52 ITK_DISALLOW_COPY_AND_MOVE(KappaSigmaThresholdImageFilter);
53
59
61 itkNewMacro(Self);
62
64 itkOverrideGetNameOfClassMacro(KappaSigmaThresholdImageFilter);
65
67 using InputImageType = TInputImage;
68 using MaskImageType = TMaskImage;
69
71 using InputPixelType = typename TInputImage::PixelType;
72 using OutputPixelType = typename TOutputImage::PixelType;
73 using MaskPixelType = typename TMaskImage::PixelType;
74
76 using InputImagePointer = typename TInputImage::Pointer;
77 using OutputImagePointer = typename TOutputImage::Pointer;
78 using MaskImagePointer = typename TMaskImage::Pointer;
79
82 itkSetMacro(OutsideValue, OutputPixelType);
83
85 itkGetConstMacro(OutsideValue, OutputPixelType);
86
89 itkSetMacro(InsideValue, OutputPixelType);
90
92 itkGetConstMacro(InsideValue, OutputPixelType);
93
95 itkGetConstMacro(Threshold, InputPixelType);
96
99 itkSetMacro(MaskValue, MaskPixelType);
100 itkGetConstMacro(MaskValue, MaskPixelType);
102
104 itkSetMacro(SigmaFactor, double);
105 itkGetConstMacro(SigmaFactor, double);
107
109 itkSetMacro(NumberOfIterations, unsigned int);
110 itkGetConstMacro(NumberOfIterations, unsigned int);
112
114 itkConceptMacro(OutputOStreamWritableCheck, (Concept::OStreamWritable<OutputPixelType>));
115
117 void
119 {
120 // Process object is not const-correct so the const casting is required.
121 this->SetNthInput(1, const_cast<MaskImageType *>(input));
122 }
123
125 const MaskImageType *
127 {
128 return static_cast<MaskImageType *>(const_cast<DataObject *>(this->ProcessObject::GetInput(1)));
129 }
130
132 void
133 SetInput1(const TInputImage * input)
134 {
135 this->SetInput(input);
136 }
137
139 void
141 {
142 this->SetMaskImage(input);
143 }
144
145protected:
148 void
149 PrintSelf(std::ostream & os, Indent indent) const override;
150
151 void
153
154 void
155 GenerateData() override;
156
157 using InputSizeType = typename TInputImage::SizeType;
158 using InputIndexType = typename TInputImage::IndexType;
159 using InputImageRegionType = typename TInputImage::RegionType;
160 using OutputSizeType = typename TOutputImage::SizeType;
161 using OutputIndexType = typename TOutputImage::IndexType;
162 using OutputImageRegionType = typename TOutputImage::RegionType;
163
165
167 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
168 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
169
170private:
172 double m_SigmaFactor{ 2 };
173 unsigned int m_NumberOfIterations{ 2 };
177};
178} // end namespace itk
179
180#ifndef ITK_MANUAL_INSTANTIATION
181# include "itkKappaSigmaThresholdImageFilter.hxx"
182#endif
183
184#endif
Base class for all data objects in ITK.
virtual void SetInput(const InputImageType *input)
Templated n-dimensional image class.
Definition itkImage.h:89
Control indentation during Print() invocation.
Definition itkIndent.h:50
Computes a Kappa-Sigma-Clipping threshold for an image.
void GenerateInputRequestedRegion() override
KappaSigmaThresholdImageCalculator< TInputImage, TMaskImage > CalculatorType
typename TOutputImage::RegionType OutputImageRegionType
void PrintSelf(std::ostream &os, Indent indent) const override
ImageToImageFilter< TInputImage, TOutputImage > Superclass
typename TInputImage::RegionType InputImageRegionType
~KappaSigmaThresholdImageFilter() override=default
virtual void SetNthInput(DataObjectPointerArraySizeType idx, DataObject *input)
DataObject * GetInput(const DataObjectIdentifierType &key)
Return an input.
Implements transparent reference counting.
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....