go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkImageSpatialObject2.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright UMC Utrecht and contributors
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 
21 /*=========================================================================
22 
23  Program: Insight Segmentation & Registration Toolkit
24  Module: $RCSfile$
25  Language: C++
26  Date: $Date: 2008-05-28 10:45:42 +0200 (Wed, 28 May 2008) $
27  Version: $Revision: 1636 $
28 
29  Copyright (c) Insight Software Consortium. All rights reserved.
30  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
31 
32  This software is distributed WITHOUT ANY WARRANTY; without even
33  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
34  PURPOSE. See the above copyright notices for more information.
35 
36 =========================================================================*/
37 #ifndef __itkImageSpatialObject2_h
38 #define __itkImageSpatialObject2_h
39 
40 #include "itkImage.h"
41 #include "itkExceptionObject.h"
42 #include "itkSpatialObject.h"
43 #include "itkInterpolateImageFunction.h"
44 #include "itkNearestNeighborInterpolateImageFunction.h"
45 
46 namespace itk
47 {
48 
59 template< unsigned int TDimension = 3,
60 class TPixelType = unsigned char
61 >
63  public SpatialObject< TDimension >
64 {
65 
66 public:
67 
68  typedef double ScalarType;
70  typedef SpatialObject< TDimension > Superclass;
72  typedef SmartPointer< const Self > ConstPointer;
73 
74  typedef TPixelType PixelType;
76  typedef typename ImageType::ConstPointer ImagePointer;
77  typedef typename ImageType::IndexType IndexType;
78  typedef typename ImageType::SizeType SizeType;
79  typedef typename ImageType::RegionType RegionType;
80  typedef typename Superclass::TransformType TransformType;
81  typedef typename Superclass::PointType PointType;
82  typedef typename Superclass::BoundingBoxType BoundingBoxType;
83  typedef InterpolateImageFunction< ImageType > InterpolatorType;
84 
85  typedef NearestNeighborInterpolateImageFunction< ImageType >
87 
88  typedef VectorContainer< unsigned long, PointType > PointContainerType;
89  typedef typename PointContainerType::Pointer PointContainerPointer;
90 
92  itkNewMacro( Self );
93 
95  itkTypeMacro( ImageSpatialObject2, SpatialObject );
96 
98  void SetImage( const ImageType * image );
99 
101  const ImageType * GetImage( void ) const;
102 
105  bool IsEvaluableAt( const PointType & point,
106  unsigned int depth = 0, char * name = NULL ) const;
107 
111  bool ValueAt( const PointType & point, double & value,
112  unsigned int depth = 0, char * name = NULL ) const;
113 
115  bool IsInside( const PointType & point,
116  unsigned int depth, char * name ) const;
117 
121  bool IsInside( const PointType & point ) const;
122 
124  bool ComputeLocalBoundingBox() const;
125 
127  unsigned long GetMTime( void ) const;
128 
130  void SetSlicePosition( unsigned int dimension, int position );
131 
133  int GetSlicePosition( unsigned int dimension )
134  { return m_SlicePosition[ dimension ]; }
135 
136  const char * GetPixelType()
137  {
138  return m_PixelType.c_str();
139  }
140 
141 
143  void SetInterpolator( InterpolatorType * interpolator );
144 
145  itkGetObjectMacro( Interpolator, InterpolatorType );
146 
147 protected:
148 
149  ImageSpatialObject2( const Self & ); // purposely not implemented
150  void operator=( const Self & ); // purposely not implemented
151 
152  ImagePointer m_Image;
153 
155  virtual ~ImageSpatialObject2();
156 
157  void PrintSelf( std::ostream & os, Indent indent ) const;
158 
160  std::string m_PixelType;
161 
162  typename InterpolatorType::Pointer m_Interpolator;
163 };
164 
165 } // end of namespace itk
166 
167 #ifndef ITK_MANUAL_INSTANTIATION
168 #include "itkImageSpatialObject2.hxx"
169 #endif
170 
171 #endif //__itkImageSpatialObject2_h
InterpolatorType::Pointer m_Interpolator
Superclass::PointType PointType
bool IsInside(const PointType &point, unsigned int depth, char *name) const
void operator=(const Self &)
SmartPointer< const Self > ConstPointer
void SetImage(const ImageType *image)
ImageType::IndexType IndexType
unsigned long GetMTime(void) const
SpatialObject< TDimension > Superclass
int GetSlicePosition(unsigned int dimension)
Implementation of an image as spatial object.
bool IsEvaluableAt(const PointType &point, unsigned int depth=0, char *name=NULL) const
Image< PixelType, TDimension > ImageType
InterpolateImageFunction< ImageType > InterpolatorType
SmartPointer< Self > Pointer
void PrintSelf(std::ostream &os, Indent indent) const
const ImageType * GetImage(void) const
Superclass::BoundingBoxType BoundingBoxType
PointContainerType::Pointer PointContainerPointer
Superclass::TransformType TransformType
VectorContainer< unsigned long, PointType > PointContainerType
void SetInterpolator(InterpolatorType *interpolator)
bool ValueAt(const PointType &point, double &value, unsigned int depth=0, char *name=NULL) const
ImageSpatialObject2< TDimension, TPixelType > Self
ImageType::RegionType RegionType
bool ComputeLocalBoundingBox() const
void SetSlicePosition(unsigned int dimension, int position)
NearestNeighborInterpolateImageFunction< ImageType > NNInterpolatorType
ImageType::ConstPointer ImagePointer


Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo