Skip to content

shapeworks::ParticleDomain

Inherited by shapeworks::ContourDomain, shapeworks::MeshDomain, shapeworks::ParticleRegionDomain

Public Types

Name
typedef std::shared_ptr< ParticleDomain > Pointer
using itk::Point< double, 3 > PointType
using vnl_matrix_fixed< float, 3, 3 > GradNType
using vnl_vector_fixed< double, 3 > VectorDoubleType
using vnl_vector_fixed< float, 3 > VectorFloatType

Public Functions

Name
virtual bool ApplyConstraints(PointType & p, int idx, bool dbg =false) const =0
virtual PointType UpdateParticlePosition(const PointType & point, int idx, VectorDoubleType & update) const =0
virtual void InvalidateParticlePosition(int idx) const
virtual VectorDoubleType ProjectVectorToSurfaceTangent(VectorDoubleType & gradE, const PointType & pos, int idx) const =0
virtual VectorFloatType SampleGradientAtPoint(const PointType & point, int idx) const =0
virtual VectorFloatType SampleNormalAtPoint(const PointType & point, int idx) const =0
virtual GradNType SampleGradNAtPoint(const PointType & p, int idx) const =0
virtual double Distance(const PointType & a, int idx_a, const PointType & b, int idx_b, VectorDoubleType * out_grad =nullptr) const
virtual double SquaredDistance(const PointType & a, int idx_a, const PointType & b, int idx_b) const
virtual bool IsWithinDistance(const PointType & a, int idx_a, const PointType & b, int idx_b, double test_dist, double & distance) const
virtual double GetCurvature(const PointType & p, int idx) const =0
virtual double GetSurfaceMeanCurvature() const =0
virtual double GetSurfaceStdDevCurvature() const =0
virtual const PointType & GetLowerBound() const =0
virtual const PointType & GetUpperBound() const =0
virtual PointType GetZeroCrossingPoint() const =0
virtual double GetSurfaceArea() const =0
virtual PointType GetValidLocationNear(PointType p) const =0
virtual double GetMaxDiameter() const =0
virtual void DeleteImages() =0
virtual void DeletePartialDerivativeImages() =0
virtual void UpdateZeroCrossingPoint() =0
bool IsDomainFixed() const
virtual shapeworks::DomainType GetDomainType() const =0
std::shared_ptr< shapeworks::Constraints > GetConstraints() const
virtual PointType GetPositionAfterSplit(const PointType & pt, const VectorDoubleType & local_direction, const VectorDoubleType & global_direction, double epsilon) const
void SetDomainID(int id)
void SetDomainName(std::string name)

Protected Functions

Name
ParticleDomain()
virtual ~ParticleDomain()

Protected Attributes

Name
bool m_FixedDomain
int m_DomainID
std::string m_DomainName
std::shared_ptr< shapeworks::Constraints > constraints

Public Types Documentation

typedef Pointer

typedef std::shared_ptr<ParticleDomain> shapeworks::ParticleDomain::Pointer;

using PointType

using shapeworks::ParticleDomain::PointType =  itk::Point<double, 3>;

Point type used to store particle locations.

using GradNType

using shapeworks::ParticleDomain::GradNType =  vnl_matrix_fixed<float, 3, 3>;

using VectorDoubleType

using shapeworks::ParticleDomain::VectorDoubleType =  vnl_vector_fixed<double, 3>;

using VectorFloatType

using shapeworks::ParticleDomain::VectorFloatType =  vnl_vector_fixed<float, 3>;

Public Functions Documentation

function ApplyConstraints

virtual bool ApplyConstraints(
    PointType & p,
    int idx,
    bool dbg =false
) const =0

Reimplemented by: shapeworks::ContourDomain::ApplyConstraints, shapeworks::ImplicitSurfaceDomain::ApplyConstraints, shapeworks::MeshDomain::ApplyConstraints

Apply any constraints to the given point location. This should force the point to a position on the surface that satisfies all constraints.

function UpdateParticlePosition

virtual PointType UpdateParticlePosition(
    const PointType & point,
    int idx,
    VectorDoubleType & update
) const =0

Reimplemented by: shapeworks::ContourDomain::UpdateParticlePosition, shapeworks::MeshDomain::UpdateParticlePosition

