Shapeworks Studio  2.1
Shape analysis software suite
List of all members | Public Types | Public Member Functions | Protected Member Functions
itk::PSMImageDomainWithGradients< T, VDimension > Class Template Reference

#include <itkPSMImageDomainWithGradients.h>

+ Inheritance diagram for itk::PSMImageDomainWithGradients< T, VDimension >:
+ Collaboration diagram for itk::PSMImageDomainWithGradients< T, VDimension >:

Public Types

typedef PSMImageDomainWithGradients Self
 
typedef PSMImageDomain< T, VDimension > Superclass
 
typedef SmartPointer< SelfPointer
 
typedef SmartPointer< const SelfConstPointer
 
typedef WeakPointer< const SelfConstWeakPointer
 
typedef Superclass::PointType PointType
 
typedef Superclass::ImageType ImageType
 
typedef Superclass::ScalarInterpolatorType ScalarInterpolatorType
 
typedef GradientImageFilter< ImageTypeGradientImageFilterType
 
typedef GradientImageFilterType::OutputImageType GradientImageType
 
typedef VectorLinearInterpolateImageFunction< GradientImageType, typename PointType::CoordRepType > GradientInterpolatorType
 
typedef FixedArray< T, VDimension > VectorType
 
typedef vnl_vector_fixed< T, VDimension > VnlVectorType
 
- Public Types inherited from itk::PSMImageDomain< T, VDimension >
typedef PSMImageDomain Self
 
typedef PSMRegionDomain< VDimension > Superclass
 
typedef SmartPointer< SelfPointer
 
typedef SmartPointer< const SelfConstPointer
 
typedef WeakPointer< const SelfConstWeakPointer
 
typedef Image< T, VDimension > ImageType
 
typedef Superclass::PointType PointType
 
typedef LinearInterpolateImageFunction< ImageType, typename PointType::CoordRepType > ScalarInterpolatorType
 
- Public Types inherited from itk::PSMRegionDomain< VDimension >
typedef PSMRegionDomain Self
 
typedef PSMDomain< VDimension > Superclass
 
typedef SmartPointer< SelfPointer
 
typedef SmartPointer< const SelfConstPointer
 
typedef WeakPointer< const SelfConstWeakPointer
 
typedef Point< double, VDimension > PointType
 
- Public Types inherited from itk::PSMDomain< VDimension >
typedef PSMDomain Self
 
typedef DataObject Superclass
 
typedef SmartPointer< SelfPointer
 
typedef SmartPointer< const SelfConstPointer
 
typedef WeakPointer< const SelfConstWeakPointer
 
typedef Point< double, VDimension > PointType
 

Public Member Functions

 itkNewMacro (Self)
 
 itkTypeMacro (PSMImageDomainWithGradients, PSMImageDomain)
 
 itkStaticConstMacro (Dimension, unsigned int, VDimension)
 
void SetImage (ImageType *I)
 
 itkGetObjectMacro (GradientImage, GradientImageType)
 
VectorType SampleGradient (const PointType &p) const
 
VnlVectorType SampleGradientVnl (const PointType &p) const
 
VnlVectorType SampleNormalVnl (const PointType &p, T epsilon=1.0e-5) const
 
 itkGetObjectMacro (GradientInterpolator, GradientInterpolatorType)
 
virtual bool ApplyVectorConstraints (vnl_vector_fixed< double, VDimension > &gradE, const PointType &pos, double) const
 
- Public Member Functions inherited from itk::PSMImageDomain< T, VDimension >
 itkNewMacro (Self)
 
 itkTypeMacro (PSMImageDomain, PSMRegionDomain)
 
 itkStaticConstMacro (Dimension, unsigned int, VDimension)
 
void SetImage (ImageType *I)
 
 itkGetObjectMacro (Image, ImageType)
 
 itkGetConstObjectMacro (Image, ImageType)
 
Sample (const PointType &p) const
 
bool IsInsideBuffer (const PointType &p) const
 
 itkGetObjectMacro (ScalarInterpolator, ScalarInterpolatorType)
 
- Public Member Functions inherited from itk::PSMRegionDomain< VDimension >
 itkNewMacro (Self)
 
 itkTypeMacro (PSMRegionDomain, PSMDomain)
 
 itkStaticConstMacro (Dimension, unsigned int, VDimension)
 
virtual bool ApplyConstraints (PointType &p) const
 
 itkSetMacro (LowerBound, PointType)
 
 itkSetMacro (UpperBound, PointType)
 
virtual const PointTypeGetUpperBound () const
 
virtual const PointTypeGetLowerBound () const
 
void SetRegion (const PointType &l, const PointType &u)
 
- Public Member Functions inherited from itk::PSMDomain< VDimension >
 itkNewMacro (Self)
 
 itkTypeMacro (PSMDomain, DataObject)
 
 itkStaticConstMacro (Dimension, unsigned int, VDimension)
 
virtual double Distance (const PointType &a, const PointType &b) const
 
void DisableConstraints ()
 
void EnableConstraints ()
 
