Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends
rgrl_feature_trace_region Class Reference

Represent a point along a trace (of a vessel, neuron, etc.). More...

#include <rgrl_feature_trace_region.h>

Inheritance diagram for rgrl_feature_trace_region:
Inheritance graph
[legend]

List of all members.

Public Types

typedef vcl_vector
< rgrl_feature_sptr
feature_vector

Public Member Functions

 rgrl_feature_trace_region (vnl_vector< double > const &loc, vnl_vector< double > const &tangent)
 Constructor to initialize feature_trace_region location.
 rgrl_feature_trace_region (vnl_vector< double > const &loc, vnl_vector< double > const &tangent, double region_length, double region_radius)
 Constructor to initialize feature_trace_region location that has a length along the tangent and a normal.
rgrl_feature_sptr transform (rgrl_transformation const &xform) const
 The result is a rgrl_feature_trace_region, without transforming the radius/length parameters.
rgrl_feature_sptr transform_region (rgrl_transformation const &xform) const
 The result is a rgrl_feature_trace_region, with a transformation of the radius/length parameters.
unsigned int num_constraints () const
 Result is a vector of boundary locations in the direction of the normal in the plane defined by the tangent and in_direction.
 rgrl_type_macro (rgrl_feature_trace_region, rgrl_feature_trace_pt)
double region_length () const
double region_radius () const
virtual void generate_pixel_coordinates (vnl_vector< double > const &spacing_ratio)
 Extract the pixel coordinates within the oriented rectangular solid defined by the feature.
virtual bool read (vcl_istream &is, bool skip_tag=false)
 read in feature.
virtual void write (vcl_ostream &os) const
 write out feature.
virtual vnl_vector< double >
const & 
tangent () const
virtual vnl_matrix< double >
const & 
error_projector () const
 Projects the error to the normal space of the underlying surface.
virtual feature_vector boundary_points (vnl_vector< double > const &in_direction) const
 The result is a vector of boundary locations in the direction of the normal in the plane defined by the tangent and in_direction.
 rgrl_type_macro (rgrl_feature_trace_pt, rgrl_feature)
 rgrl_type_macro (rgrl_feature, rgrl_object)
virtual vnl_matrix< double >
const & 
normal_subspace ()
 Return a matrix whose columns form the subspace normal to the trace tangent.
double length () const
double radius () const
virtual double absolute_signature_weight (rgrl_feature_sptr other) const
 Compute the signature weight between two features.
virtual rgrl_feature_sptr clone () const
 make a clone copy.
vnl_vector< double > const & location () const
 Provide the geometric location.
void set_location (vnl_vector< double >const &loc)
 set location.
unsigned dim () const
double scale () const
 Provide the scale level at which this feature is detected.
void set_scale (double scale)
 Set the scale level at which this feature is detected.
virtual vnl_matrix< double >
const & 
error_projector_sqrt () const
 The square root of error projector is used to compute residual, which should not be squared.
virtual double geometric_error (rgrl_feature const &mapped_other) const
 Compute the geometric error distance between two features.
virtual double geometric_error (rgrl_transformation const &xform, rgrl_feature const &other) const
 Compute the geometric error distance between two features.
virtual bool allow_fast_computation_on_error () const
 When computing geometric error, allow only mapping of From location.
virtual vnl_vector< double > signature_error_vector (rgrl_feature const &other) const
 Compute the signature error vector between two features.
virtual unsigned signature_error_dimension (const vcl_type_info &other_feature_type) const
 If non-zero, the dimensions of the signature error vector.
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
virtual const vcl_vector
< vnl_vector< int > > & 
pixel_coordinates ()
virtual const vcl_vector
< vnl_vector< int > > & 
pixel_coordinates_ratio (vnl_vector< double > const &spacing_ratio)
 get pixels coordinates within the region.

Static Public Member Functions

static const vcl_type_info & type_id ()

Protected Attributes

vnl_vector< double > tangent_
vnl_matrix< double > error_proj_
vnl_vector< double > location_
double scale_
bool pixel_coordinates_cached_
vcl_vector< vnl_vector< int > > pixel_coordinates_
vnl_vector< double > spacing_ratio_

