Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
rgrl_invariant_single_landmark Class Reference

Represent a 2D bifurcation landmark associated with a set of invariant properties. More...

#include <rgrl_invariant_single_landmark.h>

Inheritance diagram for rgrl_invariant_single_landmark:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 rgrl_invariant_single_landmark (vnl_vector< double > location, vnl_vector< double > vessel_dir1, vnl_vector< double > vessel_dir2, vnl_vector< double > vessel_dir3, double width1, double width2, double width3, double angular_std=1, double width_ratio_std=1)
 Constructor, both angular_variance and width_ratio_variance are in radius.
 rgrl_invariant_single_landmark (const rgrl_invariant_single_landmark &copy, double angular_std=1, double width_ratio_std=1)
 Construct the constellation from another by shifting indices counterclockwise.
const vnl_double_2 & location () const
 Return the location.
const vnl_double_2 & boundary_point_location (int i) const
 Returns the i-th boundary point location.
const vnl_double_2 & boundary_point_normal (int i) const
 Returns the i-th boundary point normal direction.
bool estimate (rgrl_invariant_sptr from, rgrl_transformation_sptr &xform, rgrl_scale_sptr &scale)
 Estimate the xform mapping from to the current feature.
const vnl_vector< double > & cartesian_invariants () const
 Returns the vector of invariants normalized by scale.
const vnl_vector< double > & angular_invariants () const
 Returns the vector of invariants normalized by scale.
rgrl_mask_box region () const
 Computes the valid match region for the constellation.
bool has_region () const
 Return true if the feature has an initial ROI.
const vnl_double_2 & center ()
 Returns the center of the points in the computation of the parameters.
bool is_ambiguous () const
 Constellation ambiguity check.
 rgrl_type_macro (rgrl_invariant_single_landmark, rgrl_invariant)
 rgrl_type_macro (rgrl_invariant, rgrl_object)
virtual bool is_type (const vcl_type_info &type) const
void set_debug_flag (unsigned int debugFlag) const
 Set the value of the debug flag. A non-zero value turns debugging on.
unsigned int debug_flag () const
 Get the value of the debug flag.
void set_warning (bool) const
 Set the flag for warning messages.
bool warning () const
 Get the warning flag.
unsigned int add_observer (rgrl_event_sptr event, rgrl_command_sptr)
 Allow people to add/remove/invoke observers (callbacks) to any rgrl object.
rgrl_command_sptr get_command (unsigned int tag)
 Get the command associated with the given tag.
void invoke_event (const rgrl_event &)
 Call execute(.) on all the rgrl_commands observing this event id.
void invoke_event (const rgrl_event &) const
 Call execute(.) on all the rgrl_commands observing this event id.
void remove_observer (unsigned int tag)
 Remove the observer with this tag value.
bool has_observer (const rgrl_event &event) const
 Return true if an observer is registered for this event.
void ref ()
void unref ()
int get_references () const
bool is_referenced () const

Static Public Member Functions

static const vcl_type_info & type_id ()

Private Member Functions

double ccw_angle_between (vnl_double_2 from, vnl_double_2 to)
 A helper function to compute the counterclockwise angles between two orientation vectors.
void reorder_vessel (vcl_vector< vnl_vector< double > > &directions, vcl_vector< double > &local_widths, vcl_vector< double > &angles)
 A helper function to reorder selected indices of a landmark.

Private Attributes

vnl_double_2 location_
vcl_vector< double > local_widths_
vcl_vector< vnl_double_2 > boundary_points_
vcl_vector< vnl_double_2 > trace_normals_
vnl_vector< double > cartesian_invariants_
vnl_vector< double > angular_invariants_
vnl_double_2 center_
double radius_
bool is_ambiguous_
bool center_set_
bool is_estimate_set_

Detailed Description

Represent a 2D bifurcation landmark associated with a set of invariant properties.

This is the simplified implementation of the single-landmark feature with invariant properties in "The Dual-Bootstrap Iterative Closest Point Algorithm with Application to Retinal Image Registration" by Stewart et al., TMI 2003, vol 22, no 11.

This invariant class is to serve as an example of feature with invariants for initialization using invariant indexing. The properties of a landmark includes the center location, 3 direction vectors of the vessels that come to meet, 3 associated widths. The radius of the circular region that the landmark occupies is taken as the maximum of the 3 widths.

