ImFusion C++ SDK 4.5.0
ImFusion::CT::XRay2D3DRegistrationInitializationPointDirection Class Reference

#include <ImFusion/CT/XRay2D3DRegistrationInitializationPointDirection.h>

2D-3D registration initialization using point-direction pairs. More...

Inheritance diagram for ImFusion::CT::XRay2D3DRegistrationInitializationPointDirection:

Detailed Description

2D-3D registration initialization using point-direction pairs.

Estimates initial geometry from corresponding point and direction pairs.

Public Member Functions

 XRay2D3DRegistrationInitializationPointDirection (XRay2D3DRegistrationAlgorithm &alg)
std::optional< InitializationResultinitialize (ConeBeamGeometry &geom, SharedImageSet &shots, const SharedImageSet &volume, MaskEditor *maskAlg) override
 Initializes the registration based on user-set annotations given by two points (ordered) on each shot and two points (ordered) on the volume.
std::optional< InitializationResultinitialize (SharedImageSet &shots, const SharedImageSet &volume, MaskEditor *maskAlg) override
bool canInitialize () const override
 Check if all required parameters are set and the initialization can be performed.
const std::vector< Geometry::LineSegment > & sourceToTargetPointRays () const
 Getter for m_targetPointRays, i.e.
const std::vector< std::vector< std::vector< std::optional< Geometry::LineSegment > > > > & epipolarLines () const
 Getter for epipolar lines.
Parameter< std::vector< vec3 > > & p_shotTargetPoints (int index)
 Simulate property interface for shot target points.
std::vector< std::vector< Geometry::LineSegment > > updateTargetPointRays ()
 Update rays of backprojections of the target points.
void updateEpipolarLines (int shotIndex, int targetIndex=0)
 Update all of the epipolar lines that are computed for each target point on each shot.
void unsetEpipolarLines (int shotIndex, int targetIndex=0)
Public Member Functions inherited from ImFusion::CT::XRay2D3DRegistrationInitialization
 XRay2D3DRegistrationInitialization (XRay2D3DRegistrationAlgorithm &regAlg)
virtual double penalty (const ConeBeamGeometry &geom)
 A multiplicative penalty function applied during optimization.
XRay2D3DRegistrationAlgorithmregAlg ()
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 Attributes

Parameter< std::vector< vec3 > > p_volumeTargetPoints = {"Volume/targetPoints", std::vector<vec3>{}, this}
 Two target points on the volume.
Parameter< std::vector< vec3 > > p_volumeSecondDirectionPoints = {"Volume/secondDirectionPoints", std::vector<vec3>{}, this}
 Two points on the volume specifying the direction of the first shot.
Public Attributes inherited from ImFusion::Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.

Protected Attributes

std::vector< std::unique_ptr< Parameter< std::vector< vec3 > > > > m_shotTargetPoints
 One parameter per shot, stored in the properties interface as Shot{i}/targetPoints.
std::vector< Geometry::LineSegmentm_targetPointRays
 Ray from the x-ray source to the target points.
std::vector< std::vector< std::vector< std::optional< Geometry::LineSegment > > > > m_epipolarLines
 Vector of epipolar lines.
Protected Attributes inherited from ImFusion::CT::XRay2D3DRegistrationInitialization
XRay2D3DRegistrationAlgorithmm_regAlg
Protected Attributes inherited from ImFusion::Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.

Member Function Documentation

◆ initialize() [1/2]

std::optional< InitializationResult > ImFusion::CT::XRay2D3DRegistrationInitializationPointDirection::initialize ( ConeBeamGeometry & geom,
SharedImageSet & shots,
const SharedImageSet & volume,
MaskEditor * maskAlg )
overridevirtual

Initializes the registration based on user-set annotations given by two points (ordered) on each shot and two points (ordered) on the volume.