bool GetConstraintsEnabled () const
 
void SetConstraintsEnabled (bool g)
 

Protected Member Functions

void PrintSelf (std::ostream &os, Indent indent) const
 
- Protected Member Functions inherited from itk::PSMImageDomain< T, VDimension >
void PrintSelf (std::ostream &os, Indent indent) const
 
- Protected Member Functions inherited from itk::PSMRegionDomain< VDimension >
void PrintSelf (std::ostream &os, Indent indent) const
 
- Protected Member Functions inherited from itk::PSMDomain< VDimension >
void PrintSelf (std::ostream &os, Indent indent) const
 

Additional Inherited Members

- Protected Attributes inherited from itk::PSMDomain< VDimension >
bool m_ConstraintsEnabled
 

Detailed Description

template<class T, unsigned int VDimension>
class itk::PSMImageDomainWithGradients< T, VDimension >

An image domain that extends PSMImageDomainWithGradients with image gradient information. Gradient values are interpolated with the SampleGradients(point) method.

See also
PSMImageDomain
ParticleClipRegionDomain
PSMDomain

Definition at line 41 of file itkPSMImageDomainWithGradients.h.

Member Typedef Documentation

template<class T, unsigned int VDimension>
typedef Superclass::PointType itk::PSMImageDomainWithGradients< T, VDimension >::PointType

Point type of the domain (not necessarily of the image).

Definition at line 52 of file itkPSMImageDomainWithGradients.h.

template<class T, unsigned int VDimension>
typedef PSMImageDomainWithGradients itk::PSMImageDomainWithGradients< T, VDimension >::Self

Standard class typedefs

Definition at line 45 of file itkPSMImageDomainWithGradients.h.

Member Function Documentation

template<class T, unsigned int VDimension>
virtual bool itk::PSMImageDomainWithGradients< T, VDimension >::ApplyVectorConstraints ( vnl_vector_fixed< double, VDimension > &  gradE,
const PointType pos,
double   
) const
inlinevirtual

This method is called by an optimizer after a call to Evaluate and may be used to apply any constraints the resulting vector, such as a projection to the surface tangent plane. Returns true if the gradient was modified.

Reimplemented in itk::PSMImplicitSurfaceDomain< T, VDimension >.

Definition at line 114 of file itkPSMImageDomainWithGradients.h.

118  {
119  if (this->m_ConstraintsEnabled == true)
120  {
121  const double epsilon = 1.0e-10;
122 
123  double dotprod = 0.0;
124  VnlVectorType normal = this->SampleNormalVnl(pos, epsilon);
125  for (unsigned int i = 0; i < VDimension; i++) { dotprod += normal[i] * gradE[i]; }
126  for (unsigned int i = 0; i < VDimension; i++) { gradE[i] -= normal[i] * dotprod; }
127 
128  return true;
129  }
130  else return false;
131  }
template<class T, unsigned int VDimension>
itk::PSMImageDomainWithGradients< T, VDimension >::itkGetObjectMacro ( GradientInterpolator  ,
GradientInterpolatorType   
)

Allow public access to the scalar interpolator.

template<class T, unsigned int VDimension>
itk::PSMImageDomainWithGradients< T, VDimension >::itkNewMacro ( Self  )

Method for creation through the object factory.

template<class T, unsigned int VDimension>
itk::PSMImageDomainWithGradients< T, VDimension >::itkStaticConstMacro ( Dimension  ,
unsigned  int,
VDimension   
)

Dimensionality of the domain of the particle system.

template<class T, unsigned int VDimension>
itk::PSMImageDomainWithGradients< T, VDimension >::itkTypeMacro ( PSMImageDomainWithGradients< T, VDimension >  ,
PSMImageDomain   
)

Run-time type information (and related methods).

template<class T, unsigned int VDimension>
VectorType itk::PSMImageDomainWithGradients< T, VDimension >::SampleGradient ( const PointType p) const
inline

Sample the image at a point. This method performs no bounds checking. To check bounds, use IsInsideBuffer. SampleGradientsVnl returns a vnl vector of length VDimension instead of an itk::CovariantVector (itk::FixedArray).

Definition at line 95 of file itkPSMImageDomainWithGradients.h.

96  { return m_GradientInterpolator->Evaluate(p); }
template<class T, unsigned int VDimension>
void itk::PSMImageDomainWithGradients< T, VDimension >::SetImage ( ImageType I)
inline

Set/Get the itk::Image specifying the particle domain. The set method modifies the parent class LowerBound and UpperBound.

Definition at line 75 of file itkPSMImageDomainWithGradients.h.

76  {
78 
79  // Compute gradient image and set up gradient interpolation.
80  typename GradientImageFilterType::Pointer filter = GradientImageFilterType::New();
81  filter->SetInput(I);
82  filter->SetUseImageSpacingOn();
83  filter->Update();
84  m_GradientImage = filter->GetOutput();
85 
86  m_GradientInterpolator->SetInputImage(m_GradientImage);
87  }
void SetImage(ImageType *I)

The documentation for this class was generated from the following file: