ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkMultiResolutionPyramidImageFilter.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 __itkMultiResolutionPyramidImageFilter_h
00019 #define __itkMultiResolutionPyramidImageFilter_h
00020 
00021 #include "itkImageToImageFilter.h"
00022 #include "itkArray2D.h"
00023 
00024 namespace itk
00025 {
00108 template<
00109   class TInputImage,
00110   class TOutputImage
00111   >
00112 class ITK_EXPORT MultiResolutionPyramidImageFilter:
00113   public ImageToImageFilter< TInputImage, TOutputImage >
00114 {
00115 public:
00117   typedef MultiResolutionPyramidImageFilter               Self;
00118   typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00119   typedef SmartPointer< Self >                            Pointer;
00120   typedef SmartPointer< const Self >                      ConstPointer;
00121 
00123   itkNewMacro(Self);
00124 
00126   itkTypeMacro(MultiResolutionPyramidImageFilter, ImageToImageFilter);
00127 
00129   typedef Array2D< unsigned int > ScheduleType;
00130 
00132   itkStaticConstMacro(ImageDimension, unsigned int,
00133                       TInputImage::ImageDimension);
00134   itkStaticConstMacro(OutputImageDimension, unsigned int,
00135                       TOutputImage::ImageDimension);
00137 
00139   typedef typename Superclass::InputImageType         InputImageType;
00140   typedef typename Superclass::OutputImageType        OutputImageType;
00141   typedef typename Superclass::InputImagePointer      InputImagePointer;
00142   typedef typename Superclass::OutputImagePointer     OutputImagePointer;
00143   typedef typename Superclass::InputImageConstPointer InputImageConstPointer;
00144 
00151   virtual void SetNumberOfLevels(unsigned int num);
00152 
00154   itkGetConstMacro(NumberOfLevels, unsigned int);
00155 
00162   virtual void SetSchedule(const ScheduleType & schedule);
00163 
00165   itkGetConstReferenceMacro(Schedule, ScheduleType);
00166 
00171   virtual void SetStartingShrinkFactors(unsigned int factor);
00172 
00173   virtual void SetStartingShrinkFactors(unsigned int *factors);
00174 
00176   const unsigned int * GetStartingShrinkFactors() const;
00177 
00181   static bool IsScheduleDownwardDivisible(const ScheduleType & schedule);
00182 
00189   virtual void GenerateOutputInformation();
00190 
00195   virtual void GenerateOutputRequestedRegion(DataObject *output);
00197 
00204   virtual void GenerateInputRequestedRegion();
00205 
00206   itkSetMacro(MaximumError, double);
00207   itkGetConstReferenceMacro(MaximumError, double);
00208 
00209   itkSetMacro(UseShrinkImageFilter, bool);
00210   itkGetConstMacro(UseShrinkImageFilter, bool);
00211   itkBooleanMacro(UseShrinkImageFilter);
00212 
00213 #ifdef ITK_USE_CONCEPT_CHECKING
00214 
00215   itkConceptMacro( SameDimensionCheck,
00216                    ( Concept::SameDimension< ImageDimension, OutputImageDimension > ) );
00217   itkConceptMacro( OutputHasNumericTraitsCheck,
00218                    ( Concept::HasNumericTraits< typename TOutputImage::PixelType > ) );
00219 
00221 #endif
00222 protected:
00223   MultiResolutionPyramidImageFilter();
00224   ~MultiResolutionPyramidImageFilter() {}
00225   void PrintSelf(std::ostream & os, Indent indent) const;
00227 
00229   void GenerateData();
00230 
00231   double m_MaximumError;
00232 
00233   unsigned int m_NumberOfLevels;
00234   ScheduleType m_Schedule;
00235 
00236   bool m_UseShrinkImageFilter;
00237 private:
00238   MultiResolutionPyramidImageFilter(const Self &); //purposely not implemented
00239   void operator=(const Self &);                    //purposely not implemented
00240 };
00241 } // namespace itk
00242 
00243 #ifndef ITK_MANUAL_INSTANTIATION
00244 #include "itkMultiResolutionPyramidImageFilter.hxx"
00245 #endif
00246 
00247 #endif
00248