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.
00001 /*======================================================================
00002 
00003   This file is part of the elastix software.
00004 
00005   Copyright (c) University Medical Center Utrecht. All rights reserved.
00006   See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
00007   details.
00008 
00009      This software is distributed WITHOUT ANY WARRANTY; without even
00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00011      PURPOSE. See the above copyright notices for more information.
00012 
00013 ======================================================================*/
00014 
00017 /*=========================================================================
00018 
00019   Program:   Insight Segmentation & Registration Toolkit
00020   Module:    $RCSfile$
00021   Language:  C++
00022   Date:      $Date: 2008-05-28 10:45:42 +0200 (Wed, 28 May 2008) $
00023   Version:   $Revision: 1636 $
00024 
00025   Copyright (c) Insight Software Consortium. All rights reserved.
00026   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00027 
00028      This software is distributed WITHOUT ANY WARRANTY; without even
00029      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00030      PURPOSE.  See the above copyright notices for more information.
00031 
00032 =========================================================================*/
00033 
00034 #ifndef __itkImageSpatialObject2_h
00035 #define __itkImageSpatialObject2_h
00036 
00037 #include "itkImage.h"
00038 #include "itkExceptionObject.h"
00039 #include "itkSpatialObject.h"
00040 #include "itkInterpolateImageFunction.h"
00041 #include "itkNearestNeighborInterpolateImageFunction.h"
00042 
00043 namespace itk
00044 {
00045 
00056 template < unsigned int TDimension = 3,
00057            class TPixelType = unsigned char
00058 >
00059 class ImageSpatialObject2
00060   : public SpatialObject< TDimension >
00061 {
00062 
00063 public:
00064 
00065   typedef double ScalarType;
00066   typedef ImageSpatialObject2< TDimension, TPixelType > Self;
00067   typedef SpatialObject< TDimension >                 Superclass;
00068   typedef SmartPointer< Self >                        Pointer;
00069   typedef SmartPointer< const Self >                  ConstPointer;
00070 
00071   typedef TPixelType                            PixelType;
00072   typedef Image< PixelType, TDimension >        ImageType;
00073   typedef typename ImageType::ConstPointer      ImagePointer;
00074   typedef typename ImageType::IndexType         IndexType;
00075   typedef typename ImageType::SizeType          SizeType;
00076   typedef typename ImageType::RegionType        RegionType;
00077   typedef typename Superclass::TransformType    TransformType;
00078   typedef typename Superclass::PointType        PointType;
00079   typedef typename Superclass::BoundingBoxType  BoundingBoxType;
00080   typedef InterpolateImageFunction<ImageType>   InterpolatorType;
00081 
00082   typedef NearestNeighborInterpolateImageFunction<ImageType>
00083     NNInterpolatorType;
00084 
00085   typedef VectorContainer< unsigned long, PointType> PointContainerType;
00086   typedef typename PointContainerType::Pointer PointContainerPointer;
00087 
00089   itkNewMacro( Self );
00090 
00092   itkTypeMacro( ImageSpatialObject2, SpatialObject );
00093 
00095   void SetImage( const ImageType * image );
00096 
00098   const ImageType * GetImage( void ) const;
00099 
00102   bool IsEvaluableAt( const PointType & point,
00103                       unsigned int depth=0, char *name=NULL) const;
00104 
00108   bool ValueAt( const PointType & point, double & value,
00109                 unsigned int depth=0, char *name=NULL) const;
00110 
00111 
00113   bool IsInside( const PointType & point,
00114                  unsigned int depth, char *name) const;
00115 
00119   bool IsInside( const PointType & point) const;
00120 
00122   bool ComputeLocalBoundingBox() const;
00123 
00125   unsigned long GetMTime( void ) const;
00126 
00128   void SetSlicePosition(unsigned int dimension, int position);
00129 
00131   int GetSlicePosition(unsigned int dimension)
00132   {return m_SlicePosition[dimension];}
00133 
00134   const char* GetPixelType()
00135     {
00136     return m_PixelType.c_str();
00137     }
00138 
00140   void SetInterpolator(InterpolatorType * interpolator);
00141   itkGetObjectMacro(Interpolator,InterpolatorType);
00142 
00143 protected:
00144   ImageSpatialObject2(const Self&); //purposely not implemented
00145   void operator=(const Self&); //purposely not implemented
00146 
00147   ImagePointer m_Image;
00148 
00149   ImageSpatialObject2();
00150   virtual ~ImageSpatialObject2();
00151 
00152   void PrintSelf( std::ostream& os, Indent indent ) const;
00153 
00154   int* m_SlicePosition;
00155   std::string m_PixelType;
00156 
00157   typename InterpolatorType::Pointer m_Interpolator;
00158 };
00159 
00160 } // end of namespace itk
00161 
00162 #ifndef ITK_MANUAL_INSTANTIATION
00163 #include "itkImageSpatialObject2.txx"
00164 #endif
00165 
00166 #endif //__itkImageSpatialObject2_h


Generated on 24-10-2011 for elastix by doxygen 1.7.4 elastix logo