ITK  4.8.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 >
53  public PadImageFilter< TInputImage, TOutputImage >
54 {
55 public:
61 
63  itkNewMacro(Self);
64 
67 
68  typedef TInputImage InputImageType;
69  typedef TOutputImage OutputImageType;
70 
74 
78 
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:
99 
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  MirrorPadImageFilter(const Self &); //purposely not implemented
204  void operator=(const Self &); //purposely not implemented
205 };
206 } // end namespace itk
207 
208 #ifndef ITK_MANUAL_INSTANTIATION
209 #include "itkMirrorPadImageFilter.hxx"
210 #endif
211 
212 #endif
TOutputImage::RegionType OutputImageRegionType
Superclass::InputImagePixelType InputImagePixelType
virtual void GenerateInputRequestedRegion() override
Superclass::OutputImageRegionType OutputImageRegionType
TInputImage::RegionType InputImageRegionType
int BuildPostRegions(std::vector< long > &inputRegionStart, std::vector< long > &outputRegionStart, std::vector< long > &inputRegionSizes, std::vector< long > &outputRegionSizes, long inputIndex, long outputIndex, long inputSize, long outputSize, int numRegs, int &regCtr)
Superclass::OutputImageSizeType OutputImageSizeType
void ConvertOutputIndexToInputIndex(OutputImageIndexType &outputIndex, InputImageIndexType &inputIndex, OutputImageRegionType &outputRegion, InputImageRegionType &inputRegion, int *oddRegionArray)
TInputImage::PixelType InputImagePixelType
Base class for all process objects that output image data.
TInputImage::IndexType InputImageIndexType
static const unsigned int ImageDimension
Superclass::InputImageIndexType InputImageIndexType
int FindRegionsInArea(long start, long end, long size, long offset)
int BuildInterRegions(std::vector< long > &inputRegionStart, std::vector< long > &outputRegionStart, std::vector< long > &inputRegionSizes, std::vector< long > &outputRegionSizes, long inputIndex, long outputIndex, long inputSize, long outputSize, int numRegs, int &regCtr)
TOutputImage::SizeType OutputImageSizeType
int GenerateNextOutputRegion(long *regIndices, long *regLimit, std::vector< long > *indices, std::vector< long > *sizes, OutputImageRegionType &outputRegion)
SmartPointer< const Self > ConstPointer
TOutputImage::PixelType OutputImagePixelType
PadImageFilter< TInputImage, TOutputImage > Superclass
int RegionIsOdd(long base, long test, long size)
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId) override
Superclass::InputImageSizeType InputImageSizeType
Superclass::InputImageRegionType InputImageRegionType
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
Superclass::OutputImageIndexType OutputImageIndexType
Superclass::OutputImagePixelType OutputImagePixelType
int GenerateNextInputRegion(long *regIndices, long *regLimit, std::vector< long > *indices, std::vector< long > *sizes, InputImageRegionType &outputRegion)
TInputImage::SizeType InputImageSizeType
Increase the image size by padding with replicants of the input image value.
TOutputImage::IndexType OutputImageIndexType
Increase the image size by padding. Superclass for filters that fill in extra pixels.
#define itkConceptMacro(name, concept)
int BuildPreRegions(std::vector< long > &inputRegionStart, std::vector< long > &outputRegionStart, std::vector< long > &inputRegionSizes, std::vector< long > &outputRegionSizes, long inputIndex, long outputIndex, long inputSize, long outputSize, int numRegs, int &regCtr)