ITK  4.8.0
Insight Segmentation and Registration Toolkit
itkHistogramToImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 >
51  public ImageSource< TImage >
52 {
53 public:
54 
56  typedef TFunction FunctorType;
61 
62  typedef TImage OutputImageType;
64  typedef typename OutputImageType::SpacingType SpacingType;
65  typedef typename OutputImageType::PointType PointType;
66  typedef typename OutputImageType::PixelType OutputPixelType;
67 
68  // Define an iterator to iterate through the image
70 
72  itkNewMacro(Self);
73 
76 
79 
81  typedef THistogram HistogramType;
82  typedef typename HistogramType::MeasurementVectorType MeasurementVectorType;
83  typedef typename HistogramType::SizeType HistogramSizeType;
84  typedef typename OutputImageType::SizeType SizeType;
85 
87  itkStaticConstMacro(ImageDimension, unsigned int, OutputImageType::ImageDimension);
88 
91  virtual void SetInput(const HistogramType *histogram);
92 
93  const HistogramType * GetInput();
94 
101  void SetFunctor(const FunctorType & functor)
102  {
103  m_Functor = functor;
104  this->Modified();
105  }
107 
113  const FunctorType & GetFunctor() const { return m_Functor; }
115 
117 
118 protected:
121 
122  virtual void GenerateOutputInformation() ITK_OVERRIDE;
123 
124  virtual void GenerateData() ITK_OVERRIDE;
125 
127 
128  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
129 
130 private:
131  HistogramToImageFilter(const Self &); //purposely not implemented
132  void operator=(const Self &); //purposely not implemented
133 };
134 } // end namespace itk
135 
136 #ifndef ITK_MANUAL_INSTANTIATION
137 #include "itkHistogramToImageFilter.hxx"
138 #endif
139 
140 #endif
virtual void PrintSelf(std::ostream &os, Indent indent) const override
void SetFunctor(const FunctorType &functor)
Light weight base class for most itk classes.
OutputImageType::SizeType SizeType
OutputImageType::PixelType OutputPixelType
static const unsigned int ImageDimension
const HistogramType * GetInput()
Base class for all process objects that output image data.
unsigned long SizeValueType
Definition: itkIntTypes.h:143
virtual void GenerateData() override
SmartPointer< const Self > ConstPointer
OutputImageType::SpacingType SpacingType
A multi-dimensional iterator templated over image type that walks pixels within a region and is speci...
virtual void SetInput(const DataObjectIdentifierType &key, DataObject *input)
Protected method for setting indexed and named inputs.
HistogramType::MeasurementVectorType MeasurementVectorType
OutputImageType::PointType PointType
This class takes a histogram as an input and returns an image of type specified by the functor...
Superclass::OutputImageRegionType OutputImageRegionType
HistogramType::SizeType HistogramSizeType
virtual void Modified() const
void SetTotalFrequency(SizeValueType n)
virtual void SetInput(const HistogramType *histogram)
OutputImageType::RegionType OutputImageRegionType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ImageRegionIteratorWithIndex< OutputImageType > ImageIteratorType
virtual void GenerateOutputInformation() override
const FunctorType & GetFunctor() const