ImFusion C++ SDK 4.4.0
ImFusion::ASCDeformation Class Reference

#include <AnatomyPlugin/include/ImFusion/AnatomyPlugin/ASCDeformation.h>

Class for representing "deformations" over an AnatomicalStructureCollection. More...

Detailed Description

Class for representing "deformations" over an AnatomicalStructureCollection.

Such a deformation comprises a linear transformation (rotation, translation, scaling), together with a set of AnatomicalStructureDeformation objects to be applied to child structures.

Classes

struct  ASCorrespondence
 Helper struct to track correspondences between anatomical structures in two AnatomicalStructureCollections. More...

Public Member Functions

 ASCDeformation (const ScaledIso3 &linearPart)
 Initialize an ASCDeformation with the given linear part.
 ASCDeformation (const AnatomicalStructureCollection &fixed, const AnatomicalStructureCollection &moving, bool rigid, bool ignoreNonContributing=false)
 Initialize an ASCDeformation that maps moving to fixed.
void setLinearPartIdentity ()
 Sets the linear part to the identity transformation.
void factorOutCommonLinearPart (bool preserveTotalTransformation=true, bool rigid=false, const AnatomicalStructureCollection *asc=nullptr)
 Factors out the a common global linear transformation the children AnatomicalStructureDeformation objects.
void clean (double tolerance=1.0e-6)
 Calls clean() on individual m_deformations objects and removes those that are equal to the identity.
void moveScaleToChildren ()
 Moves the "scale" part of the global transformation to the children AnatomicalStructureDeformation objects.
ScaledIso3linearPart ()
const ScaledIso3linearPart () const
std::map< std::string, AnatomicalStructureDeformation > & deformations ()
const std::map< std::string, AnatomicalStructureDeformation > & deformations () const
bool isEqualToLinearPart (double tolerance=1.0e-6) const

Static Public Member Functions

static std::vector< ASCorrespondencegetCorrespondingStructures (const AnatomicalStructureCollection &first, const AnatomicalStructureCollection &second, bool allowMissing)
 Helper function to get indexes of corresponding anatomical structures from the fixed, moving.

Static Public Attributes

static constexpr const char * frozenString = "_frozen"
 Specifies how individual structures should be transformed by an ASCDeformation.
static constexpr const char * contributesToRegistrationString = "_contributesToRegistration"
 Specifies how individual structures should be transformed by an ASCDeformation.

Constructor & Destructor Documentation

◆ ASCDeformation()

ImFusion::ASCDeformation::ASCDeformation ( const AnatomicalStructureCollection & fixed,
const AnatomicalStructureCollection & moving,
bool rigid,
bool ignoreNonContributing = false )

Initialize an ASCDeformation that maps moving to fixed.

Assumes that such a deformation exists, i.e. fixed and moving must have compatible objects. For example, meshes/pointclouds/graphs must have the same number of vertices and connectivity. A typical use case is to start with fixed, clone it into moving, manipulate vertices in moving, and then call this constructor.

Parameters
ignoreNonContributing- if set, this function will ignore structures that have the contributesToRegistrationString attribute set to Free.

Member Function Documentation

◆ getCorrespondingStructures()

std::vector< ASCorrespondence > ImFusion::ASCDeformation::getCorrespondingStructures ( const AnatomicalStructureCollection & first,
const AnatomicalStructureCollection & second,
bool allowMissing )
static

Helper function to get indexes of corresponding anatomical structures from the fixed, moving.

In cases where the contained anatomical structures have unique indexes, this is straightforward.

Returns
a vector of pairs, where each pair contains the index of the anatomical structure in first and the index of the corresponding anatomical structure in second.
Parameters
allowMissing- if true, indices without correspondences in second are added with index -1 in the second part.

◆ factorOutCommonLinearPart()

void ImFusion::ASCDeformation::factorOutCommonLinearPart ( bool preserveTotalTransformation = true,
bool rigid = false,
const AnatomicalStructureCollection * asc = nullptr )

Factors out the a common global linear transformation the children AnatomicalStructureDeformation objects.

If from is specified, keypoints from it are used to compute a "best-fit" global transformation.

◆ moveScaleToChildren()

void ImFusion::ASCDeformation::moveScaleToChildren ( )

Moves the "scale" part of the global transformation to the children AnatomicalStructureDeformation objects.

Warning
if there are no children, this discards the scale

Member Data Documentation

◆ frozenString

const char* ImFusion::ASCDeformation::frozenString = "_frozen"
staticconstexpr

Specifies how individual structures should be transformed by an ASCDeformation.

Setting the "frozen" parameter in AnatomicalStructure::attributes() dictates how applyDeformation() treats an object.

◆ contributesToRegistrationString

const char* ImFusion::ASCDeformation::contributesToRegistrationString = "_contributesToRegistration"
staticconstexpr

Specifies how individual structures should be transformed by an ASCDeformation.

Setting the "contributesToRegistration" parameter in AnatomicalStructure::attributes() may contribute to how an ASCDeformation is constructed, this behaviour can be controlled with the ignoreNonContributing parameter in the constructor. Individual registration methods should furthermore use this attribute to determine whether a structure should constribute to the registration.


The documentation for this class was generated from the following file:
  • AnatomyPlugin/include/ImFusion/AnatomyPlugin/ASCDeformation.h
Search Tab / S to search, Esc to close