ITK
4.4.0
Insight Segmentation and Registration Toolkit
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
ITK
Modules
Core
Common
include
itkNeighborhoodAccessorFunctor.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 __itkNeighborhoodAccessorFunctor_h
19
#define __itkNeighborhoodAccessorFunctor_h
20
21
#include "
itkImageBoundaryCondition.h
"
22
#include "
itkImageBase.h
"
23
24
namespace
itk
25
{
40
template
<
class
TImage >
41
class
NeighborhoodAccessorFunctor
42
{
43
public
:
44
typedef
NeighborhoodAccessorFunctor
Self
;
45
typedef
TImage
ImageType
;
46
typedef
typename
ImageType::PixelType
PixelType
;
47
typedef
typename
ImageType::InternalPixelType
InternalPixelType
;
48
typedef
unsigned
int
VectorLengthType
;
49
typedef
typename
ImageType::OffsetType
OffsetType
;
50
51
itkStaticConstMacro(
ImageDimension
,
unsigned
int
, TImage::ImageDimension);
52
typedef
Neighborhood< InternalPixelType *, Self::ImageDimension >
NeighborhoodType
;
53
54
typedef
ImageBoundaryCondition< ImageType >
const
*
55
ImageBoundaryConditionConstPointerType
;
56
58
inline
void
SetBegin
(
const
InternalPixelType
*) {}
59
66
inline
PixelType
Get
(
const
InternalPixelType
*pixelPointer)
const
67
{
68
return
( *pixelPointer );
69
}
70
72
inline
void
Set
(
InternalPixelType
* & pixelPointer,
const
PixelType
& p)
const
73
{
74
*pixelPointer = p;
75
}
76
77
inline
PixelType
BoundaryCondition
(
78
const
OffsetType
& point_index,
79
const
OffsetType
& boundary_offset,
80
const
NeighborhoodType
*data,
81
const
ImageBoundaryConditionConstPointerType
boundaryCondition)
const
82
{
83
return
boundaryCondition->operator()(point_index, boundary_offset, data);
84
}
85
86
void
SetVectorLength
(
VectorLengthType
) {}
87
VectorLengthType
SetVectorLength
() {
return
0; }
88
90
NeighborhoodAccessorFunctor
() {}
91
93
virtual
~NeighborhoodAccessorFunctor
() {}
94
};
95
}
// end namespace itk
96
97
//template< class TImage > const unsigned int
98
// itk::NeighborhoodAccessorFunctor<TImage>::ImageDimension;
99
100
#endif
101
Generated on Mon May 13 2013 01:02:34 for ITK by
1.8.3.1