Private Member Functions

 rgrl_feature_trace_region ()
 Create an uninitialized feature with enough space to store a dim dimensional feature.

Private Attributes

double region_length_
double region_radius_

Friends

class rgrl_feature_reader
rgrl_feature_sptr rgrl_feature_reader (vcl_istream &is)
 Read a feature from input stream.

Detailed Description

Represent a point along a trace (of a vessel, neuron, etc.).

A trace point is characterized by a location and a tangent along the trace.

Definition at line 17 of file rgrl_feature_trace_region.h.


Member Typedef Documentation

Reimplemented from rgrl_feature_trace_pt.

Definition at line 21 of file rgrl_feature_trace_region.h.


Constructor & Destructor Documentation

rgrl_feature_trace_region::rgrl_feature_trace_region ( vnl_vector< double > const &  loc,
vnl_vector< double > const &  tangent 
)

Constructor to initialize feature_trace_region location.

Definition at line 15 of file rgrl_feature_trace_region.cxx.

rgrl_feature_trace_region::rgrl_feature_trace_region ( vnl_vector< double > const &  loc,
vnl_vector< double > const &  tangent,
double  region_length,
double  region_radius 
)

Constructor to initialize feature_trace_region location that has a length along the tangent and a normal.

Definition at line 23 of file rgrl_feature_trace_region.cxx.

rgrl_feature_trace_region::rgrl_feature_trace_region ( ) [private]

Create an uninitialized feature with enough space to store a dim dimensional feature.

The error projection matrix is initialized to the identity.

Definition at line 34 of file rgrl_feature_trace_region.cxx.


Member Function Documentation

double rgrl_feature_trace_pt::absolute_signature_weight ( rgrl_feature_sptr  other) const [virtual, inherited]

Compute the signature weight between two features.

Reimplemented from rgrl_feature.

Definition at line 158 of file rgrl_feature_trace_pt.cxx.

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.

virtual bool rgrl_feature::allow_fast_computation_on_error ( ) const [inline, virtual, inherited]

When computing geometric error, allow only mapping of From location.

Otherwise, a mapped feature will be created, which is much more heavy

Definition at line 116 of file rgrl_feature.h.

rgrl_feature_trace_pt::feature_vector rgrl_feature_trace_pt::boundary_points ( vnl_vector< double > const &  in_direction) const [virtual, inherited]

The result is a vector of boundary locations in the direction of the normal in the plane defined by the tangent and in_direction.

CAVEAT: This design is not good enough for 3D trace points, since it only produces 2 boundary constraints. This function should be revised later for 3D.

Chuck's comment: I'm not sure this should be here. It can easily be extracted in an arbitrary set of dimensions from a normal subspace and the radius.

Definition at line 126 of file rgrl_feature_trace_pt.cxx.

rgrl_feature_sptr rgrl_feature_trace_pt::clone ( ) const [virtual, inherited]

make a clone copy.

Implements rgrl_feature.

Definition at line 255 of file rgrl_feature_trace_pt.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.

unsigned rgrl_feature::dim ( ) const [inline, inherited]

Definition at line 59 of file rgrl_feature.h.

vnl_matrix< double > const & rgrl_feature_trace_pt::error_projector ( ) const [virtual, inherited]

Projects the error to the normal space of the underlying surface.

This matrix essentially describes the underlying surface from which this feature arises. For a normal point, this would be the identity matrix, implying that all dimensions of the error vector are significant. For a point on a curve, this matrix could remove this component of the error in the tangential direction, because we are only interested in the error normal to the curve.

Defaults to the identity matrix.

Implements rgrl_feature.

Definition at line 71 of file rgrl_feature_trace_pt.cxx.

vnl_matrix< double > const & rgrl_feature::error_projector_sqrt ( ) const [virtual, inherited]

The square root of error projector is used to compute residual, which should not be squared.

The error projector itself is usually used in least-squares estimation.

Reimplemented in rgrl_feature_landmark, rgrl_feature_point, and rgrl_feature_face_pt.