The transformation model is similarity (translation+scaling+rotation), estimated using the landmark center location and 6 boundary points.

Definition at line 36 of file rgrl_invariant_single_landmark.h.


Constructor & Destructor Documentation

rgrl_invariant_single_landmark::rgrl_invariant_single_landmark ( vnl_vector< double >  location,
vnl_vector< double >  vessel_dir1,
vnl_vector< double >  vessel_dir2,
vnl_vector< double >  vessel_dir3,
double  width1,
double  width2,
double  width3,
double  angular_std = 1,
double  width_ratio_std = 1 
)

Constructor, both angular_variance and width_ratio_variance are in radius.

Definition at line 18 of file rgrl_invariant_single_landmark.cxx.

rgrl_invariant_single_landmark::rgrl_invariant_single_landmark ( const rgrl_invariant_single_landmark copy,
double  angular_std = 1,
double  width_ratio_std = 1 
)

Construct the constellation from another by shifting indices counterclockwise.

Note:
Used if there is ambiguity in the ordering of the vessel directions. Both angular_variance and width_ratio_variance are in radius

Definition at line 80 of file rgrl_invariant_single_landmark.cxx.


Member Function Documentation

unsigned int rgrl_object::add_observer ( rgrl_event_sptr  event,
rgrl_command_sptr  cmd 
) [inherited]

Allow people to add/remove/invoke observers (callbacks) to any rgrl object.

This is an implementation of the subject/observer design pattern. An observer is added by specifying an event to respond to and an rgrl_command to execute. It returns an unsigned long tag which can be used later to remove the event or retrieve the command.

Definition at line 47 of file rgrl_object.cxx.

const vnl_vector< double > & rgrl_invariant_single_landmark::angular_invariants ( ) const [virtual]

Returns the vector of invariants normalized by scale.

Reimplemented from rgrl_invariant.

Definition at line 139 of file rgrl_invariant_single_landmark.cxx.

const vnl_double_2 & rgrl_invariant_single_landmark::boundary_point_location ( int  i) const

Returns the i-th boundary point location.

Definition at line 116 of file rgrl_invariant_single_landmark.cxx.

const vnl_double_2 & rgrl_invariant_single_landmark::boundary_point_normal ( int  i) const

Returns the i-th boundary point normal direction.

Definition at line 124 of file rgrl_invariant_single_landmark.cxx.

const vnl_vector< double > & rgrl_invariant_single_landmark::cartesian_invariants ( ) const [virtual]

Returns the vector of invariants normalized by scale.

Reimplemented from rgrl_invariant.

Definition at line 132 of file rgrl_invariant_single_landmark.cxx.

double rgrl_invariant_single_landmark::ccw_angle_between ( vnl_double_2  from,
vnl_double_2  to 
) [private]

A helper function to compute the counterclockwise angles between two orientation vectors.

Returns:
angles in the range of [0,2*PI)

Definition at line 363 of file rgrl_invariant_single_landmark.cxx.

const vnl_double_2 & rgrl_invariant_single_landmark::center ( )

Returns the center of the points in the computation of the parameters.

The center is the average location of all landmarks and boundary points. This is not necessarily the center of the bounding_box

Definition at line 301 of file rgrl_invariant_single_landmark.cxx.

unsigned int rgrl_object::debug_flag ( ) const [inherited]

Get the value of the debug flag.

Definition at line 26 of file rgrl_object.cxx.

bool rgrl_invariant_single_landmark::estimate ( rgrl_invariant_sptr  from,
rgrl_transformation_sptr xform,
rgrl_scale_sptr scale 
) [virtual]

Estimate the xform mapping from to the current feature.

Implements rgrl_invariant.

Definition at line 157 of file rgrl_invariant_single_landmark.cxx.

rgrl_command_sptr rgrl_object::get_command ( unsigned int  tag) [inherited]

Get the command associated with the given tag.

Definition at line 57 of file rgrl_object.cxx.

bool rgrl_object::has_observer ( const rgrl_event event) const [inherited]

Return true if an observer is registered for this event.

Definition at line 107 of file rgrl_object.cxx.

bool rgrl_invariant_single_landmark::has_region ( ) const [inline, virtual]

Return true if the feature has an initial ROI.

