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  This file is part of the elastix software.
4 
5  Copyright (c) University Medical Center Utrecht. All rights reserved.
6  See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
7  details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notices for more information.
12 
13 ======================================================================*/
14 
17 /*=========================================================================
18 
19  Program: Insight Segmentation & Registration Toolkit
20  Module: $RCSfile$
21  Language: C++
22  Date: $Date: 2008-05-28 10:45:42 +0200 (Wed, 28 May 2008) $
23  Version: $Revision: 1636 $
24 
25  Copyright (c) Insight Software Consortium. All rights reserved.
26  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
27 
28  This software is distributed WITHOUT ANY WARRANTY; without even
29  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
30  PURPOSE. See the above copyright notices for more information.
31 
32 =========================================================================*/
33 
34 #ifndef __itkImageSpatialObject2_h
35 #define __itkImageSpatialObject2_h
36 
37 #include "itkImage.h"
38 #include "itkExceptionObject.h"
39 #include "itkSpatialObject.h"
40 #include "itkInterpolateImageFunction.h"
41 #include "itkNearestNeighborInterpolateImageFunction.h"
42 
43 namespace itk
44 {
45 
56 template < unsigned int TDimension = 3,
57  class TPixelType = unsigned char
58 >
60  : public SpatialObject< TDimension >
61 {
62 
63 public:
64 
65  typedef double ScalarType;
67  typedef SpatialObject< TDimension > Superclass;
68  typedef SmartPointer< Self > Pointer;
69  typedef SmartPointer< const Self > ConstPointer;
70 
71  typedef TPixelType PixelType;
72  typedef Image< PixelType, TDimension > ImageType;
73  typedef typename ImageType::ConstPointer ImagePointer;
74  typedef typename ImageType::IndexType IndexType;
75  typedef typename ImageType::SizeType SizeType;
76  typedef typename ImageType::RegionType RegionType;
77  typedef typename Superclass::TransformType TransformType;
78  typedef typename Superclass::PointType PointType;
79  typedef typename Superclass::BoundingBoxType BoundingBoxType;
80  typedef InterpolateImageFunction<ImageType> InterpolatorType;
81 
84 
85  typedef VectorContainer< unsigned long, PointType> PointContainerType;
86  typedef typename PointContainerType::Pointer PointContainerPointer;
87 
89  itkNewMacro( Self );
90 
92  itkTypeMacro( ImageSpatialObject2, SpatialObject );
93 
95  void SetImage( const ImageType * image );
96 
98  const ImageType * GetImage( void ) const;
99 
102  bool IsEvaluableAt( const PointType & point,
103  unsigned int depth=0, char *name=NULL) const;
104 
108  bool ValueAt( const PointType & point, double & value,
109  unsigned int depth=0, char *name=NULL) const;
110 
111 
113  bool IsInside( const PointType & point,
114  unsigned int depth, char *name) const;
115 
119  bool IsInside( const PointType & point) const;
120 
122  bool ComputeLocalBoundingBox() const;
123 
125  unsigned long GetMTime( void ) const;
126 
128  void SetSlicePosition(unsigned int dimension, int position);
129 
131  int GetSlicePosition(unsigned int dimension)
132  {return m_SlicePosition[dimension];}
133 
134  const char* GetPixelType()
135  {
136  return m_PixelType.c_str();
137  }
138 
140  void SetInterpolator(InterpolatorType * interpolator);
141  itkGetObjectMacro(Interpolator,InterpolatorType);
142 
143 protected:
144  ImageSpatialObject2(const Self&); //purposely not implemented
145  void operator=(const Self&); //purposely not implemented
146 
148 
150  virtual ~ImageSpatialObject2();
151 
152  void PrintSelf( std::ostream& os, Indent indent ) const;
153 
155  std::string m_PixelType;
156 
157  typename InterpolatorType::Pointer m_Interpolator;
158 };
159 
160 } // end of namespace itk
161 
162 #ifndef ITK_MANUAL_INSTANTIATION
163 #include "itkImageSpatialObject2.txx"
164 #endif
165 
166 #endif //__itkImageSpatialObject2_h
InterpolatorType::Pointer m_Interpolator
Superclass::PointType PointType
bool IsInside(const PointType &point, unsigned int depth, char *name) const
NearestNeighborInterpolateImageFunction< ImageType > NNInterpolatorType
void operator=(const Self &)
SmartPointer< const Self > ConstPointer
void SetImage(const ImageType *image)
ImageType::IndexType IndexType
unsigned long GetMTime(void) const
VectorContainer< unsigned long, PointType > PointContainerType
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
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
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
InterpolateImageFunction< ImageType > InterpolatorType
void SetSlicePosition(unsigned int dimension, int position)
ImageType::ConstPointer ImagePointer


Generated on 06-12-2013 for elastix by doxygen 1.8.5 elastix logo