ImFusion SDK 4.3
PointsOnImage Class Reference

#include <ImFusion/Base/PointsOnImage.h>

Class that hold a list of points on a volume or image. More...

+ Inheritance diagram for PointsOnImage:

Detailed Description

Class that hold a list of points on a volume or image.

Points are automatically updated when the matrix or deformation changes. The class emits events when a point is added, removed or changed.

Public Member Functions

 PointsOnImage (SharedImageSet &image)
 
void addWorldPoint (const vec3 &point, bool findClosestFrame=true)
 Add a new point in World coordinates.
 
void setWorldPoint (const vec3 &point, int which, bool findClosestFrame=true)
 Moves an existing point to a position in World coordinates.
 
void setImagesPixelPoints (const std::vector< std::vector< vec2 > > &pixelPoints)
 Set all points in Image pixel coordinates (eg: [275.36, 178.6]) for all images.
 
void addImagePixelPoint (const vec2 &pixelPoint, int frame)
 Add a new point in Image pixel coordinates (eg: [275.36, 178.6]).
 
void addImagePoint (const vec3 &point, int frame)
 Add a new point in Image coordinates. Emits the signalPointsAdded signal.
 
void setImagePoint (const vec3 &point, int frame, int which)
 Moves an existing point to a position in Image coordinates. Emits the signalPointsChanged signal.
 
const std::vector< vec3 > & allPoints () const override
 Return the points in world coordinates.
 
const std::vector< std::pair< vec3, int > > & imagePoints () const
 Return the points in Image coordinates, paired with its associated frame.
 
std::vector< std::pair< vec3, int > > selectedImagePoints () const
 Return only the selected points in Image coordinates, paired with its associated frame.
 
std::pair< vec3, int > imagePoint (int which) const
 Return the point in Image coordinates, paired with its associated frame.
 
void remove (int first, int last) override
 Removes the points in range [first,last)
 
SharedImageSetimage ()
 Returns the input SharedImageSet.
 
const Datadata () const override
 Returns the input image as Data base class.
 
void configurePoint (const Properties *p) override
 Add the point described by the properties.
 
void pointConfiguration (Properties *p, int which) const override
 Extract the configuration of the point at index
 
void remove (int index)
 Gets remove(int which) from PointsOnData.
 
- Public Member Functions inherited from PointsOnData
const std::vector< vec3 > & points () const
 Return all the points in world coordinates whether they are selected or not.
 
std::vector< vec3 > selectedPoints () const
 Return the selected points in world coordinates.
 
void remove (int index)
 Remove the point at index
 
virtual int size () const
 Number of stored points ignoring the selection.
 
virtual bool empty () const
 Check if the list of points is empty.
 
virtual void clear ()
 Remove all the points.
 
virtual const vec3 & point (int which) const
 Get a point in world coordinates. The index can be negative, in which case it is counted from the end.
 
std::string name (int which) const
 Get the name of a point.
 
void setName (std::string name, int which)
 Set the name of a point.
 
bool isSelected (int which) const
 Checks whether a point is selected. By default all points are selected.
 
void setSelected (int which, bool selected)
 Sets whether a point is selected or not. By default all points are selected.
 
int find (const std::string &name, int start=0) const
 Get the first index of a point with the given name, starting from index start. Return -1 if not found.
 
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.
 
- Public Member Functions inherited from 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
 
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.
 

Protected Member Functions

std::pair< vec3, int > worldToImage (const vec3 &p, bool findClosestFrame) const
 
vec3 imageToWorld (const vec3 &p, int frame) const
 
void updateWorldPoints ()
 
- Protected Member Functions inherited from SignalReceiver
void disconnectAll ()
 Disconnects all existing connections.
 

Protected Attributes

SharedImageSetm_image = nullptr
 
std::vector< vec3 > m_points
 
std::vector< std::pair< vec3, int > > m_pointsImage
 (Point in image coordinates, frame) used to recompute m_points when the matrix/deformation changes
 
bool m_is2DTracked = false
 
- Protected Attributes inherited from PointsOnData
std::vector< std::stringm_names
 
std::vector< bool > m_selection
 < names of the points
 
std::string m_pointSetName
 Optional name of the point set.
 
- Protected Attributes inherited from Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.
 

Additional Inherited Members

- Public Attributes inherited from PointsOnData
Signal< int, int > signalPointsChanged
 Signal emitted when the points in range [first, last) are updated.
 
Signal< int, int > signalPointsAdded
 Signal emitted when points are added. The range [first, last) contains the new points.
 
Signal< int, int > signalPointsRemoved
 Signal emitted when the points in range [first, last) are removed.
 
Signal< int, int > signalPointsRenamed
 Signal emitted when the points in range [first, last) are renamed.
 
- Public Attributes inherited from Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.
 

Member Function Documentation

◆ addWorldPoint()

void addWorldPoint ( const vec3 & point,
bool findClosestFrame = true )

Add a new point in World coordinates.

If findClosestFrame the point in image coordinates is assigned to the closest frame, otherwise it is assigned to the focus frame. Emits the signalPointsAdded signal

◆ setWorldPoint()

void setWorldPoint ( const vec3 & point,
int which,
bool findClosestFrame = true )

Moves an existing point to a position in World coordinates.

If findClosestFrame the point in image coordinates is assigned to the closest frame, otherwise it is assigned to the focus frame. Emits the signalPointsAdded signal

◆ setImagesPixelPoints()

void setImagesPixelPoints ( const std::vector< std::vector< vec2 > > & pixelPoints)

Set all points in Image pixel coordinates (eg: [275.36, 178.6]) for all images.

pixelPoints size must be equal to number of images Emits the signalPointsAdded and signalPointsRemoved signals. Internally uses ImageDescriptor::pixelToImage

◆ addImagePixelPoint()

void addImagePixelPoint ( const vec2 & pixelPoint,
int frame )

Add a new point in Image pixel coordinates (eg: [275.36, 178.6]).

Emits the signalPointsAdded signal. Internally uses ImageDescriptor::pixelToImage

◆ allPoints()

const std::vector< vec3 > & allPoints ( ) const
inlineoverridevirtual

Return the points in world coordinates.

Implements PointsOnData.

◆ remove()

void remove ( int first,
int last )
overridevirtual

Removes the points in range [first,last)

Implements PointsOnData.

◆ data()

const Data * data ( ) const
overridevirtual

Returns the input image as Data base class.

Implements PointsOnData.

◆ configurePoint()

void configurePoint ( const Properties * p)
overridevirtual

Add the point described by the properties.

Implements PointsOnData.

◆ pointConfiguration()

void pointConfiguration ( Properties * p,
int which ) const
overridevirtual

Extract the configuration of the point at index

Implements PointsOnData.


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