ITK  4.4.0
Insight Segmentation and Registration Toolkit
itkMovingHistogramImageFilter.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 __itkMovingHistogramImageFilter_h
19 #define __itkMovingHistogramImageFilter_h
20 
22 
23 namespace itk
24 {
86 template< class TInputImage, class TOutputImage, class TKernel, class THistogram >
87 class ITK_EXPORT MovingHistogramImageFilter:
88  public MovingHistogramImageFilterBase< TInputImage, TOutputImage, TKernel >
89 {
90 public:
96 
98  itkNewMacro(Self);
99 
101  itkTypeMacro(MovingHistogramImageFilter,
103 
105  typedef TInputImage InputImageType;
106  typedef TOutputImage OutputImageType;
107  typedef typename TInputImage::RegionType RegionType;
108  typedef typename TInputImage::SizeType SizeType;
109  typedef typename TInputImage::IndexType IndexType;
110  typedef typename TInputImage::PixelType PixelType;
111  typedef typename TInputImage::OffsetType OffsetType;
112  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
113  typedef typename TOutputImage::PixelType OutputPixelType;
114 
116  itkStaticConstMacro(ImageDimension, unsigned int,
117  TInputImage::ImageDimension);
118 
120  typedef TKernel KernelType;
121 
123  typedef typename KernelType::ConstIterator KernelIteratorType;
124 
126  typedef typename KernelType::SizeType RadiusType;
127 
128  typedef typename std::list< OffsetType > OffsetListType;
129 
130  typedef typename std::map< OffsetType, OffsetListType, typename OffsetType::LexicographicCompare > OffsetMapType;
131 
133  virtual void ConfigureHistogram(THistogram &) {}
134 
135 protected:
138 
140  void ThreadedGenerateData(const OutputImageRegionType &
141  outputRegionForThread,
142  ThreadIdType threadId);
143 
144  // declare the type used to store the histogram
145  typedef THistogram HistogramType;
146 
147  void PushHistogram(HistogramType & histogram,
148  const OffsetListType *addedList,
149  const OffsetListType *removedList,
150  const RegionType & inputRegion,
151  const RegionType & kernRegion,
152  const InputImageType *inputImage,
153  const IndexType currentIdx);
154 
155 private:
156  MovingHistogramImageFilter(const Self &); //purposely not implemented
157  void operator=(const Self &); //purposely not implemented
158 }; // end of class
159 } // end namespace itk
160 
161 #ifndef ITK_MANUAL_INSTANTIATION
162 #include "itkMovingHistogramImageFilter.hxx"
163 #endif
164 
165 #endif
166