ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkImageBoundaryCondition.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 __itkImageBoundaryCondition_h
19 #define __itkImageBoundaryCondition_h
20 
21 #include "itkIndex.h"
22 #include "itkNeighborhood.h"
23 #include "itkImageRegion.h"
24 
25 namespace itk
26 {
51 template< class TInputImage, class TOutputImage = TInputImage >
52 class ITK_EXPORT ImageBoundaryCondition
53 {
54 public:
55 
57  itkStaticConstMacro(ImageDimension, unsigned int,
58  TInputImage::ImageDimension);
59 
62 
64  typedef typename TInputImage::PixelType PixelType;
65  typedef typename TInputImage::InternalPixelType * PixelPointerType;
66  typedef typename TOutputImage::PixelType OutputPixelType;
72 
75  itkGetStaticConstMacro(ImageDimension) > NeighborhoodType;
76 
78  typedef typename TInputImage::NeighborhoodAccessorFunctorType
80 
83 
85  virtual const char * GetNameOfClass() const
86  {
87  return "itkImageBoundaryCondition";
88  }
89 
91  virtual void Print( std::ostream & os, Indent i = 0 ) const
92  {
93  os << i << this->GetNameOfClass() << " (" << this << ")" << std::endl;
94  }
95 
100  virtual OutputPixelType operator()(const OffsetType & point_index,
101  const OffsetType & boundary_offset,
102  const NeighborhoodType *data) const = 0;
103 
106  virtual OutputPixelType operator()(
107  const OffsetType & point_index,
108  const OffsetType & boundary_offset,
109  const NeighborhoodType *data,
110  const NeighborhoodAccessorFunctorType & neighborhoodAccessorFunctor) const = 0;
111 
113 
120  virtual bool RequiresCompleteNeighborhood() { return true; }
121 
131  virtual RegionType GetInputRequestedRegion( const RegionType & inputLargestPossibleRegion,
132  const RegionType & outputRequestedRegion ) const
133  {
134  (void) outputRequestedRegion;
135  return inputLargestPossibleRegion;
136  }
138 
147  virtual OutputPixelType GetPixel( const IndexType & index,
148  const TInputImage * image ) const = 0;
149 
150 };
151 } // end namespace itk
152 
153 #endif
154