ITK  6.0.0
Insight Toolkit
itkHistogramAlgorithmBase.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 itkHistogramAlgorithmBase_h
19#define itkHistogramAlgorithmBase_h
20
21#include "itkMacro.h"
22#include "itkObjectFactory.h"
23#include "itkObject.h"
24
25namespace itk
26{
36template <typename TInputHistogram>
37class ITK_TEMPLATE_EXPORT HistogramAlgorithmBase : public Object
38{
39public:
45
47 itkOverrideGetNameOfClassMacro(HistogramAlgorithmBase);
48
50 using InputHistogramType = TInputHistogram;
51
53 void
54 SetInputHistogram(const TInputHistogram * histogram)
55 {
56 if (m_InputHistogram != histogram)
57 {
58 m_InputHistogram = histogram;
59 this->Modified();
60 }
61 }
65 const TInputHistogram *
67 {
68 return m_InputHistogram.GetPointer();
69 }
70
76#if !defined(ITK_LEGACY_REMOVE)
77 void
78 Update()
79 {
80 this->Compute();
81 }
82#endif
83
84protected:
86 ~HistogramAlgorithmBase() override = default;
87 void
88 PrintSelf(std::ostream & os, Indent indent) const override;
89
90 virtual void
91 Compute() = 0;
92
93private:
95 typename TInputHistogram::ConstPointer m_InputHistogram{};
96}; // end of class
97} // end of namespace itk
98
99#ifndef ITK_MANUAL_INSTANTIATION
100# include "itkHistogramAlgorithmBase.hxx"
101#endif
102
103#endif
base class for algorithms operating on histograms
~HistogramAlgorithmBase() override=default
const TInputHistogram * GetInputHistogram() const
void SetInputHistogram(const TInputHistogram *histogram)
void PrintSelf(std::ostream &os, Indent indent) const override
virtual void Compute()=0
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Base class for most ITK classes.
Definition: itkObject.h:62
SmartPointer< const Self > ConstPointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....