00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkPadImageFilter_h
00018 #define __itkPadImageFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkSize.h"
00022
00023 namespace itk
00024 {
00025
00041 template <class TInputImage, class TOutputImage>
00042 class ITK_EXPORT PadImageFilter:
00043 public ImageToImageFilter<TInputImage,TOutputImage>
00044 {
00045 public:
00047 typedef PadImageFilter Self;
00048 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00049 typedef SmartPointer<Self> Pointer;
00050 typedef SmartPointer<const Self> ConstPointer;
00051
00053 itkNewMacro(Self);
00054
00056 typedef typename TOutputImage::RegionType OutputImageRegionType;
00057 typedef typename TInputImage::RegionType InputImageRegionType;
00058
00060 typedef typename TOutputImage::PixelType OutputImagePixelType;
00061 typedef typename TInputImage::PixelType InputImagePixelType;
00062
00064 typedef typename TOutputImage::IndexType OutputImageIndexType;
00065 typedef typename TInputImage::IndexType InputImageIndexType;
00066 typedef typename TOutputImage::SizeType OutputImageSizeType;
00067 typedef typename TInputImage::SizeType InputImageSizeType;
00068
00070 itkTypeMacro(PadImageFilter, ImageToImageFilter);
00071
00073 itkStaticConstMacro(ImageDimension, unsigned int,
00074 TInputImage::ImageDimension );
00075
00078 itkSetVectorMacro(PadLowerBound, const unsigned long, ImageDimension);
00079 itkSetVectorMacro(PadUpperBound, const unsigned long, ImageDimension);
00080 itkGetVectorMacro(PadLowerBound, const unsigned long, ImageDimension);
00081 itkGetVectorMacro(PadUpperBound, const unsigned long, ImageDimension);
00083
00084 void SetPadLowerBound(const itk::Size<ImageDimension> & bound)
00085 {
00086 this->SetPadLowerBound( bound.m_Size );
00087 }
00088
00089 void SetPadUpperBound(const itk::Size<ImageDimension> & bound)
00090 {
00091 this->SetPadUpperBound( bound.m_Size );
00092 }
00093
00094 void SetPadBound(const itk::Size<ImageDimension> & bound)
00095 {
00096 this->SetPadLowerBound( bound );
00097 this->SetPadUpperBound( bound );
00098 }
00099
00100 void SetPadLowerBound(const unsigned long bound)
00101 {
00102 itk::Size<ImageDimension> s;
00103 s.Fill( bound );
00104 this->SetPadLowerBound( s );
00105 }
00106
00107 void SetPadUpperBound(const unsigned long bound)
00108 {
00109 itk::Size<ImageDimension> s;
00110 s.Fill( bound );
00111 this->SetPadUpperBound( s );
00112 }
00113
00114 void SetPadBound(const unsigned long bound)
00115 {
00116 itk::Size<ImageDimension> s;
00117 s.Fill( bound );
00118 this->SetPadBound( s );
00119 }
00120
00121
00128 virtual void GenerateOutputInformation();
00129
00135 virtual void GenerateInputRequestedRegion();
00136
00137 protected:
00138 PadImageFilter();
00139 ~PadImageFilter() {};
00140 void PrintSelf(std::ostream& os, Indent indent) const;
00141
00142 private:
00143 PadImageFilter(const Self&);
00144 void operator=(const Self&);
00145
00146 unsigned long m_PadLowerBound[ImageDimension];
00147 unsigned long m_PadUpperBound[ImageDimension];
00148 };
00149
00150
00151 }
00152
00153 #ifndef ITK_MANUAL_INSTANTIATION
00154 #include "itkPadImageFilter.txx"
00155 #endif
00156
00157 #endif
00158