ITK  4.0.0
Insight Segmentation and Registration Toolkit
itkMovingHistogramImageFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkMovingHistogramImageFilter_h
00019 #define __itkMovingHistogramImageFilter_h
00020 
00021 #include "itkMovingHistogramImageFilterBase.h"
00022 
00023 namespace itk
00024 {
00086 template< class TInputImage, class TOutputImage, class TKernel, class THistogram >
00087 class ITK_EXPORT MovingHistogramImageFilter:
00088   public MovingHistogramImageFilterBase< TInputImage, TOutputImage, TKernel >
00089 {
00090 public:
00092   typedef MovingHistogramImageFilter                                           Self;
00093   typedef MovingHistogramImageFilterBase< TInputImage, TOutputImage, TKernel > Superclass;
00094   typedef SmartPointer< Self >                                                 Pointer;
00095   typedef SmartPointer< const Self >                                           ConstPointer;
00096 
00098   itkNewMacro(Self);
00099 
00101   itkTypeMacro(MovingHistogramImageFilter,
00102                MovingHistogramImageFilter);
00103 
00105   typedef TInputImage                                InputImageType;
00106   typedef TOutputImage                               OutputImageType;
00107   typedef typename TInputImage::RegionType           RegionType;
00108   typedef typename TInputImage::SizeType             SizeType;
00109   typedef typename TInputImage::IndexType            IndexType;
00110   typedef typename TInputImage::PixelType            PixelType;
00111   typedef typename TInputImage::OffsetType           OffsetType;
00112   typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00113   typedef typename TOutputImage::PixelType           OutputPixelType;
00114 
00116   itkStaticConstMacro(ImageDimension, unsigned int,
00117                       TInputImage::ImageDimension);
00118 
00120   typedef TKernel KernelType;
00121 
00123   typedef typename KernelType::ConstIterator KernelIteratorType;
00124 
00126   typedef typename KernelType::SizeType RadiusType;
00127 
00128   typedef typename std::list< OffsetType > OffsetListType;
00129 
00130   typedef typename std::map< OffsetType, OffsetListType, typename OffsetType::LexicographicCompare > OffsetMapType;
00131 
00133   virtual void ConfigureHistogram(THistogram &) {}
00134 
00135 protected:
00136   MovingHistogramImageFilter();
00137   ~MovingHistogramImageFilter() {}
00138 
00140   void  ThreadedGenerateData(const OutputImageRegionType &
00141                              outputRegionForThread,
00142                              ThreadIdType threadId);
00143 
00144   // declare the type used to store the histogram
00145   typedef THistogram HistogramType;
00146 
00147   void PushHistogram(HistogramType & histogram,
00148                      const OffsetListType *addedList,
00149                      const OffsetListType *removedList,
00150                      const RegionType & inputRegion,
00151                      const RegionType & kernRegion,
00152                      const InputImageType *inputImage,
00153                      const IndexType currentIdx);
00154 
00155 private:
00156   MovingHistogramImageFilter(const Self &); //purposely not implemented
00157   void operator=(const Self &);             //purposely not implemented
00158 };                                          // end of class
00159 } // end namespace itk
00160 
00161 #ifndef ITK_MANUAL_INSTANTIATION
00162 #include "itkMovingHistogramImageFilter.hxx"
00163 #endif
00164 
00165 #endif
00166