ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkAccumulateImageFilter.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 __itkAccumulateImageFilter_h
00019 #define __itkAccumulateImageFilter_h
00020 
00021 #include "itkImageToImageFilter.h"
00022 
00023 namespace itk
00024 {
00053 template< class TInputImage, class TOutputImage >
00054 class ITK_EXPORT AccumulateImageFilter:public ImageToImageFilter< TInputImage, TOutputImage >
00055 {
00056 public:
00058   typedef AccumulateImageFilter                           Self;
00059   typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00060   typedef SmartPointer< Self >                            Pointer;
00061   typedef SmartPointer< const Self >                      ConstPointer;
00062 
00064   itkNewMacro(Self);
00065 
00067   itkTypeMacro(AccumulateImageFilter, ImageToImageFilter);
00068 
00070   typedef TInputImage                            InputImageType;
00071   typedef typename    InputImageType::Pointer    InputImagePointer;
00072   typedef typename    InputImageType::RegionType InputImageRegionType;
00073   typedef typename    InputImageType::PixelType  InputImagePixelType;
00074 
00075   typedef TOutputImage                             OutputImageType;
00076   typedef typename     OutputImageType::Pointer    OutputImagePointer;
00077   typedef typename     OutputImageType::RegionType OutputImageRegionType;
00078   typedef typename     OutputImageType::PixelType  OutputImagePixelType;
00079 
00081   itkStaticConstMacro(InputImageDimension, unsigned int,
00082                       TInputImage::ImageDimension);
00083   itkStaticConstMacro(OutputImageDimension, unsigned int,
00084                       TOutputImage::ImageDimension);
00086 
00089 #ifdef ITK_USE_CONCEPT_CHECKING
00090 
00092   itkConceptMacro( ImageDimensionCheck,
00093                    ( Concept::SameDimensionOrMinusOne< itkGetStaticConstMacro(InputImageDimension),
00094                                                        itkGetStaticConstMacro(OutputImageDimension) > ) );
00095 
00097 #endif
00098 
00102   itkGetConstMacro(AccumulateDimension, unsigned int);
00103   itkSetMacro(AccumulateDimension, unsigned int);
00105 
00111   itkSetMacro(Average, bool);
00112   itkGetConstMacro(Average, bool);
00113   itkBooleanMacro(Average);
00114 protected:
00115   AccumulateImageFilter();
00116   virtual ~AccumulateImageFilter() {}
00117   void PrintSelf(std::ostream & os, Indent indent) const;
00119 
00121   virtual void GenerateOutputInformation();
00122 
00124   virtual void GenerateInputRequestedRegion();
00125 
00130   void GenerateData(void);
00131 
00132 private:
00133   AccumulateImageFilter(const Self &); //purposely not implemented
00134   void operator=(const Self &);        //purposely not implemented
00135 
00136   unsigned int m_AccumulateDimension;
00137   bool         m_Average;
00138 };
00139 } // end namespace itk
00140 
00141 #ifndef ITK_MANUAL_INSTANTIATION
00142 #include "itkAccumulateImageFilter.hxx"
00143 #endif
00144 
00145 #endif
00146