ImFusion SDK 4.3
ASCRegistration Class Reference

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

Registration between two AnatomicalStructureCollections. More...

+ Inheritance diagram for ASCRegistration:

Detailed Description

Registration between two AnatomicalStructureCollections.

The registration is performed by one of several registration methods (e.g. based on stored points, meshes, images...) And is (if necessary) restricted to a registration type (global linear, linear for each AnatomicalStructure, deformable, etc...).

Public Types

enum class  RegistrationMethod {
  Automatic , PointsAndPlanes , DeformableMeshRegistration , RigidImages ,
  PointsRigidScaling , None , CustomRegistrationSequence
}
 
enum class  RegistrationMode { MoveMoving , CreateCopy , RawResult , OnlyRegister }
 
using RegistrationType = AnatomicalStructureRegistration::RegistrationType
 
using RegistrationSequence = std::vector<std::unique_ptr<ASCRegistrationMethod>>
 
- Public Types inherited from Algorithm
enum  Status {
  Unknown = -1 , Success = 0 , Error = 1 , InvalidInput ,
  IncompleteInput , OutOfMemoryHost , OutOfMemoryGPU , UnsupportedGPU ,
  UnknownAction , AbortedByUser , User = 1000
}
 Status codes. More...
 

Public Member Functions

 ASCRegistration (AnatomicalStructureCollection &fixed, AnatomicalStructureCollection &moving, SharedImageSet *fixedImg=nullptr, SharedImageSet *movingImg=nullptr)
 
void compute () override
 Resets the registration, and then runs the provided registration sequence.
 
void refine ()
 Like compute, but does not call reset() first.
 
void interpolate (double p, bool applyGlobal=true, AnatomicalStructureCollection *out=nullptr)
 Interpolates along the stored registration result between the fixed and moving ASCs. If out is null, uses the last stored result as output.
 
void perturb (double p, bool applyGlobal=false)
 Pushes the moving image by a factor p (in [0,1], typically very small) towards the fixed image "along" the registration.
 
Algorithm::Status reset ()
 
Algorithm::Status mapForward (SharedImageSet &ct)
 Helper function that applies the deformation to a volume using the ApplyASCDeformation algorithm.
 
Algorithm::Status mapBackward (SharedImageSet &ct)
 Helper function taht applies the inverse deformation to a volume using the ApplyASCDeformation algorithm.
 
OwningDataList takeOutput () override
 Return any new Data that was created by the Algorithm during the last call to compute().
 
void configureRegistrationMethodProperties (const Properties &properties)
 Configures the last element of the registration sequence.
 
SharedImageSetmovingImage ()
 
SharedImageSetundeformedImage ()
 
DataList movingData () override
 The "moving" data structure(s) relative to which the movingASC AnatomicalStructureCollection is defined.
 
DataList fixedData () override
 The "fixed" data structure(s) relative to which the fixedASC AnatomicalStructureCollection is defined.
 
std::optional< ASCDeformation > & storedResult ()
 
std::optional< ASCDeformation > const & storedResult () const
 
AnatomicalStructureCollectionfixed ()
 
AnatomicalStructureCollectionmoving ()
 
AnatomicalStructureCollectionmovingOnUndeformedImage ()
 
AnatomicalStructureCollectionfixedASC () override
 
AnatomicalStructureCollectionmovingASC () override
 
const RegistrationSequenceregistrationMethodSequence () const
 
void removeFromRegistrationSequence (int index, bool triggerSignal=true)
 
bool insertIntoRegistrationSequence (int index, std::unique_ptr< ASCRegistrationMethod > method, bool triggerSignal=true)
 Insert a method into the registration sequence at the given index.
 
bool appendToRegistrationSequence (std::unique_ptr< ASCRegistrationMethod > method, bool triggerSignal=true)
 Append a method to the registration sequence.
 
bool insertIntoRegistrationSequence (int index, const std::string &identifier, bool triggerSignal=true)
 Convenience function for creating method based on identifier from factory For the PerAnatomyAutomatic registration method, sets this as the reg member of the method.
 
void replaceRegistrationSequence (RegistrationSequence methods, bool triggerSignal=true)
 
void replaceRegistrationSequence (const std::vector< std::string > &methods, bool triggerSignal=true)
 Convenience function for creating methods based on identifiers from factory For the PerAnatomyAutomatic registration method, sets this as the reg member of the method.
 
ASCRegistrationMethod::FactoryregistrationMethodFactory ()
 
const ASCRegistrationMethod::FactoryregistrationMethodFactory () const
 
