![]() |
ImFusion C++ SDK 4.5.0
|
#include <CranialPlugin/include/ImFusion/Cranial/MultiVolumeRegistrationAlgorithm.h>
Rigidly or affinely co-registers a set of 3D volumes to a common reference by updating image poses in-place. More...
Rigidly or affinely co-registers a set of 3D volumes to a common reference by updating image poses in-place.
No resampling is performed; original voxel data is unchanged.
Registration history is stored in results(). Call results().apply(n) to restore all image poses to a given step; compute() appends a new step on each successful run.
When p_consensus is enabled, each moving image is registered via multiple paths and the most geometrically consistent result is selected, improving robustness to outlier registrations.
Masking:
Public Types | |
| enum class | ImageRole { Fixed , Moving , Ignored } |
| Per-image role controlling which images participate in the next compute() call. More... | |
| enum class | Transformation { Rigid , Affine } |
| enum class | Metric { MutualInformation , NormalizedCrossCorrelation , LC2 } |
| enum class | Initialization { None , BoundingBox , CenterOfMass } |
| Public Types inherited from ImFusion::Algorithm | |
| enum | Status { Unknown = -1 , Success = 0 , Error = 1 , InvalidInput , IncompleteInput , OutOfMemoryHost , OutOfMemoryGPU , UnsupportedGPU , UnknownAction , AbortedByUser , User = 1000 } |
| Status codes. More... | |
Public Member Functions | |
| MultiVolumeRegistrationAlgorithm (std::vector< SharedImageSet * > images, int referenceIndex=0, AnatomicalStructureCollection *asc=nullptr) | |
All images must be supplied upfront; the image at referenceIndex is fixed. | |
| void | compute () override |
| Execute the algorithm. | |
| void | configure (const Properties *p) override |
| Configure this object instance by de-serializing the given Properties. | |
| void | configuration (Properties *p) const override |
| Serialize the current object configuration into the given Properties object. | |
| OwningDataList | takeOutput () override |
| Return any new Data that was created by the Algorithm during the last call to compute(). | |
| bool | survivesDataDeletion (const Data *data) const override |
| Indicates whether the algorithm can handle (partial) deletion of the specified data, by default this checks whether the data is in the input list. | |
| RegistrationResults & | results () |
| Pose-history snapshots appended by each successful compute(). | |
| const RegistrationResults & | results () const |
| bool | hasReferenceCoupledState () const |
| Returns true when the current ASC / mask / result state is coupled to the active reference image and changing the reference may leave state stale or misaligned until rebuilt. | |
| const std::vector< SharedImageSet * > & | images () const |
| All input images in the order they were supplied (reference included). | |
| AnatomicalStructureCollection * | asc () const |
| Non-owning pointer to the ASC. Always valid after construction. | |
| std::unique_ptr< GenericASC > | takeOwnedAsc () |
| Transfers ownership of the internally created ASC to the caller. | |
| bool | setRole (int imageIndex, ImageRole role) |
Sets the role of the image at imageIndex. | |
| ImageRole | role (int imageIndex) const |
| void | previewReferenceMask () |
| Rebuilds and applies the reference-image mask immediately, without running a full compute(). | |
| Public Member Functions inherited from ImFusion::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. | |
| Progress * | progress () const |
| Returns the progress interface if set. | |
| virtual int | status () const |
| Indicates the status of the last call to compute(). | |
| const FactoryInfo & | factoryInfo () 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 ImFusion::Configurable | |
| 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 | |
| Configurable & | operator= (const Configurable &) |
| Configurable & | operator= (Configurable &&) noexcept |
Static Public Member Functions | |
| static bool | createCompatible (const DataList &data, Algorithm **a=nullptr) |
| Static Public Member Functions inherited from ImFusion::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< int > | p_referenceIndex = {"referenceIndex", 0, this} |
| Which image in images() is treated as the fixed reference. | |
| Parameter< Transformation > | p_transformation = {"transformation", Transformation::Rigid, this} |
| Parameter< Metric > | p_metric = {"metric", Metric::MutualInformation, this} |
| Parameter< Initialization > | p_initialization = {"initialization", Initialization::None, this} |
| Parameter< bool > | p_consensus = {"consensus", false, this} |
| When enabled, registers each moving image via multiple paths and selects the most consistent result. | |
| Parameter< bool > | p_computeBrainMasks = {"computeBrainMasks", false, this} |
| When enabled, every input image is skull-stripped independently and the resulting brain mask is used to focus registration on brain tissue (CT inputs are not supported). | |
| Parameter< int > | p_maskDilationRadius = {"maskDilationRadius", 2, this} |
| Dilation radius (in voxels) applied to the reference image mask before registration. | |
| Parameter< AnatomyPlugin::Selector > | p_maskSelector {"maskSelector", AnatomyPlugin::Selector{}, this} |
| Selects which ASC entries (meshes and/or label map images) are OR-combined into a registration mask attached to the reference image only. | |
| Public Attributes inherited from ImFusion::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 ImFusion::Configurable | |
| Signal | signalParametersChanged |
| Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted. | |
Additional Inherited Members | |
| Protected Member Functions inherited from ImFusion::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 Attributes inherited from ImFusion::Algorithm | |
| std::string | m_name |
| Algorithm name. | |
| Progress * | m_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< Action > | m_actions |
| Map of key given by the id of the action, of the available actions of this algorithm. | |
| Protected Attributes inherited from ImFusion::Configurable | |
| std::vector< Param > | m_params |
| List of all registered Parameter and SubProperty instances. | |
|
strong |
Per-image role controlling which images participate in the next compute() call.
| Enumerator | |
|---|---|
| Fixed | Fixed registration reference. Exactly one image has this role at any time. |
| Moving | Participates as a moving image; its pose will be updated by compute(). |
| Ignored | Excluded from the next compute(); its pose is not changed. |
|
explicit |
All images must be supplied upfront; the image at referenceIndex is fixed.
If no asc is provided, an internal one is created and accessible via asc().
|
overridevirtual |
Execute the algorithm.
Implements ImFusion::Algorithm.
|
overridevirtual |
Configure this object instance by de-serializing the given Properties.
The default implementation will do so automatically for all registered Parameter and SubProperty instances.
Reimplemented from ImFusion::Configurable.
|
overridevirtual |
Serialize the current object configuration into the given Properties object.
The default implementation will do so automatically for all registered Parameter and SubProperty instances.
Reimplemented from ImFusion::Configurable.
|
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.
Reimplemented from ImFusion::Algorithm.
|
overridevirtual |
Indicates whether the algorithm can handle (partial) deletion of the specified data, by default this checks whether the data is in the input list.
Reimplemented from ImFusion::Algorithm.
|
inline |
|
inline |
Transfers ownership of the internally created ASC to the caller.
Returns nullptr if an external ASC was provided at construction time.
| bool ImFusion::Cranial::MultiVolumeRegistrationAlgorithm::setRole | ( | int | imageIndex, |
| ImageRole | role ) |
Sets the role of the image at imageIndex.
Returns false if the index is out of range.
| void ImFusion::Cranial::MultiVolumeRegistrationAlgorithm::previewReferenceMask | ( | ) |
Rebuilds and applies the reference-image mask immediately, without running a full compute().
In ASC-mask mode the mask is built from the current ASC selector; in brain-mask mode it is rebuilt from the stored brain label map. Either way, p_maskDilationRadius is applied. Moving-image masks are never touched by this call.
| Parameter<bool> ImFusion::Cranial::MultiVolumeRegistrationAlgorithm::p_consensus = {"consensus", false, this} |
When enabled, registers each moving image via multiple paths and selects the most consistent result.
Requires at least two moving images to have any effect.
| Parameter<bool> ImFusion::Cranial::MultiVolumeRegistrationAlgorithm::p_computeBrainMasks = {"computeBrainMasks", false, this} |
When enabled, every input image is skull-stripped independently and the resulting brain mask is used to focus registration on brain tissue (CT inputs are not supported).
The reference brain mask is dilated and stored in the ASC under Keys::Brain::key; moving-image masks are attached undilated and are not stored in the ASC. In this mode p_maskSelector has no effect; see p_computeBrainMasks = false for the ASC-based alternative that masks only the reference.
| Parameter<int> ImFusion::Cranial::MultiVolumeRegistrationAlgorithm::p_maskDilationRadius = {"maskDilationRadius", 2, this} |
Dilation radius (in voxels) applied to the reference image mask before registration.
Has no effect on moving-image masks; they are always attached undilated regardless of mode.
| Parameter<AnatomyPlugin::Selector> ImFusion::Cranial::MultiVolumeRegistrationAlgorithm::p_maskSelector {"maskSelector", AnatomyPlugin::Selector{}, this} |
Selects which ASC entries (meshes and/or label map images) are OR-combined into a registration mask attached to the reference image only.
For label-map image entries, matching selector elements may optionally narrow the included labels via the @labelValues(v1, v2, ...) annotation. Has no effect when p_computeBrainMasks is enabled; in that mode all images are skull-stripped independently and p_maskSelector is ignored.