ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkGaussianSpatialObject.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 __itkGaussianSpatialObject_h
00019 #define __itkGaussianSpatialObject_h
00020 
00021 #include "itkEllipseSpatialObject.h"
00022 
00023 namespace itk
00024 {
00042 template< unsigned int TDimension = 3 >
00043 class ITK_EXPORT GaussianSpatialObject:
00044   public SpatialObject< TDimension >
00045 {
00046 public:
00047 
00048   typedef GaussianSpatialObject                Self;
00049   typedef double                               ScalarType;
00050   typedef SmartPointer< Self >                 Pointer;
00051   typedef SmartPointer< const Self >           ConstPointer;
00052   typedef SpatialObject< TDimension >          Superclass;
00053   typedef SmartPointer< Superclass >           SuperclassPointer;
00054   typedef typename Superclass::PointType       PointType;
00055   typedef typename Superclass::TransformType   TransformType;
00056   typedef typename Superclass::BoundingBoxType BoundingBoxType;
00057 
00058   itkStaticConstMacro(NumberOfDimensions, unsigned int,
00059                       TDimension);
00060 
00061   itkNewMacro(Self);
00062   itkTypeMacro(GaussianSpatialObject, SpatialObject);
00063 
00067   itkSetMacro(Radius, ScalarType);
00068   itkGetConstReferenceMacro(Radius, ScalarType);
00070 
00073   itkSetMacro(Sigma, ScalarType);
00074   itkGetConstReferenceMacro(Sigma, ScalarType);
00076 
00079   itkSetMacro(Maximum, ScalarType);
00080   itkGetConstReferenceMacro(Maximum, ScalarType);
00082 
00086   ScalarType SquaredZScore(const PointType & point) const;
00087 
00089   virtual bool ValueAt(const PointType & point, ScalarType & value,
00090                        unsigned int depth = 0,
00091                        char *name = NULL) const;
00092 
00095   virtual bool IsEvaluableAt(const PointType & point,
00096                              unsigned int depth = 0,
00097                              char *name = NULL) const;
00098 
00100   virtual bool IsInside(const PointType & point,
00101                         unsigned int depth,
00102                         char *name) const;
00103 
00107   virtual bool IsInside(const PointType & point) const;
00108 
00111   virtual bool ComputeLocalBoundingBox() const;
00112 
00115   typename EllipseSpatialObject< TDimension >::Pointer GetEllipsoid() const;
00116 
00117 protected:
00118   GaussianSpatialObject(const Self &); //purposely not implemented
00119   void operator=(const Self &);        //purposely not implemented
00120 
00121   GaussianSpatialObject(void);
00122   ~GaussianSpatialObject(void);
00123 
00124   ScalarType m_Maximum;
00125   ScalarType m_Radius;
00126   ScalarType m_Sigma;
00127 
00129   virtual void PrintSelf(std::ostream & os, Indent indent) const;
00130 };
00131 } // end namespace itk
00132 
00133 #ifndef ITK_MANUAL_INSTANTIATION
00134 #include "itkGaussianSpatialObject.hxx"
00135 #endif
00136 
00137 #endif // __itkGaussianSpatialObject_h
00138