00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkWrapPadImageFilter_h
00018 #define __itkWrapPadImageFilter_h
00019
00020 #include "itkPadImageFilter.h"
00021 #include <vector>
00022
00023 namespace itk
00024 {
00025
00044 template <class TInputImage, class TOutputImage>
00045 class ITK_EXPORT WrapPadImageFilter:
00046 public PadImageFilter<TInputImage,TOutputImage>
00047 {
00048 public:
00050 typedef WrapPadImageFilter Self;
00051 typedef PadImageFilter<TInputImage,TOutputImage> Superclass;
00052 typedef SmartPointer<Self> Pointer;
00053 typedef SmartPointer<const Self> ConstPointer;
00054
00056 itkNewMacro(Self);
00057
00059 itkTypeMacro(WrapPadImageFilter, PadImageFilter);
00060
00061 typedef typename Superclass::InputImageType InputImageType;
00062 typedef typename Superclass::OutputImageType OutputImageType;
00063 typedef typename Superclass::InputImagePointer InputImagePointer;
00064 typedef typename Superclass::OutputImagePointer OutputImagePointer;
00065 typedef typename Superclass::InputImageConstPointer InputImageConstPointer;
00066
00068 typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00069 typedef typename Superclass::InputImageRegionType InputImageRegionType;
00070
00072 typedef typename Superclass::OutputImagePixelType OutputImagePixelType;
00073 typedef typename Superclass::InputImagePixelType InputImagePixelType;
00074
00076 typedef typename Superclass::OutputImageIndexType OutputImageIndexType;
00077 typedef typename Superclass::InputImageIndexType InputImageIndexType;
00078 typedef typename Superclass::OutputImageSizeType OutputImageSizeType;
00079 typedef typename Superclass::InputImageSizeType InputImageSizeType;
00080
00082 itkStaticConstMacro(ImageDimension, unsigned int,
00083 TInputImage::ImageDimension );
00084
00085 protected:
00086 WrapPadImageFilter() {};
00087 ~WrapPadImageFilter() {};
00088
00099 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00100 int threadId );
00101
00105 int GenerateNextInputRegion(long *regIndices, long *regLimit,
00106 std::vector<long>* indices,
00107 std::vector<long>* sizes,
00108 InputImageRegionType& outputRegion);
00109
00113 int GenerateNextOutputRegion(long *regIndices, long *regLimit,
00114 std::vector<long>* indices,
00115 std::vector<long>* sizes,
00116 OutputImageRegionType& outputRegion);
00117
00122 int FindRegionsInArea(long start, long end, long size, long offset);
00123
00130 int BuildInterRegions(std::vector<long>& inputRegionStart,
00131 std::vector<long>& outputRegionStart,
00132 std::vector<long>& inputRegionSizes,
00133 std::vector<long>& outputRegionSizes,
00134 long inputIndex, long outputIndex,
00135 long inputSize, long outputSize, int numRegs,
00136 int & regCtr);
00137
00146 int BuildPreRegions(std::vector<long>& inputRegionStart,
00147 std::vector<long>& outputRegionStart,
00148 std::vector<long>& inputRegionSizes,
00149 std::vector<long>& outputRegionSizes,
00150 long inputIndex, long outputIndex,
00151 long inputSize, long outputSize, int numRegs,
00152 int & regCtr);
00153
00162 int BuildPostRegions(std::vector<long>& inputRegionStart,
00163 std::vector<long>& outputRegionStart,
00164 std::vector<long>& inputRegionSizes,
00165 std::vector<long>& outputRegionSizes,
00166 long inputIndex, long outputIndex,
00167 long inputSize, long outputSize,
00168 int numRegs, int & regCtr);
00169
00176 virtual void GenerateInputRequestedRegion();
00177
00178 private:
00179 WrapPadImageFilter(const Self&);
00180 void operator=(const Self&);
00181
00182 };
00183
00184
00185 }
00186
00187 #ifndef ITK_MANUAL_INSTANTIATION
00188 #include "itkWrapPadImageFilter.txx"
00189 #endif
00190
00191 #endif