Applies the update to the point and returns the new point position.

function InvalidateParticlePosition

inline virtual void InvalidateParticlePosition(
    int idx
) const

Reimplemented by: shapeworks::ContourDomain::InvalidateParticlePosition, shapeworks::MeshDomain::InvalidateParticlePosition

function ProjectVectorToSurfaceTangent

virtual VectorDoubleType ProjectVectorToSurfaceTangent(
    VectorDoubleType & gradE,
    const PointType & pos,
    int idx
) const =0

Reimplemented by: shapeworks::ContourDomain::ProjectVectorToSurfaceTangent, shapeworks::MeshDomain::ProjectVectorToSurfaceTangent

Projects the vector to the surface tangent at the point.

function SampleGradientAtPoint

virtual VectorFloatType SampleGradientAtPoint(
    const PointType & point,
    int idx
) const =0

Reimplemented by: shapeworks::ImageDomainWithGradients::SampleGradientAtPoint, shapeworks::ContourDomain::SampleGradientAtPoint, shapeworks::MeshDomain::SampleGradientAtPoint

function SampleNormalAtPoint

virtual VectorFloatType SampleNormalAtPoint(
    const PointType & point,
    int idx
) const =0

Reimplemented by: shapeworks::ImageDomainWithGradients::SampleNormalAtPoint, shapeworks::ContourDomain::SampleNormalAtPoint, shapeworks::MeshDomain::SampleNormalAtPoint

function SampleGradNAtPoint

virtual GradNType SampleGradNAtPoint(
    const PointType & p,
    int idx
) const =0

Reimplemented by: shapeworks::ContourDomain::SampleGradNAtPoint, shapeworks::ImageDomainWithGradN::SampleGradNAtPoint, shapeworks::MeshDomain::SampleGradNAtPoint

function Distance

inline virtual double Distance(
    const PointType & a,
    int idx_a,
    const PointType & b,
    int idx_b,
    VectorDoubleType * out_grad =nullptr
) const

Reimplemented by: shapeworks::ContourDomain::Distance

Distance between locations is used for computing energy and neighborhoods. Optionally return the gradient of the distance

function SquaredDistance

inline virtual double SquaredDistance(
    const PointType & a,
    int idx_a,
    const PointType & b,
    int idx_b
) const

Reimplemented by: shapeworks::ContourDomain::SquaredDistance, shapeworks::MeshDomain::SquaredDistance

Squared Distance between locations is used for computing sigma.

function IsWithinDistance

inline virtual bool IsWithinDistance(
    const PointType & a,
    int idx_a,
    const PointType & b,
    int idx_b,
    double test_dist,
    double & distance
) const

Reimplemented by: shapeworks::MeshDomain::IsWithinDistance

Returns whether or not the two points are separated by the given distance

function GetCurvature

virtual double GetCurvature(
    const PointType & p,
    int idx
) const =0

Reimplemented by: shapeworks::ContourDomain::GetCurvature, shapeworks::ImageDomainWithCurvature::GetCurvature, shapeworks::MeshDomain::GetCurvature

Used in ParticleMeanCurvatureAttribute

function GetSurfaceMeanCurvature

virtual double GetSurfaceMeanCurvature() const =0

Reimplemented by: shapeworks::ContourDomain::GetSurfaceMeanCurvature, shapeworks::ImageDomainWithCurvature::GetSurfaceMeanCurvature, shapeworks::MeshDomain::GetSurfaceMeanCurvature

Used in ParticleMeanCurvatureAttribute

function GetSurfaceStdDevCurvature

virtual double GetSurfaceStdDevCurvature() const =0

Reimplemented by: shapeworks::ContourDomain::GetSurfaceStdDevCurvature, shapeworks::ImageDomainWithCurvature::GetSurfaceStdDevCurvature, shapeworks::MeshDomain::GetSurfaceStdDevCurvature

Used in ParticleMeanCurvatureAttribute

function GetLowerBound

virtual const PointType & GetLowerBound() const =0

Reimplemented by: shapeworks::ParticleRegionDomain::GetLowerBound, shapeworks::ContourDomain::GetLowerBound, shapeworks::MeshDomain::GetLowerBound

