00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkMirrorPadImageFilter_h
00018 #define __itkMirrorPadImageFilter_h
00019
00020 #include "itkPadImageFilter.h"
00021 #include <vector>
00022
00023 namespace itk
00024 {
00025
00039 template <class TInputImage, class TOutputImage>
00040 class ITK_EXPORT MirrorPadImageFilter:
00041 public PadImageFilter<TInputImage,TOutputImage>
00042 {
00043 public:
00045 typedef MirrorPadImageFilter Self;
00046 typedef PadImageFilter<TInputImage,TOutputImage> Superclass;
00047 typedef SmartPointer<Self> Pointer;
00048 typedef SmartPointer<const Self> ConstPointer;
00049
00051 itkNewMacro(Self);
00052
00054 itkTypeMacro(MirrorPadImageFilter, PadImageFilter);
00055
00056 typedef TInputImage InputImageType;
00057 typedef TOutputImage OutputImageType;
00058
00060 typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00061 typedef typename Superclass::InputImageRegionType InputImageRegionType;
00062
00064 typedef typename Superclass::OutputImagePixelType OutputImagePixelType;
00065 typedef typename Superclass::InputImagePixelType InputImagePixelType;
00066
00068 typedef typename Superclass::OutputImageIndexType OutputImageIndexType;
00069 typedef typename Superclass::InputImageIndexType InputImageIndexType;
00070 typedef typename Superclass::OutputImageSizeType OutputImageSizeType;
00071 typedef typename Superclass::InputImageSizeType InputImageSizeType;
00072
00074 itkStaticConstMacro(ImageDimension, unsigned int,
00075 TInputImage::ImageDimension);
00076
00077 protected:
00078 MirrorPadImageFilter() {};
00079 ~MirrorPadImageFilter() {};
00080 void PrintSelf(std::ostream& os, Indent indent) const;
00081
00084 void ConvertOutputIndexToInputIndex(OutputImageIndexType & outputIndex,
00085 InputImageIndexType & inputIndex,
00086 OutputImageRegionType & outputRegion,
00087 InputImageRegionType & inputRegion,
00088 int oddRegionArray[ImageDimension]);
00089
00092 int RegionIsOdd(long base, long test, long size);
00093
00104 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00105 int threadId );
00109 int GenerateNextInputRegion(long *regIndices, long *regLimit,
00110 std::vector<long> indices[],
00111 std::vector<long> sizes[],
00112 InputImageRegionType& outputRegion);
00113
00117 int GenerateNextOutputRegion(long *regIndices, long *regLimit,
00118 std::vector<long> indices[],
00119 std::vector<long> sizes[],
00120 OutputImageRegionType& outputRegion);
00125 int FindRegionsInArea(long start, long end, long size, long offset);
00126
00133 int BuildInterRegions(std::vector<long>& inputRegionStart,
00134 std::vector<long>& outputRegionStart,
00135 std::vector<long>& inputRegionSizes,
00136 std::vector<long>& outputRegionSizes,
00137 long inputIndex, long outputIndex,
00138 long inputSize, long outputSize, int numRegs,
00139 int & regCtr);
00140
00149 int BuildPreRegions(std::vector<long>& inputRegionStart,
00150 std::vector<long>& outputRegionStart,
00151 std::vector<long>& inputRegionSizes,
00152 std::vector<long>& outputRegionSizes,
00153 long inputIndex, long outputIndex,
00154 long inputSize, long outputSize, int numRegs,
00155 int & regCtr);
00156
00165 int BuildPostRegions(std::vector<long>& inputRegionStart,
00166 std::vector<long>& outputRegionStart,
00167 std::vector<long>& inputRegionSizes,
00168 std::vector<long>& outputRegionSizes,
00169 long inputIndex, long outputIndex,
00170 long inputSize, long outputSize,
00171 int numRegs, int & regCtr);
00172
00180 virtual void GenerateInputRequestedRegion();
00181
00182 private:
00183 MirrorPadImageFilter(const Self&);
00184 void operator=(const Self&);
00185
00186 };
00187
00188
00189 }
00190
00191 #ifndef ITK_MANUAL_INSTANTIATION
00192 #include "itkMirrorPadImageFilter.txx"
00193 #endif
00194
00195 #endif