ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkMirrorPadImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkMirrorPadImageFilter_h
19 #define itkMirrorPadImageFilter_h
20 
21 #include "itkPadImageFilter.h"
22 #include <vector>
23 
24 namespace itk
25 {
51 template< typename TInputImage, typename TOutputImage >
52 class ITK_TEMPLATE_EXPORT MirrorPadImageFilter:
53  public PadImageFilter< TInputImage, TOutputImage >
54 {
55 public:
61 
63  itkNewMacro(Self);
64 
67 
68  typedef TInputImage InputImageType;
69  typedef TOutputImage OutputImageType;
70 
72  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
73  typedef typename Superclass::InputImageRegionType InputImageRegionType;
74 
76  typedef typename Superclass::OutputImagePixelType OutputImagePixelType;
77  typedef typename Superclass::InputImagePixelType InputImagePixelType;
78 
80  typedef typename Superclass::OutputImageIndexType OutputImageIndexType;
81  typedef typename Superclass::InputImageIndexType InputImageIndexType;
82  typedef typename Superclass::OutputImageSizeType OutputImageSizeType;
83  typedef typename Superclass::InputImageSizeType InputImageSizeType;
84 
86  itkStaticConstMacro(ImageDimension, unsigned int,
87  TInputImage::ImageDimension);
88 
89 #ifdef ITK_USE_CONCEPT_CHECKING
90  // Begin concept checking
91  itkConceptMacro( InputConvertibleToOutputCheck,
93  // End concept checking
94 #endif
95 
96 protected:
98  ~MirrorPadImageFilter() ITK_OVERRIDE {}
99 
102  void ConvertOutputIndexToInputIndex(OutputImageIndexType & outputIndex,
103  InputImageIndexType & inputIndex,
104  OutputImageRegionType & outputRegion,
105  InputImageRegionType & inputRegion,
106  int *oddRegionArray);
107 
110  int RegionIsOdd(long base, long test, long size);
111 
122  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
123  ThreadIdType threadId) ITK_OVERRIDE;
124 
128  int GenerateNextInputRegion(long *regIndices, long *regLimit,
129  std::vector< long > *indices,
130  std::vector< long > *sizes,
131  InputImageRegionType & outputRegion);
132 
136  int GenerateNextOutputRegion(long *regIndices, long *regLimit,
137  std::vector< long > *indices,
138  std::vector< long > *sizes,
139  OutputImageRegionType & outputRegion);
140 
145  int FindRegionsInArea(long start, long end, long size, long offset);
146 
153  int BuildInterRegions(std::vector< long > & inputRegionStart,
154  std::vector< long > & outputRegionStart,
155  std::vector< long > & inputRegionSizes,
156  std::vector< long > & outputRegionSizes,
157  long inputIndex, long outputIndex,
158  long inputSize, long outputSize, int numRegs,
159  int & regCtr);
160 
169  int BuildPreRegions(std::vector< long > & inputRegionStart,
170  std::vector< long > & outputRegionStart,
171  std::vector< long > & inputRegionSizes,
172  std::vector< long > & outputRegionSizes,
173  long inputIndex, long outputIndex,
174  long inputSize, long outputSize, int numRegs,
175  int & regCtr);
176 
185  int BuildPostRegions(std::vector< long > & inputRegionStart,
186  std::vector< long > & outputRegionStart,
187  std::vector< long > & inputRegionSizes,
188  std::vector< long > & outputRegionSizes,
189  long inputIndex, long outputIndex,
190  long inputSize, long outputSize,
191  int numRegs, int & regCtr);
192 
200  virtual void GenerateInputRequestedRegion() ITK_OVERRIDE;
201 
202 private:
203  ITK_DISALLOW_COPY_AND_ASSIGN(MirrorPadImageFilter);
204 };
205 } // end namespace itk
206 
207 #ifndef ITK_MANUAL_INSTANTIATION
208 #include "itkMirrorPadImageFilter.hxx"
209 #endif
210 
211 #endif
Superclass::InputImagePixelType InputImagePixelType
Superclass::OutputImageRegionType OutputImageRegionType
Superclass::OutputImageSizeType OutputImageSizeType
Base class for all process objects that output image data.
Superclass::InputImageIndexType InputImageIndexType
SmartPointer< const Self > ConstPointer
PadImageFilter< TInputImage, TOutputImage > Superclass
Superclass::InputImageSizeType InputImageSizeType
Superclass::InputImageRegionType InputImageRegionType
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
Superclass::OutputImageIndexType OutputImageIndexType
Superclass::OutputImagePixelType OutputImagePixelType
Increase the image size by padding with replicants of the input image value.
Increase the image size by padding. Superclass for filters that fill in extra pixels.
#define itkConceptMacro(name, concept)