- Public Member Functions inherited from ASCRegistrationInterface
virtual std::unique_ptr< AnatomicalStructureCollectiontakeMovingASC ()
 
virtual std::unique_ptr< AnatomicalStructureCollectiontakeFixedASC ()
 
- Public Member Functions inherited from Algorithm
 Algorithm ()
 Default constructor will registers a single "compute" action that calls compute() and returns status().
 
virtual void setProgress (Progress *progress)
 Sets a Progress interface the algorithm can use to notify observers about its computing progress.
 
Progressprogress () const
 Returns the progress interface if set.
 
virtual int status () const
 Indicates the status of the last call to compute().
 
virtual bool survivesDataDeletion (const Data *) const
 Indicates whether the algorithm can handle (partial) deletion of the specified data, by default this checks whether the data is in the input list.
 
const FactoryInfofactoryInfo () const
 Returns the record describing how this Algorithm was instantiated by the AlgorithmFactory.
 
void setFactoryInfo (const FactoryInfo &value)
 Sets the record describing how this Algorithm was instantiated by the AlgorithmFactory.
 
Status runAction (const std::string &id)
 Run the action with name id if it exists.
 
const std::vector< Action > & actions ()
 Get a mapping from Action id to Action as registered in this algorithm.
 
- Public Member Functions inherited from Configurable
virtual void configure (const Properties *p)
 Configure this object instance by de-serializing the given Properties.
 
virtual void configuration (Properties *p) const
 Serialize the current object configuration into the given Properties object.
 
virtual void configureDefaults ()
 Retrieve the properties of this object, replaces values with their defaults and sets it again.
 
void registerParameter (ParameterBase *param)
 Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration().
 
void unregisterParameter (const ParameterBase *param)
 Remove the given Parameter or SubProperty from the list of registered parameters.
 
 Configurable (const Configurable &rhs)
 
 Configurable (Configurable &&rhs) noexcept
 
Configurableoperator= (const Configurable &)
 
Configurableoperator= (Configurable &&) noexcept
 
- Public Member Functions inherited from SignalReceiver
 SignalReceiver ()=default
 Default constructor.
 
 SignalReceiver (const SignalReceiver &other)
 Copy constructor, does not copy any existing signal connections from other.
 
SignalReceiveroperator= (SignalReceiver rhs)
 Assignment operator, disconnects all existing connections, does not copy any existing signal connections from rhs.
 
virtual ~SignalReceiver ()
 Virtual destructor disconnects from all connected signals.
 

Static Public Member Functions

static bool createCompatible (DataList dl, Algorithm **alg)
 
- Static Public Member Functions inherited from Algorithm
static bool createCompatible (const DataList &data, Algorithm **a=nullptr)
 Factory function to check algorithm compatibility with input data and optionally instantiate it.
 

Public Attributes

Parameter< RegistrationType > p_registrationType
 Which deformation type to output.
 
Parameter< RegistrationMethod > p_registrationMethod = {"registrationMethod", RegistrationMethod::Automatic, *this}
 Which underlying registration method to use.
 
Parameter< RegistrationMode > p_registrationMode = {"registrationMode", RegistrationMode::CreateCopy, *this}
 What kind of output to create (or not create)
 
Parameter< bool > p_createMissingObjects = {"createMissingObjects", true, *this}
 If set to true, objects (meshes, keypoints, etc...) are created in the output based on the linear part of the deformation even if they are not present in the input.
 
Parameter< bool > p_createMissingAnatomicalStructures = {"createMissingAnatomicalStructures", false, *this}
 If set to true, anatomical structures are created in the output based on the (global) linear part of the deformation.
 
Parameter< std::optional< std::vector< std::string > > > p_identifiers = {"identifiers", std::nullopt, *this}
 Registration is restricted to Anatomical structures with the given identifiers if set.
 
Parameter< bool > p_globalUnitScaling = {"globalUnitScaling", true, *this}
 Sets the global scaling to 1. This is useful to avoid changing the spacing when applied to a volume.
 
Parameter< bool > p_rigidSegments = {"rigid", false, *this}
 If set to true, the scaling is either discarded or moved to the deformable parts of the registration.
 
Parameter< double > p_deformationFieldResolution = {"deformationFieldResolution", 4.0, *this}
 If creating a deformation for a moving image, this resolution will be used for the (dense) deformation.
 
Signal signalRegistrationSequenceChanged
 
- Public Attributes inherited from ASCRegistrationInterface
Signal signalMovingASCCreated
 For algorithms that additionally create an AnatomicalStructureCollection, this signal can be used to trigger actions that need to be performed once the AnatomicalStructureCollection has been created.
 
