Skip to content

Libs/Optimize/ProcrustesRegistration.h

Namespaces

Name
shapeworks
User usage reporting (telemetry)

Classes

Name
class shapeworks::ProcrustesRegistration

Source code

```cpp

pragma once

include "ParticleSystem.h"

include "Procrustes3D.h"

include "vnl/vnl_matrix.h"

namespace shapeworks { class ProcrustesRegistration { public: using Pointer = std::shared_ptr;

// Particle system typedefs using ParticleSystemType = ParticleSystem; using PointType = ParticleSystemType::PointType;

void SetParticleSystem(ParticleSystemType p) { m_ParticleSystem = p; } ParticleSystemType GetParticleSystem() const { return m_ParticleSystem; } ParticleSystemType* GetParticleSystem() { return m_ParticleSystem; }

void RunRegistration(int i); void RunRegistration();

void SetDomainsPerShape(int i) { m_DomainsPerShape = i; } int GetDomainsPerShape() const { return m_DomainsPerShape; }

bool GetScaling() const { return m_Scaling; } void SetScaling(bool scaling) { m_Scaling = scaling; }

bool GetRotationTranslation() const { return m_RotationTranslation; } void SetRotationTranslation(bool rotationTranslation) { m_RotationTranslation = rotationTranslation; }

private: void RunGPARegistration(int domainStart, int numShapes, int numPoints);

void RunFixedDomainRegistration(int domainStart, int numShapes, int numPoints, const std::vector& is_fixed);

Procrustes3D::ShapeType ExtractShape(int domain_index, int num_points, bool fully_transformed = false);

int m_DomainsPerShape = 1; bool m_Scaling = true; bool m_RotationTranslation = true; ParticleSystemType* m_ParticleSystem = nullptr;

// Cache for fixed domain alignment optimization. // When fixed domains are present, the mean of fixed shapes is computed once // (via GPA on fixed shapes only) and cached. Non-fixed shapes are then // aligned to this cached mean using OPA, avoiding full GPA on all shapes. struct FixedDomainCache { Procrustes3D::ShapeType mean; // Mean of aligned fixed shapes (centered at origin) int num_points = 0; // Particle count when cache was built bool valid = false; }; std::vector m_FixedDomainCaches; };

} // namespace shapeworks ```


Updated on 2026-03-31 at 16:02:11 +0000