Shapeworks Studio
2.1
Shape analysis software suite
|
A facade class that manages interactions with a particle system. More...
#include <itkPSMParticleSystem.h>
Public Types | |
typedef PSMParticleSystem | Self |
typedef DataObject | Superclass |
typedef SmartPointer< Self > | Pointer |
typedef SmartPointer< const Self > | ConstPointer |
typedef WeakPointer< const Self > | ConstWeakPointer |
typedef PSMDomain< VDimension > | DomainType |
typedef Point< double, VDimension > | PointType |
typedef PSMNeighborhood< VDimension > | NeighborhoodType |
typedef PSMContainer< PointType > | PointContainerType |
typedef NeighborhoodType::PointVectorType | PointVectorType |
typedef vnl_matrix_fixed< double, VDimension+1, VDimension+1 > | TransformType |
typedef vnl_vector_fixed< double, VDimension > | VectorType |
Public Member Functions | |
itkNewMacro (Self) | |
itkTypeMacro (PSMParticleSystem, DataObject) | |
itkStaticConstMacro (Dimension, unsigned int, VDimension) | |
void | RegisterAttribute (PSMAttribute< VDimension > *) |
void | SynchronizePositions () |
unsigned long int | GetNumberOfParticles (unsigned int d=0) const |
const PointType & | AddPosition (const PointType &, unsigned int d=0, int threadId=0) |
const PointType & | SetPosition (const PointType &, unsigned long int k, unsigned int d=0, int threadId=0) |
void | RemovePosition (unsigned long int k, unsigned int d=0, int threadId=0) |
PointType & | GetPosition (unsigned long int k, unsigned int d=0) |
const PointType & | GetPosition (unsigned long int k, unsigned int d=0) const |
PointType | GetTransformedPosition (unsigned long int k, unsigned int d=0) const |
void | SplitAllParticles (double epsilon, int threadId=0) |
void | SplitAllParticlesInDomain (const vnl_vector_fixed< double, VDimension > &, double epsilon, unsigned int d=0, int threadId=0) |
void | SplitParticle (double epsilon, unsigned int idx, unsigned int d=0, int threadId=0) |
void | SetNeighborhood (unsigned int, NeighborhoodType *, int threadId=0) |
void | SetNeighborhood (NeighborhoodType *n, int threadId=0) |
NeighborhoodType::ConstPointer | GetNeighborhood (unsigned int k) const |
PointVectorType | FindNeighborhoodPoints (const PointType &p, double r, unsigned int d=0) const |
PointVectorType | FindNeighborhoodPoints (const PointType &p, std::vector< double > &w, double r, unsigned int d=0) const |
PointVectorType | FindNeighborhoodPoints (unsigned int idx, double r, unsigned int d=0) const |
PointVectorType | FindNeighborhoodPoints (unsigned int idx, std::vector< double > &w, double r, unsigned int d=0) const |
void | AddDomain (DomainType *, int threadId=0) |
std::vector< typename DomainType::Pointer >::const_iterator | GetDomainsBegin () const |
std::vector< typename DomainType::Pointer >::const_iterator | GetDomainsEnd () const |
DomainType * | GetDomain (unsigned int i) |
DomainType * | GetDomain () |
const DomainType * | GetDomain (unsigned int i) const |
const DomainType * | GetDomain () const |
unsigned int | GetNumberOfDomains () const |
void | SetTransform (unsigned int i, const TransformType &, int threadId=0) |
void | SetTransform (const TransformType &p, int threadId=0) |
void | SetPrefixTransform (unsigned int i, const TransformType &, int threadId=0) |
void | SetPrefixTransform (const TransformType &p, int threadId=0) |
std::vector< TransformType >::const_iterator | GetTransformsBegin () const |
std::vector< TransformType >::const_iterator | GetTransformsEnd () const |
const TransformType & | GetTransform (unsigned int i) const |
const TransformType & | GetTransform () const |
TransformType | GetTransform (unsigned int i) |
TransformType | GetTransform () |
const TransformType & | GetPrefixTransform (unsigned int i) const |
const TransformType & | GetPrefixTransform () const |
TransformType | GetPrefixTransform (unsigned int i) |
TransformType | GetPrefixTransform () |
std::vector< TransformType >::const_iterator | GetInverseTransformsBegin () const |
std::vector< TransformType >::const_iterator | GetInverseTransformsEnd () const |
const TransformType & | GetInverseTransform (unsigned int i) const |
const TransformType & | GetInverseTransform () const |
const TransformType & | GetInversePrefixTransform (unsigned int i) const |
const TransformType & | GetInversePrefixTransform () const |
const std::vector< typename PointContainerType::Pointer > & | GetPositions () const |
const PointContainerType::Pointer & | GetPositions (unsigned int d) const |
void | AddPositionList (const std::vector< PointType > &, unsigned int d, int threadId=0) |
PointType | TransformPoint (const PointType &, const TransformType &) const |
VectorType | TransformVector (const VectorType &, const TransformType &) const |
TransformType | InvertTransform (const TransformType &T) const |
void | FlagDomain (unsigned int i) |
void | UnflagDomain (unsigned int i) |
bool | GetDomainFlag (unsigned int i) const |
const std::vector< bool > & | GetDomainFlags () const |
void | SetDomainFlags () |
void | ResetDomainFlags () |
void | SetFixedParticleFlag (unsigned int i) |
void | ResetFixedParticleFlag (unsigned int i) |
bool | GetFixedParticleFlag (unsigned int i) const |
void | ResetFixedParticleFlags () |
template<> | |
PSMParticleSystem< 3 >::PointType | TransformPoint (const PointType &p, const TransformType &T) const |
template<> | |
PSMParticleSystem< 2 >::PointType | TransformPoint (const PointType &p, const TransformType &T) const |
template<> | |
PSMParticleSystem< 3 >::VectorType | TransformVector (const VectorType &p, const TransformType &T) const |
template<> | |
PSMParticleSystem< 2 >::VectorType | TransformVector (const VectorType &p, const TransformType &T) const |
Protected Member Functions | |
void | PrintSelf (std::ostream &os, Indent indent) const |
void | SetNumberOfDomains (unsigned int) |
std::vector< typename DomainType::Pointer >::iterator | GetDomainsBegin () |
std::vector< typename DomainType::Pointer >::iterator | GetDomainsEnd () |
std::vector< TransformType >::iterator | GetTransformsBegin () |
std::vector< TransformType >::iterator | GetTransformsEnd () |
std::vector< TransformType >::iterator | GetInverseTransformsBegin () |
std::vector< TransformType >::iterator | GetInverseTransformsEnd () |
TransformType & | GetInverseTransform (unsigned int i) |
TransformType & | GetInverseTransform () |
TransformType & | GetInversePrefixTransform (unsigned int i) |
TransformType & | GetInversePrefixTransform () |
A facade class that manages interactions with a particle system.
A particle system consists of a set of particle locations and domains in which those locations are defined. For example, a particle system may simply be a set of points in 3D Euclidean space that are constrained to a specified bounding box. A more complex example is a set of 3D points constrained to a given surface. The itkPSMParticleSystem class is also designed to manage multiple sets of points across multiple domains. For example, one may create a system of dozens of point sets that are each defined in different spaces. The itkPSMParticleSystem class can also maintain a set of transformations associated with each domain that map that particular domain into another coordinate frame, for example, a common coordinate frame.
All operations on the particle system must happen through the interface of the PSMParticleSystem class.
Definition at line 68 of file itkPSMParticleSystem.h.
typedef PSMDomain<VDimension> itk::PSMParticleSystem< VDimension >::DomainType |
Define the base domain type.
Definition at line 88 of file itkPSMParticleSystem.h.
typedef PSMNeighborhood<VDimension> itk::PSMParticleSystem< VDimension >::NeighborhoodType |
Class used to compute neighborhoods of points. One is associated with each domain.
Definition at line 95 of file itkPSMParticleSystem.h.
typedef PSMContainer<PointType> itk::PSMParticleSystem< VDimension >::PointContainerType |
Point container type. One is associated with each domain.
Definition at line 98 of file itkPSMParticleSystem.h.
typedef Point<double, VDimension> itk::PSMParticleSystem< VDimension >::PointType |
Point type used to store particle locations.
Definition at line 91 of file itkPSMParticleSystem.h.
typedef PSMParticleSystem itk::PSMParticleSystem< VDimension >::Self |
Standard class typedefs
Definition at line 72 of file itkPSMParticleSystem.h.
typedef vnl_matrix_fixed<double, VDimension +1, VDimension +1> itk::PSMParticleSystem< VDimension >::TransformType |
Defines a transform class type. One is associated with each domain. Transforms are affine for simplicity.
Definition at line 104 of file itkPSMParticleSystem.h.
void itk::PSMParticleSystem< VDimension >::AddDomain | ( | DomainType * | input, |
int | threadId = 0 |
||
) |
Add a domain to the particle system. This method also allocates space for a list of positions that are contained within the domain, and a default neighborhood calculator. The final, optional argument indicates the calling thread id.
Definition at line 55 of file itkPSMParticleSystem.hxx.
const PSMParticleSystem< VDimension >::PointType & itk::PSMParticleSystem< VDimension >::AddPosition | ( | const PointType & | p, |
unsigned int | d = 0 , |
||
int | threadId = 0 |
||
) |
Add/Set/Remove a single particle position. The actual position added or set will be returned. If, for example, the domain imposes any constraints on this location (e.g. out-of-bounds, projection onto a surface), then the method returns the location after constraints are applied. Both the Add and Set methods require a domain index. If unspecified, the domain index is zero. The Set method requires a specific particle index. If the given index does not exist, an exception is thrown. Set is intended to be used for moving particles. The SetTransformedPosition sets the position using a Point transformed by the m_Transform associated with the given domain.
Definition at line 145 of file itkPSMParticleSystem.hxx.
void itk::PSMParticleSystem< VDimension >::AddPositionList | ( | const std::vector< PointType > & | p, |
unsigned int | d, | ||
int | threadId = 0 |
||
) |
Adds a list of points to the specified domain. The arguments are the std::vector of points and the domain number.
Definition at line 221 of file itkPSMParticleSystem.hxx.
|
inline |
Return the neighborhood of points with radius r around point p in domain k. This is just a convenience method to avoid exposing the underlying Neighborhood objects. FindTransformedNeighborhoodPoints returns the list with all points transformed by the transform associated with the given domain.
Definition at line 200 of file itkPSMParticleSystem.h.
|
inline |
Flag/Unflag a domain. Flagging a domain has different meanings according to the application using this particle system.
Definition at line 397 of file itkPSMParticleSystem.h.
|
inline |
Return the i'th domain object.
Definition at line 254 of file itkPSMParticleSystem.h.
|
inline |
API for the single domain case.
Definition at line 258 of file itkPSMParticleSystem.h.
|
inline |
Return the i'th domain object.
Definition at line 262 of file itkPSMParticleSystem.h.
|
inline |
API for the single domain case.
Definition at line 266 of file itkPSMParticleSystem.h.
|
inline |
Return an iterator that points to the first element of the list of the domains.
Definition at line 245 of file itkPSMParticleSystem.h.
|
inlineprotected |
Return an iterator that points to the first element of the list of the domains.
Definition at line 444 of file itkPSMParticleSystem.h.
|
inline |
Return an iterator that points one position past the last element of the list of the domains.
Definition at line 250 of file itkPSMParticleSystem.h.
|
inlineprotected |
Return an iterator that points one position past the last element of the list of the domains.
Definition at line 449 of file itkPSMParticleSystem.h.
|
inline |
Return the i'th transform object.
Definition at line 350 of file itkPSMParticleSystem.h.
|
inline |
API for the single transform case.
Definition at line 354 of file itkPSMParticleSystem.h.
|
inlineprotected |
Return the i'th transform object.
Definition at line 483 of file itkPSMParticleSystem.h.
|
inlineprotected |
API for the single transform case.
Definition at line 487 of file itkPSMParticleSystem.h.
|
inline |
Return the i'th transform object.
Definition at line 342 of file itkPSMParticleSystem.h.
|
inline |
API for the single transform case.
Definition at line 346 of file itkPSMParticleSystem.h.
|
inlineprotected |
Return the i'th transform object.
Definition at line 475 of file itkPSMParticleSystem.h.
|
inlineprotected |
API for the single transform case.
Definition at line 479 of file itkPSMParticleSystem.h.
|
inline |
Return an iterator that points to the first element of the list of the inverse transforms.
Definition at line 332 of file itkPSMParticleSystem.h.
|
inlineprotected |
Return an iterator that points to the first element of the list of the inverse transforms.
Definition at line 465 of file itkPSMParticleSystem.h.
|
inline |
Return an iterator that points one position past the last element of the list of the transforms.
Definition at line 338 of file itkPSMParticleSystem.h.
|
inlineprotected |
Return an iterator that points one position past the last element of the list of the transforms.
Definition at line 471 of file itkPSMParticleSystem.h.
|
inline |
Returns the number of domains contained in the particle system.
Definition at line 270 of file itkPSMParticleSystem.h.
|
inline |
Returns the number of particles in domain k.
Definition at line 136 of file itkPSMParticleSystem.h.
|
inline |
Return a position with index k from domain d. Note the order in which the 2 integers must be specified! The domain number is specified second and the position index within the domain is specified first. Note that the domain index may be omitted if the particle system only contains a single domain. GetTransformedPosition returns the position premultiplied by the transform matrix for the given domain.
Definition at line 169 of file itkPSMParticleSystem.h.
|
inline |
Return the array of particle positions.
Definition at line 358 of file itkPSMParticleSystem.h.
|
inline |
Return the i'th transform object.
Definition at line 314 of file itkPSMParticleSystem.h.
|
inline |
API for the single transform case.
Definition at line 318 of file itkPSMParticleSystem.h.
|
inline |
Return the i'th transform object.
Definition at line 322 of file itkPSMParticleSystem.h.
|
inline |
API for the single transform case.
Definition at line 326 of file itkPSMParticleSystem.h.
|
inline |
Return the i'th transform object.
Definition at line 298 of file itkPSMParticleSystem.h.
|
inline |
API for the single transform case.
Definition at line 302 of file itkPSMParticleSystem.h.
|
inline |
Return the i'th transform object.
Definition at line 306 of file itkPSMParticleSystem.h.
|
inline |
API for the single transform case.
Definition at line 310 of file itkPSMParticleSystem.h.
|
inline |
Return an iterator that points to the first element of the list of the transforms.
Definition at line 290 of file itkPSMParticleSystem.h.
|
inlineprotected |
Return an iterator that points to the first element of the list of the transforms.
Definition at line 454 of file itkPSMParticleSystem.h.
|
inline |
Return an iterator that points one position past the last element of the list of the transforms.
Definition at line 295 of file itkPSMParticleSystem.h.
|
inlineprotected |
Return an iterator that points one position past the last element of the list of the transforms.
Definition at line 459 of file itkPSMParticleSystem.h.
|
inline |
Returns the inverse of a transformation matrix.
Definition at line 377 of file itkPSMParticleSystem.h.
itk::PSMParticleSystem< VDimension >::itkNewMacro | ( | Self | ) |
Method for creation through the object factory.
itk::PSMParticleSystem< VDimension >::itkStaticConstMacro | ( | Dimension | , |
unsigned | int, | ||
VDimension | |||
) |
Dimensionality of the domain of the particle system.
itk::PSMParticleSystem< VDimension >::itkTypeMacro | ( | PSMParticleSystem< VDimension > | , |
DataObject | |||
) |
Run-time type information (and related methods).
void itk::PSMParticleSystem< VDimension >::RegisterAttribute | ( | PSMAttribute< VDimension > * | attr | ) |
Register an attribute object with this particle system. This action adds the attribute object as an observer for the particle system so that it will receive published updates. For example, a gradient attribute object may need to know when particle positions have changed so that it can update its internal state appropriately (e.g. precompute a gradient that corresponds to the new particle position). Internally, this method manages registering the appropriate itk::Command and itk::Object as an observer of this itk::Object (AddObserver). Relevant state information is passed to objects in particle events.
Definition at line 310 of file itkPSMParticleSystem.hxx.
|
inline |
The following methods provide functionality for specifying particle indices that are fixed landmarks. SetPosition() calls to these particle indices will silently fail. For simplicity, only one list of indices is maintained for all dimensions. If particle index n is flagged, for example, then particle index n in all domains is fixed.
Definition at line 418 of file itkPSMParticleSystem.h.
void itk::PSMParticleSystem< VDimension >::SetNeighborhood | ( | unsigned int | i, |
NeighborhoodType * | N, | ||
int | threadId = 0 |
||
) |
Set/Get the neighborhood object associated with domain k.
Definition at line 130 of file itkPSMParticleSystem.hxx.
|
protected |
Set the number of domains. This method modifies the size of the m_Domains, m_Positions, and m_Transform lists.
Definition at line 35 of file itkPSMParticleSystem.hxx.
void itk::PSMParticleSystem< VDimension >::SetTransform | ( | unsigned int | i, |
const TransformType & | T, | ||
int | threadId = 0 |
||
) |
Set the transform associated with domain i. This method will also compute and set the corresponding inverse transform if possible. If the inverse transform cannot be computed, the exception is quietly handled by this method and an identity transform is set in its place. The calling program is responsible for knowing when an inverse transform cannot be computed.
Definition at line 102 of file itkPSMParticleSystem.hxx.
void itk::PSMParticleSystem< VDimension >::SplitAllParticles | ( | double | epsilon, |
int | threadId = 0 |
||
) |
Doubles the number of particles of the system by splitting each particle into 2 particles. Each new particle position is added to the system at a random epsilon distance on the surface from the original particle. The new particles are added using the AddPosition method, so all appropriate callbacks are invoked.
Definition at line 288 of file itkPSMParticleSystem.hxx.
|
inline |
Invokes the set event on all particle positions, resetting them to their current value. This method may be called to synchronize positional information among various observers which may have gone out of sync.
Definition at line 124 of file itkPSMParticleSystem.h.
PSMParticleSystem< 3 >::PointType itk::PSMParticleSystem< 3 >::TransformPoint | ( | const PointType & | p, |
const TransformType & | T | ||
) | const |
For efficiency, we specialize for 3D and 2D
Definition at line 26 of file itkPSMParticleSystem.cxx.
PSMParticleSystem< 2 >::PointType itk::PSMParticleSystem< 2 >::TransformPoint | ( | const PointType & | p, |
const TransformType & | T | ||
) | const |
For efficiency, we specialize for 3D and 2D
Definition at line 41 of file itkPSMParticleSystem.cxx.
PointType itk::PSMParticleSystem< VDimension >::TransformPoint | ( | const PointType & | , |
const TransformType & | |||
) | const |
Transforms a point using the given transform. NOTE: Scaling is not currently implemented. (This method may be converted to virtual and overridden if tranform type is generalized.)
PSMParticleSystem< 3 >::VectorType itk::PSMParticleSystem< 3 >::TransformVector | ( | const VectorType & | p, |
const TransformType & | T | ||
) | const |
For efficiency, we specialize for 3D and 2D
Definition at line 56 of file itkPSMParticleSystem.cxx.
PSMParticleSystem< 2 >::VectorType itk::PSMParticleSystem< 2 >::TransformVector | ( | const VectorType & | p, |
const TransformType & | T | ||
) | const |
For efficiency, we specialize for 3D and 2D
Definition at line 71 of file itkPSMParticleSystem.cxx.
VectorType itk::PSMParticleSystem< VDimension >::TransformVector | ( | const VectorType & | , |
const TransformType & | |||
) | const |
Transforms a vector using the given transform. Only the rotational part of the transform is applied. NOTE: Scaling is not currently supported.