Signal signalFixedASCCreated
 For algorithms that additionally create an AnatomicalStructureCollection, this signal can be used to trigger actions that need to be performed once the AnatomicalStructureCollection has been created.
 
- Public Attributes inherited from Algorithm
Signal signalOutputChanged
 Signal should be emitted by Algorithms when their output/result has changed.
 
Signal signalParametersChanged
 Signal should be emitted by Algorithms when their parameter configuration has changed.
 
- Public Attributes inherited from Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.
 

Additional Inherited Members

- Protected Member Functions inherited from Algorithm
void loadDefaults ()
 
void registerAction (const std::string &id, const std::string &guiName, const std::function< Algorithm::Status(void)> &action)
 Register an action to be run via runAction.
 
template<typename D>
void registerAction (const std::string &id, const std::string &guiName, Algorithm::Status(D::*action)(void))
 Template version of runAction that can be used with a pointer to a member function.
 
void registerAction (const Action &action)
 Register an action.
 
- Protected Member Functions inherited from SignalReceiver
void disconnectAll ()
 Disconnects all existing connections.
 
- Protected Attributes inherited from Algorithm
std::string m_name
 Algorithm name.
 
Progressm_progress = nullptr
 Non-owing pointer to a progress interface. May be a nullptr.
 
FactoryInfo m_factoryInfo = {}
 Record describing how this algorithm was instantiated by the AlgorithmFactory.
 
int m_status = Status::Unknown
 Algorithm status after last call to compute()
 
std::vector< Actionm_actions
 Map of key given by the id of the action, of the available actions of this algorithm.
 
- Protected Attributes inherited from Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.
 

Member Function Documentation

◆ compute()

void compute ( )
overridevirtual

Resets the registration, and then runs the provided registration sequence.

Implements Algorithm.

◆ takeOutput()

OwningDataList takeOutput ( )
overridevirtual

Return any new Data that was created by the Algorithm during the last call to compute().

The default implementation will return an empty list.

Note
Since ownership of the data is transferred, you can call this method only once between calls to compute().

Reimplemented from Algorithm.

◆ configureRegistrationMethodProperties()

void configureRegistrationMethodProperties ( const Properties & properties)

Configures the last element of the registration sequence.

Deprecated
"Manipulate the registration sequence directly"

◆ movingData()

DataList movingData ( )
inlineoverridevirtual

The "moving" data structure(s) relative to which the movingASC AnatomicalStructureCollection is defined.

The typical use-case for this is the image on which a segmentation algorithm then extracts an AnatomicalStructureCollection.

Implements ASCRegistrationInterface.

◆ fixedData()

DataList fixedData ( )
inlineoverridevirtual

The "fixed" data structure(s) relative to which the fixedASC AnatomicalStructureCollection is defined.

The typical use-case for this is the image on which a segmentation algorithm then extracts an AnatomicalStructureCollection.

Implements ASCRegistrationInterface.

◆ fixedASC()

AnatomicalStructureCollection * fixedASC ( )
inlineoverridevirtual

◆ movingASC()

AnatomicalStructureCollection * movingASC ( )
inlineoverridevirtual

◆ insertIntoRegistrationSequence()

bool insertIntoRegistrationSequence ( int index,
std::unique_ptr< ASCRegistrationMethod > method,
bool triggerSignal = true )

Insert a method into the registration sequence at the given index.

If method is nullptr, a dummy (ASCRegistrationMethod::ReturnError) is inserted at the given position.

Returns
true if the method was not nullptr and was successfully inserted.

◆ appendToRegistrationSequence()

bool appendToRegistrationSequence ( std::unique_ptr< ASCRegistrationMethod > method,
bool triggerSignal = true )
inline

Append a method to the registration sequence.

If method is nullptr, a dummy (ASCRegistrationMethod::ReturnError) is appended.

Returns
true if the method was not nullptr and was successfully appended.

Member Data Documentation

◆ p_registrationType

Parameter<RegistrationType> p_registrationType
Initial value:
= {
"registrationType",
Flags<RegistrationType>{RegistrationType::Deformable, RegistrationType::GlobalScaledE3, RegistrationType::LocalScaledE3},
*this}
Utility class to store a type-safe combination of enum-based bit fields.
Definition Flags.h:34

Which deformation type to output.

Resulting deformation is filtered to match this type. Not all registration types support all deformation types.

◆ p_identifiers

Parameter<std::optional<std::vector<std::string> > > p_identifiers = {"identifiers", std::nullopt, *this}

Registration is restricted to Anatomical structures with the given identifiers if set.

Deprecated
"Use a ModifyBehavior registration operation directly "

The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close