Definition at line 47 of file rgrl_feature.cxx.

void rgrl_feature_trace_region::generate_pixel_coordinates ( vnl_vector< double > const &  spacing_ratio) [virtual]

Extract the pixel coordinates within the oriented rectangular solid defined by the feature.

Implements rgrl_feature_region.

Definition at line 134 of file rgrl_feature_trace_region.cxx.

double rgrl_feature::geometric_error ( rgrl_feature const &  mapped_other) const [virtual, inherited]

Compute the geometric error distance between two features.

Definition at line 14 of file rgrl_feature.cxx.

double rgrl_feature::geometric_error ( rgrl_transformation const &  xform,
rgrl_feature const &  other 
) const [virtual, inherited]

Compute the geometric error distance between two features.

Use this function for efficiency. If a mapped feature is created, use the other function

Definition at line 21 of file rgrl_feature.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.

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.

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.

double rgrl_feature_trace_pt::length ( ) const [inline, inherited]

Definition at line 80 of file rgrl_feature_trace_pt.h.

vnl_vector<double> const& rgrl_feature::location ( ) const [inline, inherited]

Provide the geometric location.

Definition at line 52 of file rgrl_feature.h.

vnl_matrix< double > const & rgrl_feature_trace_pt::normal_subspace ( ) [virtual, inherited]

Return a matrix whose columns form the subspace normal to the trace tangent.

Definition at line 107 of file rgrl_feature_trace_pt.cxx.

unsigned int rgrl_feature_trace_region::num_constraints ( ) const [virtual]

Result is a vector of boundary locations in the direction of the normal in the plane defined by the tangent and in_direction.

// CAVEAT: This design is not good enough for 3D trace points, since it only // produces 2 boundary constraints. This function should be revised // later for 3D. // // Chuck's comment: I'm not sure this should be here. It can // easily be extracted in an arbitrary set of dimensions from a // normal subspace and the radius. feature_vector boundary_points(vnl_vector<double> const& in_direction) const;

Reimplemented from rgrl_feature_trace_pt.

Definition at line 43 of file rgrl_feature_trace_region.cxx.

const vcl_vector< vnl_vector< int > > & rgrl_feature_region::pixel_coordinates ( ) [virtual, inherited]

Definition at line 14 of file rgrl_feature_region.cxx.

vcl_vector< vnl_vector< int > > const & rgrl_feature_region::pixel_coordinates_ratio ( vnl_vector< double > const &  spacing_ratio) [virtual, inherited]

get pixels coordinates within the region.

Definition at line 33 of file rgrl_feature_region.cxx.

double rgrl_feature_trace_pt::radius ( ) const [inline, inherited]

Definition at line 81 of file rgrl_feature_trace_pt.h.

bool rgrl_feature_trace_pt::read ( vcl_istream &  is,
bool  skip_tag = false 
) [virtual, inherited]

read in feature.

Implements rgrl_feature.

Definition at line 200 of file rgrl_feature_trace_pt.cxx.

double rgrl_feature_trace_region::region_length ( ) const [inline]

Definition at line 58 of file rgrl_feature_trace_region.h.

double rgrl_feature_trace_region::region_radius ( ) const [inline]

Definition at line 59 of file rgrl_feature_trace_region.h.

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.

rgrl_feature_trace_region::rgrl_type_macro ( rgrl_feature_trace_region  ,
rgrl_feature_trace_pt   
)
rgrl_feature_trace_pt::rgrl_type_macro ( rgrl_feature_trace_pt  ,
rgrl_feature   
) [inherited]
rgrl_feature::rgrl_type_macro ( rgrl_feature  ,
rgrl_object   
) [inherited]
double rgrl_feature::scale ( ) const [inline, inherited]

Provide the scale level at which this feature is detected.

If no associated scale, return 0

Definition at line 64 of file rgrl_feature.h.

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_feature::set_location ( vnl_vector< double >const &  loc) [inline, inherited]

set location.

Definition at line 56 of file rgrl_feature.h.

void rgrl_feature::set_scale ( double  scale) [inline, inherited]

