ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkLandmarkSpatialObject.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkLandmarkSpatialObject_h
00019 #define __itkLandmarkSpatialObject_h
00020 
00021 #include <list>
00022 
00023 #include "itkPointBasedSpatialObject.h"
00024 
00025 namespace itk
00026 {
00037 template< unsigned int TDimension = 3 >
00038 class ITK_EXPORT LandmarkSpatialObject:
00039   public PointBasedSpatialObject<  TDimension >
00040 {
00041 public:
00042 
00043   typedef LandmarkSpatialObject                        Self;
00044   typedef PointBasedSpatialObject< TDimension >        Superclass;
00045   typedef SmartPointer< Self >                         Pointer;
00046   typedef SmartPointer< const Self >                   ConstPointer;
00047   typedef double                                       ScalarType;
00048   typedef SpatialObjectPoint< TDimension >             LandmarkPointType;
00049   typedef std::vector< LandmarkPointType >             PointListType;
00050   typedef typename Superclass::SpatialObjectPointType  SpatialObjectPointType;
00051   typedef typename Superclass::PointType               PointType;
00052   typedef typename Superclass::TransformType           TransformType;
00053   typedef typename Superclass::BoundingBoxType         BoundingBoxType;
00054   typedef VectorContainer< IdentifierType, PointType > PointContainerType;
00055   typedef SmartPointer< PointContainerType >           PointContainerPointer;
00056 
00058   itkNewMacro(Self);
00059 
00061   itkTypeMacro(LandmarkSpatialObject, PointBasedSpatialObject);
00062 
00064   PointListType & GetPoints(void);
00065 
00067   const PointListType & GetPoints(void) const;
00068 
00070   void SetPoints(PointListType & newPoints);
00071 
00073   const SpatialObjectPointType * GetPoint(IdentifierType id) const
00074   {
00075     return &( m_Points[id] );
00076   }
00077 
00079   SpatialObjectPointType * GetPoint(IdentifierType id) { return &( m_Points[id] ); }
00080 
00082   SizeValueType GetNumberOfPoints(void) const { return m_Points.size(); }
00083 
00086   bool IsEvaluableAt(const PointType & point,
00087                      unsigned int depth = 0, char *name = NULL) const;
00088 
00093   bool ValueAt(const PointType & point, double & value,
00094                unsigned int depth = 0, char *name = NULL) const;
00095 
00097   bool IsInside(const PointType & point,
00098                 unsigned int depth, char *name) const;
00099 
00103   virtual bool IsInside(const PointType & point) const;
00104 
00106   bool ComputeLocalBoundingBox(void) const;
00107 
00108 protected:
00109   LandmarkSpatialObject(const Self &); //purposely not implemented
00110   void operator=(const Self &);        //purposely not implemented
00111 
00112   PointListType m_Points;
00113 
00114   LandmarkSpatialObject();
00115   virtual ~LandmarkSpatialObject();
00116 
00118   virtual void PrintSelf(std::ostream & os, Indent indent) const;
00119 };
00120 } // end namespace itk
00121 
00122 #ifndef ITK_MANUAL_INSTANTIATION
00123 #include "itkLandmarkSpatialObject.hxx"
00124 #endif
00125 
00126 #endif // __itkLandmarkSpatialObject_h
00127