ImFusion C++ SDK 4.5.0
ImFusion::Cranial::ACPCDetectionAlgorithm Class Reference

#include <CranialPlugin/include/ImFusion/Cranial/ACPCDetectionAlgorithm.h>

Detects the AC (anterior commissure) and PC (posterior commissure) landmarks in a 3D brain MRI with one of the following contrasts: T1(C), T2, FLAIR Optionally determines a standardized coordinate system. More...

Inheritance diagram for ImFusion::Cranial::ACPCDetectionAlgorithm:

Detailed Description

Detects the AC (anterior commissure) and PC (posterior commissure) landmarks in a 3D brain MRI with one of the following contrasts: T1(C), T2, FLAIR Optionally determines a standardized coordinate system.

Classes

struct  CoordinateSystem

Public Member Functions

 ACPCDetectionAlgorithm (SharedImageSet &input, AnatomicalStructureCollection *asc=nullptr)
 Constructor, if asc is not provided, a new one is created.
std::vector< std::unique_ptr< InteractiveObject > > outputAnnotations () override
 Function that creates the visualizations to be displayed when running the algorithm from a controller.
SharedImageSetinput () const
void setInputImage (SharedImageSet &newInput)
 Set the input to the algorithm, resets the potential existing outputs.
const SharedImageSetbrainMask () const
 Returns a non-owning pointer to the generated brain mask, or nullptr if the algorithm was not successful or if the output was already fetched via takeOutput().
std::optional< vec3 > anteriorCommissure () const
 Returns the AC/PC landmark points as vec3 coordinates, or nullopt if not detected.
std::optional< vec3 > posteriorCommissure () const
std::optional< CoordinateSystemcoordinateSystem () const
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.
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 ImFusion::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
Configurable & operator= (const Configurable &)
Configurable & operator= (Configurable &&) noexcept
Public Member Functions inherited from ImFusion::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.

Public Attributes

Parameter< std::stringp_modelSet = {"modelSet", Models::Latest::ModelSetName, this}
 Model set to use for ACPC detection.
Parameter< std::stringp_modelSetVersion = {"modelSetVersion", Models::Latest::ModelSetVersion, this}
 Version of the model set to use for ACPC detection.
Parameter< int > p_dilation = {"dilation", 5, this}
 Parametrize the optional morphological post-processing applied to the brain mask, use positive integers for dilation and negative ones for erosion, 0 to skip.
Parameter< int > p_midSagittalMaxIter = {"midSagittalMaxIter", 20, this}
 Maximum iterations for the algorithm determining the mid-sagittal plane. Only relevant if getCoordinateSystem is true.
Parameter< bool > p_computeCoordinateSystem = {"computeCoordinateSystem", true, this}
 In addition to the AC/PC points, determine a standardized coordinate system.
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.
void compute () override
 Execute the algorithm.
OwningDataList takeOutput () override
 Returns the AnatomicalStructureCollection with brain structure containing AC/PC landmarks as keypoints if they were detected.
static bool createCompatible (const DataList &data, Algorithm **a=0)
 Standard methods for the Algorithm interface.

Additional Inherited Members

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...
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.
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 Member Functions inherited from ImFusion::SignalReceiver
void disconnectAll ()
 Disconnects all existing connections.
Protected Attributes inherited from ImFusion::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 ImFusion::Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.

Member Function Documentation

◆ compute()

void ImFusion::Cranial::ACPCDetectionAlgorithm::compute ( )
overridevirtual

Execute the algorithm.

Implements ImFusion::Algorithm.

◆ takeOutput()

OwningDataList ImFusion::Cranial::ACPCDetectionAlgorithm::takeOutput ( )
overridevirtual

Returns the AnatomicalStructureCollection with brain structure containing AC/PC landmarks as keypoints if they were detected.

Reimplemented from ImFusion::Algorithm.

◆ outputAnnotations()

std::vector< std::unique_ptr< InteractiveObject > > ImFusion::Cranial::ACPCDetectionAlgorithm::outputAnnotations ( )
overridevirtual

Function that creates the visualizations to be displayed when running the algorithm from a controller.

Implements ImFusion::AnnotationOutputInterface.

◆ brainMask()

const SharedImageSet * ImFusion::Cranial::ACPCDetectionAlgorithm::brainMask ( ) const
inline

Returns a non-owning pointer to the generated brain mask, or nullptr if the algorithm was not successful or if the output was already fetched via takeOutput().

Here, the brain mask is expected to cover the brain and the skull.

Member Data Documentation

◆ p_dilation

Parameter<int> ImFusion::Cranial::ACPCDetectionAlgorithm::p_dilation = {"dilation", 5, this}

Parametrize the optional morphological post-processing applied to the brain mask, use positive integers for dilation and negative ones for erosion, 0 to skip.

The predicted brain mask is used to crop the image to the region of interest, limiting memory requirements.

◆ p_computeCoordinateSystem

Parameter<bool> ImFusion::Cranial::ACPCDetectionAlgorithm::p_computeCoordinateSystem = {"computeCoordinateSystem", true, this}

In addition to the AC/PC points, determine a standardized coordinate system.

The right-handed coordinate system with origin in the AC point is defined via the subjects estimated anatomical directions:

  • yAxis: anterior-posterior (in the midsagittal plane)
  • zAxis: inferior-superior (in the midsagittal plane)
  • xAxis: left-right

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