Set the scale level at which this feature is detected.

Definition at line 68 of file rgrl_feature.h.

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

Set the flag for warning messages.

Definition at line 33 of file rgrl_object.cxx.

unsigned rgrl_feature::signature_error_dimension ( const vcl_type_info &  other_feature_type) const [virtual, inherited]

If non-zero, the dimensions of the signature error vector.

The dimension depends on the other feature type. Defaults to 0.

Reimplemented in rgrl_feature_face_pt.

Definition at line 38 of file rgrl_feature.cxx.

vnl_vector< double > rgrl_feature::signature_error_vector ( rgrl_feature const &  other) const [virtual, inherited]

Compute the signature error vector between two features.

The result is invalid if signature_error_dimension() is false (0).

A signature vector stores a set of properties associated with the feature. Take the trace point on a vessel for example. The possible properties include the normal to the vessel and the vessel width at the give trace point. A feature can return different type of signature_error_vector, depending on the type of the other feature.

A signature_error_vector describes the "difference" between two features. It is important for the computation of robust signature/similarity weight. The robust weight depends on the weight distribution of all matches involved in the estimation of the transformation.

CAVEAT: We assume the signature_error_vector has zero-mean.

Reimplemented in rgrl_feature_face_pt.

Definition at line 30 of file rgrl_feature.cxx.

vnl_vector< double > const & rgrl_feature_trace_pt::tangent ( ) const [virtual, inherited]

Definition at line 63 of file rgrl_feature_trace_pt.cxx.

rgrl_feature_sptr rgrl_feature_trace_region::transform ( rgrl_transformation const &  xform) const [virtual]

The result is a rgrl_feature_trace_region, without transforming the radius/length parameters.

Reimplemented from rgrl_feature_trace_pt.

Definition at line 50 of file rgrl_feature_trace_region.cxx.

rgrl_feature_sptr rgrl_feature_trace_region::transform_region ( rgrl_transformation const &  xform) const

The result is a rgrl_feature_trace_region, with a transformation of the radius/length parameters.

Definition at line 80 of file rgrl_feature_trace_region.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.

void rgrl_feature_trace_pt::write ( vcl_ostream &  os) const [virtual, inherited]

write out feature.

Implements rgrl_feature.

Definition at line 183 of file rgrl_feature_trace_pt.cxx.


Friends And Related Function Documentation

friend class rgrl_feature_reader [friend, inherited]

Reimplemented from rgrl_feature.

Definition at line 94 of file rgrl_feature_trace_pt.h.

rgrl_feature_sptr rgrl_feature_reader ( vcl_istream &  is) [friend, inherited]

Read a feature from input stream.

The type of feature depends on the content of the input stream. NULL smart ptr is returned if reading fails. Please check the validity of the return smart ptr

Read a feature from input stream.

NULL smart ptr is returned if the reading operation fails. Please check the validity of the returned smart ptr.

Definition at line 90 of file rgrl_feature_reader.cxx.


Member Data Documentation

vnl_matrix<double> rgrl_feature_trace_pt::error_proj_ [protected, inherited]

Definition at line 107 of file rgrl_feature_trace_pt.h.

vnl_vector<double> rgrl_feature::location_ [protected, inherited]

Definition at line 167 of file rgrl_feature.h.

vcl_vector< vnl_vector<int> > rgrl_feature_region::pixel_coordinates_ [protected, inherited]

Definition at line 46 of file rgrl_feature_region.h.

Definition at line 45 of file rgrl_feature_region.h.

Definition at line 84 of file rgrl_feature_trace_region.h.

Definition at line 87 of file rgrl_feature_trace_region.h.

double rgrl_feature::scale_ [protected, inherited]

Definition at line 168 of file rgrl_feature.h.

vnl_vector< double > rgrl_feature_region::spacing_ratio_ [protected, inherited]

Definition at line 47 of file rgrl_feature_region.h.

vnl_vector<double> rgrl_feature_trace_pt::tangent_ [protected, inherited]

Definition at line 106 of file rgrl_feature_trace_pt.h.


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