Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
rgrl_initializer_inv_indexing Class Reference

Generate the set of initial estimates using invariant indexing. More...

#include <rgrl_initializer_inv_indexing.h>

Inheritance diagram for rgrl_initializer_inv_indexing:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 rgrl_initializer_inv_indexing (rgrl_view_sptr prior_view, bool should_estimate_global_region=true, int max_num_matches_tried=-1)
 Constructor.
 rgrl_initializer_inv_indexing (rgrl_mask_sptr const &from_image_roi, rgrl_mask_sptr const &to_image_roi, rgrl_estimator_sptr xform_estimator=0, unsigned initial_resolution=0, bool should_estimate_global_region=true, int max_num_matches_tried=-1)
 ~rgrl_initializer_inv_indexing ()
 Destructor.
void add_data (vcl_vector< rgrl_invariant_sptr > const &fixed_set, vcl_vector< rgrl_invariant_sptr > const &moving_set, double nn_radius=0, unsigned int k_nn=1)
 Add the set of invariants from the fixed image and the set from one moving image.
virtual void add_multiple_data (vcl_vector< rgrl_invariant_sptr > const &fixed_set, vcl_vector< vcl_vector< rgrl_invariant_sptr > > const &moving_sets, double nn_radius=0, unsigned int k_nn=1)
 Add a set of invariants from the fixed image and multiple sets from multiple moving images.
void set_current_moving_image (unsigned int moving_image_index)
 Set the index of the current moving image. Default is the 0th moving-image.
const vcl_vector
< rgrl_invariant_match_sptr > & 
matches_for_moving_image (unsigned int moving_image_index)
 Return the matches for the given moving_image_index.
bool next_initial (rgrl_view_sptr &view, rgrl_scale_sptr &prior_scale)
 Get and remove the next initial estimate from the end of the list for the current moving_set.
bool next_initial (rgrl_invariant_match_sptr &best_match)
 Get and remove the next initial estimate from the end of the list for the current moving_set.
virtual int size () const
 return number of initializations.
 rgrl_type_macro (rgrl_initializer_inv_indexing, rgrl_initializer)
bool next_initial (rgrl_mask_sptr &from_image_roi, rgrl_mask_sptr &to_image_roi, rgrl_mask_box &current_region, rgrl_mask_box &global_region, rgrl_estimator_sptr &xform_estimator, rgrl_transformation_sptr &xform_estimate, unsigned &current_resolution, rgrl_scale_sptr &prior_scale)
 Get next set of initial information without the notion of a view.
bool next_initial (rgrl_mask_box &current_region, rgrl_estimator_sptr &xform_estimator, rgrl_transformation_sptr &xform_estimate, unsigned &current_resolution, rgrl_scale_sptr &prior_scale)
 Get next set of initial information, assuming current_region is the region of interest for registration.
bool next_initial (rgrl_mask_box &current_region, rgrl_estimator_sptr &xform_estimator, rgrl_transformation_sptr &xform_estimate, rgrl_scale_sptr &prior_scale)
 Get next set of initial information, assuming current_region is the region of interest for registration, and single-resol.