Reimplemented from rgrl_invariant.

Definition at line 82 of file rgrl_invariant_single_landmark.h.

void rgrl_object::invoke_event ( const rgrl_event event) [inherited]

Call execute(.) on all the rgrl_commands observing this event id.

Definition at line 69 of file rgrl_object.cxx.

void rgrl_object::invoke_event ( const rgrl_event event) const [inherited]

Call execute(.) on all the rgrl_commands observing this event id.

The actions triggered by this call doesn't modify this object.

Definition at line 83 of file rgrl_object.cxx.

bool rgrl_invariant_single_landmark::is_ambiguous ( ) const [inline]

Constellation ambiguity check.

Note:
constellations are ambiguous if one or more landmarks has a signature angle near 0 degrees, since angles near 0 could actually be near 360. The reverse is not flagged or corrected since this would lead to redundancy.

Definition at line 96 of file rgrl_invariant_single_landmark.h.

virtual bool rgrl_object::is_type ( const vcl_type_info &  type) const [inline, virtual, inherited]

Reimplemented in rgrl_scale_estimator.

Definition at line 66 of file rgrl_object.h.

const vnl_double_2 & rgrl_invariant_single_landmark::location ( ) const

Return the location.

Definition at line 109 of file rgrl_invariant_single_landmark.cxx.

rgrl_mask_box rgrl_invariant_single_landmark::region ( ) const [virtual]

Computes the valid match region for the constellation.

Reimplemented from rgrl_invariant.

Definition at line 146 of file rgrl_invariant_single_landmark.cxx.

void rgrl_object::remove_observer ( unsigned int  tag) [inherited]

Remove the observer with this tag value.

Definition at line 97 of file rgrl_object.cxx.

void rgrl_invariant_single_landmark::reorder_vessel ( vcl_vector< vnl_vector< double > > &  directions,
vcl_vector< double > &  local_widths,
vcl_vector< double > &  angles 
) [private]

A helper function to reorder selected indices of a landmark.

Note:
The indices are passed in by reference. The indices specified are reordered counterclockwise from the basis direction specified. The counterclockwise angles from the basis are also returned by reference.

Definition at line 326 of file rgrl_invariant_single_landmark.cxx.

rgrl_invariant::rgrl_type_macro ( rgrl_invariant  ,
rgrl_object   
) [inherited]
rgrl_invariant_single_landmark::rgrl_type_macro ( rgrl_invariant_single_landmark  ,
rgrl_invariant   
)
void rgrl_object::set_debug_flag ( unsigned int  debugFlag) const [inherited]

Set the value of the debug flag. A non-zero value turns debugging on.

Definition at line 19 of file rgrl_object.cxx.

void rgrl_object::set_warning ( bool  flag) const [inherited]

Set the flag for warning messages.

Definition at line 33 of file rgrl_object.cxx.

static const vcl_type_info& rgrl_object::type_id ( ) [inline, static, inherited]

Reimplemented in rgrl_scale_estimator.

Definition at line 63 of file rgrl_object.h.

bool rgrl_object::warning ( ) const [inherited]

Get the warning flag.

Definition at line 40 of file rgrl_object.cxx.


Member Data Documentation

Definition at line 122 of file rgrl_invariant_single_landmark.h.

vcl_vector<vnl_double_2> rgrl_invariant_single_landmark::boundary_points_ [private]

Definition at line 119 of file rgrl_invariant_single_landmark.h.

Definition at line 121 of file rgrl_invariant_single_landmark.h.

Definition at line 123 of file rgrl_invariant_single_landmark.h.

Definition at line 127 of file rgrl_invariant_single_landmark.h.

Definition at line 126 of file rgrl_invariant_single_landmark.h.

Definition at line 128 of file rgrl_invariant_single_landmark.h.

vcl_vector<double> rgrl_invariant_single_landmark::local_widths_ [private]

Definition at line 118 of file rgrl_invariant_single_landmark.h.

Definition at line 117 of file rgrl_invariant_single_landmark.h.

Definition at line 125 of file rgrl_invariant_single_landmark.h.

vcl_vector<vnl_double_2> rgrl_invariant_single_landmark::trace_normals_ [private]

Definition at line 120 of file rgrl_invariant_single_landmark.h.


The documentation for this class was generated from the following files: