ITK  5.2.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  * 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 itkHistogramToImageFilter_h
19 #define itkHistogramToImageFilter_h
20 
21 #include "itkImageSource.h"
22 #include "itkConceptChecking.h"
23 #include "itkHistogram.h"
26 
27 namespace itk
28 {
49 template <typename THistogram, typename TImage, typename TFunction>
50 class ITK_TEMPLATE_EXPORT HistogramToImageFilter : public ImageSource<TImage>
51 {
52 public:
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  itkTypeMacro(HistogramToImageFilter, ImageSource);
76 
78  using OutputImageRegionType = 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 *
95  GetInput();
96 
103  void
104  SetFunctor(const FunctorType & functor)
105  {
106  m_Functor = functor;
107  this->Modified();
108  }
110 
115  FunctorType &
117  {
118  return m_Functor;
119  }
120  const FunctorType &
121  GetFunctor() const
122  {
123  return m_Functor;
124  }
126 
127  void
128  SetTotalFrequency(SizeValueType n);
129 
130 protected:
132  ~HistogramToImageFilter() override = default;
133 
134  void
135  GenerateOutputInformation() override;
136 
137  void
138  GenerateData() override;
139 
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
itk::ImageSource< TImage >::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkImageSource.h:91
itkImageSource.h
itk::HistogramToImageFilter::SetFunctor
void SetFunctor(const FunctorType &functor)
Definition: itkHistogramToImageFilter.h:104
itk::HistogramToImageFilter< THistogram, TImage, Function::HistogramIntensityFunction< SizeValueType, TImage::PixelType > >::SizeType
typename OutputImageType::SizeType SizeType
Definition: itkHistogramToImageFilter.h:84
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itkConceptChecking.h
itk::Function::HistogramIntensityFunction< SizeValueType, TImage::PixelType >
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::HistogramToImageFilter::GetFunctor
const FunctorType & GetFunctor() const
Definition: itkHistogramToImageFilter.h:121
itk::HistogramToImageFilter::m_Functor
FunctorType m_Functor
Definition: itkHistogramToImageFilter.h:140
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itkImageRegionIteratorWithIndex.h
itk::HistogramToImageFilter< THistogram, TImage, Function::HistogramIntensityFunction< SizeValueType, TImage::PixelType > >::OutputPixelType
typename OutputImageType::PixelType OutputPixelType
Definition: itkHistogramToImageFilter.h:66
itk::HistogramToImageFilter< THistogram, TImage, Function::HistogramIntensityFunction< SizeValueType, TImage::PixelType > >::PointType
typename OutputImageType::PointType PointType
Definition: itkHistogramToImageFilter.h:65
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itkHistogram.h
itk::HistogramToImageFilter< THistogram, TImage, Function::HistogramIntensityFunction< SizeValueType, TImage::PixelType > >::HistogramType
THistogram HistogramType
Definition: itkHistogramToImageFilter.h:81
itk::HistogramToImageFilter::GetFunctor
FunctorType & GetFunctor()
Definition: itkHistogramToImageFilter.h:116
itk::ImageRegionIteratorWithIndex
A multi-dimensional iterator templated over image type that walks pixels within a region and is speci...
Definition: itkImageRegionIteratorWithIndex.h:73
itk::HistogramToImageFilter< THistogram, TImage, Function::HistogramIntensityFunction< SizeValueType, TImage::PixelType > >::HistogramSizeType
typename HistogramType::SizeType HistogramSizeType
Definition: itkHistogramToImageFilter.h:83
itk::HistogramToImageFilter< THistogram, TImage, Function::HistogramIntensityFunction< SizeValueType, TImage::PixelType > >::SpacingType
typename OutputImageType::SpacingType SpacingType
Definition: itkHistogramToImageFilter.h:64
itk::ImageSource< TImage >::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::HistogramToImageFilter< THistogram, TImage, Function::HistogramIntensityFunction< SizeValueType, TImage::PixelType > >::MeasurementVectorType
typename HistogramType::MeasurementVectorType MeasurementVectorType
Definition: itkHistogramToImageFilter.h:82
itkSimpleDataObjectDecorator.h
itk::HistogramToImageFilter
This class takes a histogram as an input and returns an image of type specified by the functor.
Definition: itkHistogramToImageFilter.h:50
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:83
itk::ImageSource< TImage >::OutputImageType
TImage OutputImageType
Definition: itkImageSource.h:90