ITK  4.4.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< class THistogram, class TImage, class TFunction >
50 class ITK_EXPORT HistogramToImageFilter:
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 
78  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
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 
90  using Superclass::SetInput;
91  virtual void SetInput(const HistogramType *histogram);
92 
93  const HistogramType * GetInput(void);
94 
101  void SetFunctor(const FunctorType & functor)
102  {
103  m_Functor = functor;
104  this->Modified();
105  }
107 
112  FunctorType & GetFunctor() { return m_Functor; }
113  const FunctorType & GetFunctor() const { return m_Functor; }
115 
116  void SetTotalFrequency(SizeValueType n);
117 
118 protected:
121 
122  virtual void GenerateOutputInformation();
123 
124  virtual void GenerateData();
125 
127 
128  virtual void PrintSelf(std::ostream & os, Indent indent) const;
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
141