void set_prior_geometric_scale (double scale)
 force the setting of prior scale.
 rgrl_type_macro (rgrl_initializer, 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 ()

Protected Member Functions

rgrl_scale_sptr enforce_prior_scale (rgrl_scale_sptr match_scale)
 Generate a prior scale depending on current settings.

Protected Attributes

vcl_vector< vcl_vector
< rgrl_invariant_match_sptr > > 
matches_
rgrl_view_sptr view_
bool should_estimate_global_region_
unsigned int current_moving_image_ind_
int num_matches_tried_
int max_num_matches_tried_
rgrl_scale_sptr prior_scale_
bool use_prior_scale_from_match_

Detailed Description

Generate the set of initial estimates using invariant indexing.

The underlying data structure is rrel_kd_tree for k-dimensional invariant fields. The transformation model is determined by the invariant class. Therefore, no estimator is associated with the initializer.

Definition at line 25 of file rgrl_initializer_inv_indexing.h.


Constructor & Destructor Documentation

rgrl_initializer_inv_indexing::rgrl_initializer_inv_indexing ( rgrl_view_sptr  prior_view,
bool  should_estimate_global_region = true,
int  max_num_matches_tried = -1 
)

Constructor.

Definition at line 16 of file rgrl_initializer_inv_indexing.cxx.

rgrl_initializer_inv_indexing::rgrl_initializer_inv_indexing ( rgrl_mask_sptr const &  from_image_roi,
rgrl_mask_sptr const &  to_image_roi,
rgrl_estimator_sptr  xform_estimator = 0,
unsigned  initial_resolution = 0,
bool  should_estimate_global_region = true,
int  max_num_matches_tried = -1 
)

Definition at line 28 of file rgrl_initializer_inv_indexing.cxx.

rgrl_initializer_inv_indexing::~rgrl_initializer_inv_indexing ( ) [inline]

Destructor.

Definition at line 42 of file rgrl_initializer_inv_indexing.h.


Member Function Documentation

void rgrl_initializer_inv_indexing::add_data ( vcl_vector< rgrl_invariant_sptr > const &  fixed_set,
vcl_vector< rgrl_invariant_sptr > const &  moving_set,
double  nn_radius = 0,
unsigned int  k_nn = 1 
)

Add the set of invariants from the fixed image and the set from one moving image.

Matches are sorted in order of decreasing distance. nn_radius has precedence over k_nn. If no neighbor falls in nn_radius, k_nn are taken.

Parameters:
nn_radiusnearest-neighbors in nn_radius.
kk-nearest neighbor(s)

Definition at line 54 of file rgrl_initializer_inv_indexing.cxx.

void rgrl_initializer_inv_indexing::add_multiple_data ( vcl_vector< rgrl_invariant_sptr > const &  fixed_set,
vcl_vector< vcl_vector< rgrl_invariant_sptr > > const &  moving_sets,
double  nn_radius = 0,
unsigned int  k_nn = 1 
) [virtual]

Add a set of invariants from the fixed image and multiple sets from multiple moving images.

Matches are sorted in order of decreasing distance. nn_radius has precedence over k_nn. If no neighbor falls in nn_radius, k_nn are taken.

Parameters:
nn_radiusnearest-neighbors in nn_radius.
k_nnk-nearest-neighbor(s)

Definition at line 66 of file rgrl_initializer_inv_indexing.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.

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

Get the value of the debug flag.

Definition at line 26 of file rgrl_object.cxx.

rgrl_scale_sptr rgrl_initializer::enforce_prior_scale ( rgrl_scale_sptr  match_scale) [protected, inherited]

Generate a prior scale depending on current settings.

Definition at line 101 of file rgrl_initializer.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.

const vcl_vector< rgrl_invariant_match_sptr > & rgrl_initializer_inv_indexing::matches_for_moving_image ( unsigned int  moving_image_index)

Return the matches for the given moving_image_index.

Definition at line 136 of file rgrl_initializer_inv_indexing.cxx.

bool rgrl_initializer::next_initial ( rgrl_mask_sptr from_image_roi,
rgrl_mask_sptr to_image_roi,
rgrl_mask_box current_region,
rgrl_mask_box global_region,
rgrl_estimator_sptr xform_estimator,
rgrl_transformation_sptr xform_estimate,
unsigned &  current_resolution,
rgrl_scale_sptr prior_scale 
) [inherited]

Get next set of initial information without the notion of a view.

Definition at line 17 of file rgrl_initializer.cxx.

bool rgrl_initializer::next_initial ( rgrl_mask_box current_region,
rgrl_estimator_sptr xform_estimator,
rgrl_transformation_sptr xform_estimate,
unsigned &  current_resolution,
rgrl_scale_sptr prior_scale 
) [inherited]

Get next set of initial information, assuming current_region is the region of interest for registration.

Definition at line 43 of file rgrl_initializer.cxx.

bool rgrl_initializer::next_initial ( rgrl_mask_box current_region,
rgrl_estimator_sptr xform_estimator,
rgrl_transformation_sptr xform_estimate,
rgrl_scale_sptr prior_scale 
) [inherited]

Get next set of initial information, assuming current_region is the region of interest for registration, and single-resol.

Definition at line 63 of file rgrl_initializer.cxx.

bool rgrl_initializer_inv_indexing::next_initial ( rgrl_view_sptr view,
rgrl_scale_sptr prior_scale 
) [virtual]

Get and remove the next initial estimate from the end of the list for the current moving_set.

Implements rgrl_initializer.

Definition at line 143 of file rgrl_initializer_inv_indexing.cxx.

bool rgrl_initializer_inv_indexing::next_initial ( rgrl_invariant_match_sptr best_match)

Get and remove the next initial estimate from the end of the list for the current moving_set.

Return this match in best_match

Definition at line 194 of file rgrl_initializer_inv_indexing.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.

rgrl_initializer::rgrl_type_macro ( rgrl_initializer  ,
rgrl_object   
) [inherited]
rgrl_initializer_inv_indexing::rgrl_type_macro ( rgrl_initializer_inv_indexing  ,
rgrl_initializer   
)
void rgrl_initializer_inv_indexing::set_current_moving_image ( unsigned int  moving_image_index)

Set the index of the current moving image. Default is the 0th moving-image.

Definition at line 128 of file rgrl_initializer_inv_indexing.cxx.

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_initializer::set_prior_geometric_scale ( double  scale) [inherited]

force the setting of prior scale.

scale > 0 set to this scale value scale == 0 scale pointer is NULL, which indicates to use unwgted scale estimate scale < 0 use whatever scale set by the match

Definition at line 85 of file rgrl_initializer.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.

int rgrl_initializer_inv_indexing::size ( ) const [virtual]

return number of initializations.

-1 stands for unknown

Implements rgrl_initializer.

Definition at line 218 of file rgrl_initializer_inv_indexing.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 95 of file rgrl_initializer_inv_indexing.h.

Definition at line 92 of file rgrl_initializer_inv_indexing.h.

Definition at line 97 of file rgrl_initializer_inv_indexing.h.

Definition at line 96 of file rgrl_initializer_inv_indexing.h.

Reimplemented in rgrl_initializer_prior, and rgrl_initializer_reader.

Definition at line 86 of file rgrl_initializer.h.

Definition at line 94 of file rgrl_initializer_inv_indexing.h.

bool rgrl_initializer::use_prior_scale_from_match_ [protected, inherited]

Definition at line 87 of file rgrl_initializer.h.

Definition at line 93 of file rgrl_initializer_inv_indexing.h.


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