Generates shapes displaying modes of a shape model. More...
#include <msm_shape_mode_view.h>
Public Member Functions | |
msm_shape_mode_view () | |
Dflt ctor. | |
virtual | ~msm_shape_mode_view () |
Destructor. | |
void | set_shape_model (const msm_ref_shape_model &) |
Define shape model. | |
const msm_ref_shape_model & | shape_model () const |
Current shape model. | |
bool | overlap_shapes () const |
When true, overlap all the shapes to highlight changes. | |
void | set_overlap_shapes (bool b) |
When true, overlap all the shapes. | |
const vcl_vector< msm_points > & | points () const |
Current array of sets of points. | |
void | compute_shapes (unsigned n_shapes, double range, bool vary_one) |
Compute the shapes so they fit into current window. | |
void | compute_shapes () |
Compute the shapes so they fit into current window. | |
void | set_display_window (const vgl_box_2d< int > &win) |
Define current display window size. | |
void | set_display_width (double) |
Define width of display region for a single shape. | |
const vgl_box_2d< int > & | display_window () const |
Current display window. | |
void | set_mode (unsigned m) |
Define current mode to use. | |
unsigned | mode () const |
Current mode. | |
void | set_n_per_mode (unsigned n) |
Define number of shapes per mode. | |
unsigned | n_per_mode () const |
Current number of shapes per mode. | |
unsigned | max_modes () const |
Maximum number of shape modes available. | |
void | set_range (double r) |
Set range (in units of SD). | |
double | range () const |
Get range (in units of SD). | |
Private Attributes | |
const msm_ref_shape_model * | shape_model_ |
msm_ref_shape_instance | sm_inst_ |
vnl_vector< double > | b_sd_ |
vnl_vector< double > | b_ |
vcl_vector< msm_points > | points_ |
unsigned | n_per_mode_ |
Number of shapes for each mode. | |
unsigned | mode_ |
Current mode. | |
double | sd_range_ |
Range in units of sd. | |
double | rel_scale_ |
Scale relative to optimal scale to fit shapes to window. | |
bool | overlap_shapes_ |
When true, overlap all the shapes. | |
vgl_box_2d< int > | display_win_ |
Generates shapes displaying modes of a shape model.
Generates a set of shapes by varying one model parameter, placing shapes in a row. This is useful for display programs.
Essentially two modes of output can be generated. The shapes are either all overlapping (suitable for showing change if plotted all together, or for generating a moving if plotted sequentially), or are arranged in a row (useful for creating a picture for a document). Use set_overlap_shapes(bool) to select which mode is required.
Definition at line 24 of file msm_shape_mode_view.h.
msm_shape_mode_view::msm_shape_mode_view | ( | ) |
Dflt ctor.
Definition at line 18 of file msm_shape_mode_view.cxx.
virtual msm_shape_mode_view::~msm_shape_mode_view | ( | ) | [inline, virtual] |
Destructor.
Definition at line 57 of file msm_shape_mode_view.h.
void msm_shape_mode_view::compute_shapes | ( | unsigned | n_shapes, |
double | range, | ||
bool | vary_one | ||
) |
Compute the shapes so they fit into current window.
n_shapes | Number of shapes to display |
range | Range (in sd) to vary shapes by |
vary_one | If one shape and this is true then use range as parameter, else use 0 |
Definition at line 93 of file msm_shape_mode_view.cxx.
void msm_shape_mode_view::compute_shapes | ( | ) |
Compute the shapes so they fit into current window.
Definition at line 87 of file msm_shape_mode_view.cxx.
const vgl_box_2d<int>& msm_shape_mode_view::display_window | ( | ) | const [inline] |
Current display window.
Definition at line 94 of file msm_shape_mode_view.h.
unsigned msm_shape_mode_view::max_modes | ( | ) | const |
Maximum number of shape modes available.
Definition at line 219 of file msm_shape_mode_view.cxx.
unsigned msm_shape_mode_view::mode | ( | ) | const [inline] |
Current mode.
Definition at line 102 of file msm_shape_mode_view.h.
unsigned msm_shape_mode_view::n_per_mode | ( | ) | const [inline] |
Current number of shapes per mode.
Definition at line 108 of file msm_shape_mode_view.h.
bool msm_shape_mode_view::overlap_shapes | ( | ) | const [inline] |
When true, overlap all the shapes to highlight changes.
Definition at line 66 of file msm_shape_mode_view.h.
const vcl_vector<msm_points>& msm_shape_mode_view::points | ( | ) | const [inline] |
Current array of sets of points.
These are the shapes to be displayed
Definition at line 73 of file msm_shape_mode_view.h.
double msm_shape_mode_view::range | ( | ) | const [inline] |
Get range (in units of SD).
Definition at line 117 of file msm_shape_mode_view.h.
void msm_shape_mode_view::set_display_width | ( | double | width | ) |
Define width of display region for a single shape.
Height estimated from aspect ratio of mean shape Width of display window is then a multiple of this, depending on the number of shapes along the row.
Definition at line 62 of file msm_shape_mode_view.cxx.
void msm_shape_mode_view::set_display_window | ( | const vgl_box_2d< int > & | win | ) |
Define current display window size.
Definition at line 182 of file msm_shape_mode_view.cxx.
void msm_shape_mode_view::set_mode | ( | unsigned | m | ) |
Define current mode to use.
Mode=1 is first shape mode
Definition at line 191 of file msm_shape_mode_view.cxx.
void msm_shape_mode_view::set_n_per_mode | ( | unsigned | n | ) |
Define number of shapes per mode.
Definition at line 208 of file msm_shape_mode_view.cxx.
void msm_shape_mode_view::set_overlap_shapes | ( | bool | b | ) |
When true, overlap all the shapes.
When true, overlap all the shapes to highlight changes.
Definition at line 31 of file msm_shape_mode_view.cxx.
void msm_shape_mode_view::set_range | ( | double | r | ) |
Set range (in units of SD).
Definition at line 228 of file msm_shape_mode_view.cxx.
void msm_shape_mode_view::set_shape_model | ( | const msm_ref_shape_model & | sm | ) |
Define shape model.
Definition at line 42 of file msm_shape_mode_view.cxx.
const msm_ref_shape_model & msm_shape_mode_view::shape_model | ( | ) | const |
Current shape model.
Definition at line 80 of file msm_shape_mode_view.cxx.
vnl_vector<double> msm_shape_mode_view::b_ [private] |
Definition at line 30 of file msm_shape_mode_view.h.
vnl_vector<double> msm_shape_mode_view::b_sd_ [private] |
Definition at line 29 of file msm_shape_mode_view.h.
vgl_box_2d<int> msm_shape_mode_view::display_win_ [private] |
Definition at line 49 of file msm_shape_mode_view.h.
unsigned msm_shape_mode_view::mode_ [private] |
Current mode.
Definition at line 38 of file msm_shape_mode_view.h.
unsigned msm_shape_mode_view::n_per_mode_ [private] |
Number of shapes for each mode.
Definition at line 35 of file msm_shape_mode_view.h.
bool msm_shape_mode_view::overlap_shapes_ [private] |
When true, overlap all the shapes.
Definition at line 47 of file msm_shape_mode_view.h.
vcl_vector<msm_points> msm_shape_mode_view::points_ [private] |
Definition at line 32 of file msm_shape_mode_view.h.
double msm_shape_mode_view::rel_scale_ [private] |
Scale relative to optimal scale to fit shapes to window.
Definition at line 44 of file msm_shape_mode_view.h.
double msm_shape_mode_view::sd_range_ [private] |
Range in units of sd.
Definition at line 41 of file msm_shape_mode_view.h.
const msm_ref_shape_model* msm_shape_mode_view::shape_model_ [private] |
Definition at line 26 of file msm_shape_mode_view.h.
Definition at line 27 of file msm_shape_mode_view.h.