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
00085 void SetPadLowerBound(const InputImageSizeType & bound)
00086 {
00087 this->SetPadLowerBound( bound.m_Size );
00088 }
00089
00090 void SetPadUpperBound(const InputImageSizeType & bound)
00091 {
00092 this->SetPadUpperBound( bound.m_Size );
00093 }
00094
00095 void SetPadBound(const InputImageSizeType & bound)
00096 {
00097 this->SetPadLowerBound( bound );
00098 this->SetPadUpperBound( bound );
00099 }
00100
00107 virtual void GenerateOutputInformation();
00108
00114 virtual void GenerateInputRequestedRegion();
00115
00116 protected:
00117 PadImageFilter();
00118 ~PadImageFilter() {};
00119 void PrintSelf(std::ostream& os, Indent indent) const;
00120
00121 private:
00122 PadImageFilter(const Self&);
00123 void operator=(const Self&);
00124
00125 unsigned long m_PadLowerBound[ImageDimension];
00126 unsigned long m_PadUpperBound[ImageDimension];
00127 };
00128
00129
00130 }
00131
00132 #ifndef ITK_MANUAL_INSTANTIATION
00133 #include "itkPadImageFilter.txx"
00134 #endif
00135
00136 #endif
00137