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
00044 template <class TInputImage, class TOutputImage>
00045 class ITK_EXPORT MirrorPadImageFilter:
00046 public PadImageFilter<TInputImage,TOutputImage>
00047 {
00048 public:
00050 typedef MirrorPadImageFilter 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(MirrorPadImageFilter, PadImageFilter);
00060
00061 typedef TInputImage InputImageType;
00062 typedef TOutputImage OutputImageType;
00063
00065 typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00066 typedef typename Superclass::InputImageRegionType InputImageRegionType;
00067
00069 typedef typename Superclass::OutputImagePixelType OutputImagePixelType;
00070 typedef typename Superclass::InputImagePixelType InputImagePixelType;
00071
00073 typedef typename Superclass::OutputImageIndexType OutputImageIndexType;
00074 typedef typename Superclass::InputImageIndexType InputImageIndexType;
00075 typedef typename Superclass::OutputImageSizeType OutputImageSizeType;
00076 typedef typename Superclass::InputImageSizeType InputImageSizeType;
00077
00079 itkStaticConstMacro(ImageDimension, unsigned int,
00080 TInputImage::ImageDimension);
00081
00082 #ifdef ITK_USE_CONCEPT_CHECKING
00083
00084 itkConceptMacro(InputConvertibleToOutputCheck,
00085 (Concept::Convertible<InputImagePixelType, OutputImagePixelType>));
00086
00088 #endif
00089
00090 protected:
00091 MirrorPadImageFilter() {};
00092 ~MirrorPadImageFilter() {};
00093
00096 void ConvertOutputIndexToInputIndex(OutputImageIndexType & outputIndex,
00097 InputImageIndexType & inputIndex,
00098 OutputImageRegionType & outputRegion,
00099 InputImageRegionType & inputRegion,
00100 int* oddRegionArray);
00101
00104 int RegionIsOdd(long base, long test, long size);
00105
00116 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00117 int threadId );
00118
00122 int GenerateNextInputRegion(long *regIndices, long *regLimit,
00123 std::vector<long>* indices,
00124 std::vector<long>* sizes,
00125 InputImageRegionType& outputRegion);
00126
00130 int GenerateNextOutputRegion(long *regIndices, long *regLimit,
00131 std::vector<long>* indices,
00132 std::vector<long>* sizes,
00133 OutputImageRegionType& outputRegion);
00134
00139 int FindRegionsInArea(long start, long end, long size, long offset);
00140
00147 int BuildInterRegions(std::vector<long>& inputRegionStart,
00148 std::vector<long>& outputRegionStart,
00149 std::vector<long>& inputRegionSizes,
00150 std::vector<long>& outputRegionSizes,
00151 long inputIndex, long outputIndex,
00152 long inputSize, long outputSize, int numRegs,
00153 int & regCtr);
00154
00163 int BuildPreRegions(std::vector<long>& inputRegionStart,
00164 std::vector<long>& outputRegionStart,
00165 std::vector<long>& inputRegionSizes,
00166 std::vector<long>& outputRegionSizes,
00167 long inputIndex, long outputIndex,
00168 long inputSize, long outputSize, int numRegs,
00169 int & regCtr);
00170
00179 int BuildPostRegions(std::vector<long>& inputRegionStart,
00180 std::vector<long>& outputRegionStart,
00181 std::vector<long>& inputRegionSizes,
00182 std::vector<long>& outputRegionSizes,
00183 long inputIndex, long outputIndex,
00184 long inputSize, long outputSize,
00185 int numRegs, int & regCtr);
00186
00194 virtual void GenerateInputRequestedRegion();
00195
00196 private:
00197 MirrorPadImageFilter(const Self&);
00198 void operator=(const Self&);
00199
00200 };
00201
00202
00203 }
00204
00205 #ifndef ITK_MANUAL_INSTANTIATION
00206 #include "itkMirrorPadImageFilter.txx"
00207 #endif
00208
00209 #endif
00210