Points on the shots are back-projected yielding two sets of rays in 3D (one from each point to the x-ray source). The 'intersection' of (i.e. closest point between if there are two shots, otherwise something similar) each set of rays defines a target point. Volume is translated so that the first point on the volume is on the first target point, and is rotated so that the direction between the points on the volume matches the direction between target points. Optionally a second direction on the volume is provided in order to fix the last degree of freedom, this direction is used to orient the volume towards the detector->source direction on the first shot along the degree of freedom not specified by the first rotation.

Deprecated
"Directly pass in the legacy ConeBeamGeometry is deprecated."

Implements ImFusion::CT::XRay2D3DRegistrationInitialization.

◆ initialize() [2/2]

std::optional< InitializationResult > ImFusion::CT::XRay2D3DRegistrationInitializationPointDirection::initialize ( SharedImageSet & shots,
const SharedImageSet & volume,
MaskEditor * maskAlg )
overridevirtual

◆ canInitialize()

bool ImFusion::CT::XRay2D3DRegistrationInitializationPointDirection::canInitialize ( ) const
overridevirtual

Check if all required parameters are set and the initialization can be performed.

Implements ImFusion::CT::XRay2D3DRegistrationInitialization.

◆ sourceToTargetPointRays()

const std::vector< Geometry::LineSegment > & ImFusion::CT::XRay2D3DRegistrationInitializationPointDirection::sourceToTargetPointRays ( ) const
inline

Getter for m_targetPointRays, i.e.

Ray from the source position to the target points. The order is the same as for m_shotsWithGeom, i.e. first AP, second LAT. There are 2 rays for each point being annotated, i.e. 4 rays in general.

See also
initializePointDirection().

◆ epipolarLines()

const std::vector< std::vector< std::vector< std::optional< Geometry::LineSegment > > > > & ImFusion::CT::XRay2D3DRegistrationInitializationPointDirection::epipolarLines ( ) const
inline

Getter for epipolar lines.

Epipolar lines on all of the shots are computed for each target point on each shot.

◆ updateTargetPointRays()

std::vector< std::vector< Geometry::LineSegment > > ImFusion::CT::XRay2D3DRegistrationInitializationPointDirection::updateTargetPointRays ( )

Update rays of backprojections of the target points.

If shotRays is not nullptr, writes backprojection of the target points into *shotRays i.e. shotRays = [backProjectionsShot0,backProjectionsShot1, ...]

◆ updateEpipolarLines()

void ImFusion::CT::XRay2D3DRegistrationInitializationPointDirection::updateEpipolarLines ( int shotIndex,
int targetIndex = 0 )

Update all of the epipolar lines that are computed for each target point on each shot.

Parameters
targetIndexhas the default value of 0, since only the first points of shot target arrows are taken as shot target points. Epipolar lines are restricted with the image plane of X-ray shots.

Member Data Documentation

◆ p_volumeTargetPoints

Parameter<std::vector<vec3> > ImFusion::CT::XRay2D3DRegistrationInitializationPointDirection::p_volumeTargetPoints = {"Volume/targetPoints", std::vector<vec3>{}, this}

Two target points on the volume.

Warning: setting "volTargetPoints" in the configurable interface must be done in world coordinates!

◆ m_targetPointRays

std::vector<Geometry::LineSegment> ImFusion::CT::XRay2D3DRegistrationInitializationPointDirection::m_targetPointRays
protected

Ray from the x-ray source to the target points.

The order is the same as for m_shotsWithGeom, i.e. first AP, second LAT. Two points for each target point, i.e. 4 rays in total. See initializePointDirection().

◆ m_epipolarLines

std::vector<std::vector<std::vector<std::optional<Geometry::LineSegment> > > > ImFusion::CT::XRay2D3DRegistrationInitializationPointDirection::m_epipolarLines
protected

Vector of epipolar lines.

The order of indices: the shot with target point, target point, and the shot with annotation. e.g. m_epipolarLineAnnot[0][1][2] means that the epipolar line is drawn on shot #2, the epipolar line is computed from target point #0 which is set on the shot #1. Warning: The index order of XRay2D3DRegistrationInitializationPointDirectionController::m_epipolarLineAnnot is not the same with XRay2D3DRegistrationInitializationPointDirection::m_epipolarLines.


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