Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkImageSpatialObject.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkImageSpatialObject.h,v $
00005   Language:  C++
00006   Date:      $Date: 2003/02/10 16:00:09 $
00007   Version:   $Revision: 1.13 $
00008 
00009   Copyright (c) 2002 Insight Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 
00018 #ifndef __itkImageSpatialObject_h
00019 #define __itkImageSpatialObject_h
00020 
00021 #include "itkRGBPixel.h"
00022 #include "itkImage.h"
00023 #include "itkExceptionObject.h"
00024 #include "itkSpatialObject.h"
00025 
00026 namespace itk
00027 {
00028   
00038 template < unsigned int TDimension = 3,
00039            class PixelType = RGBPixel< char >
00040          >
00041 class ImageSpatialObject 
00042 : public SpatialObject< TDimension >
00043 {
00044 
00045 public:
00046  
00047   typedef double ScalarType; 
00048   typedef ImageSpatialObject< TDimension, PixelType > Self;
00049   typedef SpatialObject< TDimension > Superclass;
00050   typedef SmartPointer< Self > Pointer;
00051   typedef SmartPointer< const Self > ConstPointer;
00052 
00053   typedef Image< PixelType, TDimension > ImageType;
00054   typedef typename ImageType::Pointer ImagePointer;
00055   typedef typename ImageType::IndexType IndexType;
00056   typedef typename ImageType::RegionType RegionType;
00057 
00058   typedef typename Superclass::PointType PointType;
00059   typedef typename Superclass::BoundingBoxType BoundingBoxType;
00060 
00061   typedef VectorContainer< unsigned long, PointType> PointContainerType;
00062   typedef typename PointContainerType::Pointer PointContainerPointer;
00063 
00065   itkNewMacro( Self );
00066 
00068   itkTypeMacro( Self, Superclass );
00069 
00071   void SetImage( ImageType * image );
00072 
00074   ImageType * GetImage( void );
00075 
00078   bool IsEvaluableAt( const PointType & point, 
00079                       unsigned int depth=0, char *name=NULL) const;
00080 
00084   bool ValueAt( const PointType & point, double & value, 
00085                 unsigned int depth=0, char *name=NULL) const;
00086   
00088   bool IsInside( const PointType & point,
00089                   unsigned int depth=0, char *name=NULL) const;
00090  
00092   bool ComputeBoundingBox( unsigned int depth=0, char *name=NULL);
00093 
00095   unsigned long GetMTime( void ) const;
00096 
00098   void SetSlicePosition(unsigned int dimension, int position);
00099 
00101   int GetSlicePosition(unsigned int dimension) 
00102       {return m_SlicePosition[dimension];}
00103 
00104 protected:
00105 
00106   ImagePointer m_Image;
00107 
00108   ImageSpatialObject();
00109   virtual ~ImageSpatialObject();
00110 
00111   void PrintSelf( std::ostream& os, Indent indent ) const;
00112 
00113   int* m_SlicePosition;
00114 };
00115 
00116 } // end of namespace itk
00117 
00118 #ifndef ITK_MANUAL_INSTANTIATION
00119   #include "itkImageSpatialObject.txx"
00120 #endif
00121 
00122 #endif //__itkImageSpatialObject_h

Generated at Fri May 21 01:14:56 2004 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000