Gets the minimum x, y, z values of the bounding box for the domain. This is used for setting up the PowerOfTwoPointTree.

function GetUpperBound

virtual const PointType & GetUpperBound() const =0

Reimplemented by: shapeworks::ParticleRegionDomain::GetUpperBound, shapeworks::ContourDomain::GetUpperBound, shapeworks::MeshDomain::GetUpperBound

Gets the maximum x, y, z values of the bounding box for the domain. This is used for setting up the PowerOfTwoPointTree.

function GetZeroCrossingPoint

virtual PointType GetZeroCrossingPoint() const =0

Reimplemented by: shapeworks::ContourDomain::GetZeroCrossingPoint, shapeworks::ImplicitSurfaceDomain::GetZeroCrossingPoint, shapeworks::MeshDomain::GetZeroCrossingPoint

Get any valid point on the domain. This is used to place the first particle.

function GetSurfaceArea

virtual double GetSurfaceArea() const =0

Reimplemented by: shapeworks::ContourDomain::GetSurfaceArea, shapeworks::ImageDomain::GetSurfaceArea, shapeworks::MeshDomain::GetSurfaceArea

Use for neighborhood radius.

function GetValidLocationNear

virtual PointType GetValidLocationNear(
    PointType p
) const =0

Reimplemented by: shapeworks::ContourDomain::GetValidLocationNear, shapeworks::ImageDomain::GetValidLocationNear, shapeworks::MeshDomain::GetValidLocationNear

GetValidLocation returns a PointType location on the surface. Used for placing the first particle.

function GetMaxDiameter

virtual double GetMaxDiameter() const =0

Reimplemented by: shapeworks::ContourDomain::GetMaxDiameter, shapeworks::ImageDomain::GetMaxDiameter, shapeworks::MeshDomain::GetMaxDiameter

GetMaxDiameter returns the maximum diameter of the domain and is used for computing sigma

function DeleteImages

virtual void DeleteImages() =0

Reimplemented by: shapeworks::ContourDomain::DeleteImages, shapeworks::ImageDomain::DeleteImages, shapeworks::ImageDomainWithGradients::DeleteImages, shapeworks::ImageDomainWithGradN::DeleteImages, shapeworks::MeshDomain::DeleteImages

function DeletePartialDerivativeImages

virtual void DeletePartialDerivativeImages() =0

Reimplemented by: shapeworks::ContourDomain::DeletePartialDerivativeImages, shapeworks::ImageDomainWithGradN::DeletePartialDerivativeImages, shapeworks::MeshDomain::DeletePartialDerivativeImages

function UpdateZeroCrossingPoint

virtual void UpdateZeroCrossingPoint() =0

Reimplemented by: shapeworks::ContourDomain::UpdateZeroCrossingPoint, shapeworks::ImageDomain::UpdateZeroCrossingPoint, shapeworks::MeshDomain::UpdateZeroCrossingPoint

function IsDomainFixed

inline bool IsDomainFixed() const

function GetDomainType

virtual shapeworks::DomainType GetDomainType() const =0

Reimplemented by: shapeworks::ContourDomain::GetDomainType, shapeworks::ImplicitSurfaceDomain::GetDomainType, shapeworks::MeshDomain::GetDomainType

function GetConstraints

inline std::shared_ptr< shapeworks::Constraints > GetConstraints() const

function GetPositionAfterSplit

inline virtual PointType GetPositionAfterSplit(
    const PointType & pt,
    const VectorDoubleType & local_direction,
    const VectorDoubleType & global_direction,
    double epsilon
) const

Reimplemented by: shapeworks::ContourDomain::GetPositionAfterSplit

function SetDomainID

inline void SetDomainID(
    int id
)

function SetDomainName

inline void SetDomainName(
    std::string name
)

Protected Functions Documentation

function ParticleDomain

inline ParticleDomain()

function ~ParticleDomain

inline virtual ~ParticleDomain()

Protected Attributes Documentation

variable m_FixedDomain

bool m_FixedDomain {true};

variable m_DomainID

int m_DomainID {-1};

variable m_DomainName

std::string m_DomainName;

variable constraints

std::shared_ptr< shapeworks::Constraints > constraints;

Updated on 2024-03-17 at 12:58:44 -0600