ITK  6.0.0
Insight Toolkit
itkHistogramToImageFilter.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 itkHistogramToImageFilter_h
19#define itkHistogramToImageFilter_h
20
21#include "itkImageSource.h"
22#include "itkConceptChecking.h"
23#include "itkHistogram.h"
26
27namespace itk
28{
49template <typename THistogram, typename TImage, typename TFunction>
50class ITK_TEMPLATE_EXPORT HistogramToImageFilter : public ImageSource<TImage>
51{
52public:
53 ITK_DISALLOW_COPY_AND_MOVE(HistogramToImageFilter);
54
56 using FunctorType = TFunction;
61
62 using OutputImageType = TImage;
64 using SpacingType = typename OutputImageType::SpacingType;
66 using OutputPixelType = typename OutputImageType::PixelType;
67
68 // Define an iterator to iterate through the image
70
72 itkNewMacro(Self);
73
75 itkOverrideGetNameOfClassMacro(HistogramToImageFilter);
76
78 using typename Superclass::OutputImageRegionType;
79
81 using HistogramType = THistogram;
82 using MeasurementVectorType = typename HistogramType::MeasurementVectorType;
85
87 static constexpr unsigned int ImageDimension = OutputImageType::ImageDimension;
88
90 using Superclass::SetInput;
91 virtual void
92 SetInput(const HistogramType * input);
93
94 const HistogramType *
96
103 void
104 SetFunctor(const FunctorType & functor)
105 {
106 m_Functor = functor;
107 this->Modified();
108 }
117 {
118 return m_Functor;
119 }
120 const FunctorType &
122 {
123 return m_Functor;
124 }
127 void
129
130protected:
132 ~HistogramToImageFilter() override = default;
133
134 void
136
137 void
138 GenerateData() override;
139
140 FunctorType m_Functor{};
141
142 void
143 PrintSelf(std::ostream & os, Indent indent) const override;
144};
145} // end namespace itk
146
147#ifndef ITK_MANUAL_INSTANTIATION
148# include "itkHistogramToImageFilter.hxx"
149#endif
150
151#endif
This class takes a histogram as an input and returns an image of type specified by the functor.
const HistogramType * GetInput()
typename OutputImageType::SpacingType SpacingType
typename OutputImageType::PointType PointType
typename Superclass::Pointer OutputImagePointer
~HistogramToImageFilter() override=default
typename HistogramType::MeasurementVectorType MeasurementVectorType
const FunctorType & GetFunctor() const
void GenerateOutputInformation() override
void SetFunctor(const FunctorType &functor)
typename HistogramType::SizeType HistogramSizeType
void PrintSelf(std::ostream &os, Indent indent) const override
virtual void SetInput(const HistogramType *input)
typename OutputImageType::SizeType SizeType
typename OutputImageType::PixelType OutputPixelType
void GenerateData() override
void SetTotalFrequency(SizeValueType n)
A multi-dimensional iterator templated over image type that walks pixels within a region and is speci...
Base class for all process objects that output image data.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Functor::Add2< typename TInputImage1::PixelType, typename TInputImage2::PixelType, typename TOutputImage::PixelType > FunctorType
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType
Definition: itkIntTypes.h:86