/Users/bernard/b20/bsoft/src/util/marker.cpp(3)

NAME
/Users/bernard/b20/bsoft/src/util/marker.cpp - Functions for dealing with markers and linkers.

SYNOPSIS

#include 'rwmodel.h'
#include 'marker.h'
#include 'matrix_linear.h'
#include 'Matrix3.h'
#include 'Matrix.h'
#include 'ps_marker.h'
#include 'qsort_functions.h'
#include 'linked_list.h'
#include 'utilities.h'
#include 'timer.h'
#include <fstream>

  Functions
int markers_findOneToOne (Bmarker *refset, Bmarker *applyset)
double * markers_RoughMatch (Bmarker *setA, Bmarker *setB, double dist_cutoff)
int markers_sort_rel_distance (Bmarker *set, Bmarker *ref)
long marker_stats (Bmarker *markers)
Calculating marker statistics.
Bmarker * markers_copy (Bmarker *mark, int sel_flag)
Bmarker * markers_copy (Bmarker *mark)
Copies a set of markers.
Bmarker * markers_copy_selected (Bmarker *mark)
Copies a set of markers based on selection.
long markers_add (Bmarker **mark, Bmarker *mark2, double mindist, int sel)
Adds a set of markers to another.
long markers_delete_non_selected (Bmarker **mark)
Deletes markers not selected.
int marker_shift (Bmarker *markers, Vector3< double > shift)
Shifting markers.
int marker_scale (Bmarker *markers, Vector3< double > scale)
Scaling markers.
int marker_transform (Bmarker *markers, Transform t)
Transforming markers.
double marker_compare (Bmarker *mark1, Bmarker *mark2)
Compare marker sets and calculates the root-mean-square deviation.
Matrix3 marker_find_matrix (Bmarker *markers1, Bmarker *markers2, Vector3< double > origin1, Vector3< double > origin2)
Determines the rotation matrix between two sets of markers.
Transform marker_find_transform (Bmarker *markers1, Bmarker *markers2, Vector3< double > origin)
Determines the rotation matrix between two sets of markers.
Transform markers_find_rottrans (Bmarker *set1, Bmarker *set2, double tolerance)
Finds the rotation and shift between two sets of vectors.
Transform * markers_map_and_find_transform (Bmarker **set, int nseries, int refset, Vector3< long > size)
This function finds the transform parameters between sets of coordinates. These sets are expected to have a large intersection, but do not have to be 1 to 1.
long markers_limit (int target_num, int sign, Bmarker **set)
This method constricts a marker set to target_num points.
Bmodel * model_from_markers (Bmarker *markers, Vector3< double > origin, Vector3< double > sam)
Convert markers to a model.
int marker_plane (Bmarker *markers, Vector3< double > origin)
Fits a plane to a set of markers.
Bmarker * markers_sort_by_id (Bmarker **mark)
Sorts a set of markers by ID number.
long markers_renumber (Bmarker *mark)
Renumbers a set of markers.
long markers_center (Bmarker *mark, Vector3< double > center)
Centers a set of markers.
Bmarker * marker_set_at_radius (double rad, double ainc)
Generates a marker set at a given radius with z=0.
int marker_sets_to_bild (Bstring &filename, Bmarker *mark1, Bmarker *mark2)
Generates a bild file with the two marker sets.

  Variables
int verbose

Detailed Description

Functions for dealing with markers and linkers.

Author:
    Bernard Heymann

Date:
    Created: 20020619

    Modified: 20170823

Definition in file marker.cpp.

Function Documentation

  double marker_compare (Bmarker * mark1, Bmarker * mark2)

Compare marker sets and calculates the root-mean-square deviation.

Parameters:
    *mark1 linked list of markers.
    *mark2 linked list of markers.

Returns:
    double RMSD.

Definition at line 248 of file marker.cpp.

  Matrix3 marker_find_matrix (Bmarker * markers1, Bmarker * markers2, Vector3< double > origin1, Vector3< double > origin2)

Determines the rotation matrix between two sets of markers.

Parameters:
    *markers1 linked list of markers.
    *markers2 linked list of markers.
    origin1 origin of first set.
    origin2 origin of second set.

Returns:
    Matrix3 rotation matrix.

    The function calculates the rotation matrix required to superimposed
    the first set onto the second set.
    Requirement: The two marker sets must share a significant number of markers.

Definition at line 279 of file marker.cpp.

  Transform marker_find_transform (Bmarker * markers1, Bmarker * markers2, Vector3< double > origin)

Determines the rotation matrix between two sets of markers.

Parameters:
    *markers1 linked list of markers.
    *markers2 linked list of markers.
    origin origin of rotation.

Returns:
    Transform transform structure.

    The function calculates the rotation matrix required to superimposed
    the first set onto the second set.
    Requirement: The two marker sets must share a significant number of markers.

Definition at line 346 of file marker.cpp.

  int marker_plane (Bmarker * markers, Vector3< double > origin)

Fits a plane to a set of markers.

Parameters:
    *markers linked list of markers.
    origin marker origin.

Returns:
    int 0.

    The plane is given by:
        a*x + b*y + c*z = d
    The fit is assessed by calculating the distance of each marker to
    the plane:
        R = sqrt(sum(|a*x + b*y + c*z - d|^2)/n)

Definition at line 1042 of file marker.cpp.

  int marker_scale (Bmarker * markers, Vector3< double > scale)

Scaling markers.

Parameters:
    *markers linked list of markers.
    scale scale vector.

Returns:
    int error code (<0 means failure).

Definition at line 208 of file marker.cpp.

  Bmarker* marker_set_at_radius (double rad, double ainc)

Generates a marker set at a given radius with z=0.

Parameters:
    rad radius.
    ainc angular increment.

Returns:
    int 0, <0 on error.

    Markers are generated at the given radius and angular increments.

Definition at line 1208 of file marker.cpp.

  int marker_sets_to_bild (Bstring & filename, Bmarker * mark1, Bmarker * mark2)

Generates a bild file with the two marker sets.

Parameters:
    &filename bild format file name.
    *mark1 marker list 1.
    *mark2 marker list 2.

Returns:
    int 0, <0 on error.

    A sphere is drawn for every marker.
    The first set is red and the second set is blue.

Definition at line 1237 of file marker.cpp.

  int marker_shift (Bmarker * markers, Vector3< double > shift)

Shifting markers.

Parameters:
    *markers linked list of markers.
    shift shift vector.

Returns:
    int error code (<0 means failure).

Definition at line 192 of file marker.cpp.

  long marker_stats (Bmarker * markers)

Calculating marker statistics.

Parameters:
    *markers list of markers.

Returns:
    long number of markers (<0 means failure).

Definition at line 34 of file marker.cpp.

  int marker_transform (Bmarker * markers, Transform t)

Transforming markers.

Parameters:
    *markers linked list of markers.
    t transform structure.

Returns:
    int number of markers.

Definition at line 226 of file marker.cpp.

  long markers_add (Bmarker ** mark, Bmarker * mark2, double mindist, int sel)

Adds a set of markers to another.

Parameters:
    **mark marker list.
    *mark2 marker list to add.
    mindist minimum distance between markers.
    sel selection flag to set for second list.

Returns:
    Bmarker* new marker list.

    The second list of markers are checked to eliminate those close to
    markers in the first set. The remaining markers are then added and
    their selection flags set if the variable sel is greater than zero.

Definition at line 120 of file marker.cpp.

  long markers_center (Bmarker * mark, Vector3< double > center)

Centers a set of markers.

Parameters:
    **mark pointer to marker list.
    center center to shift to.

Returns:
    long number of markers.

    The marker center is calculated and the all markers shifted by the
    difference with the target center.

Definition at line 1176 of file marker.cpp.

  Bmarker* markers_copy (Bmarker * mark, int sel_flag)

Definition at line 61 of file marker.cpp.

  Bmarker* markers_copy (Bmarker * mark)

Copies a set of markers.

Parameters:
    *mark marker list.

Returns:
    Bmarker* new marker list.

Definition at line 92 of file marker.cpp.

  Bmarker* markers_copy_selected (Bmarker * mark)

Copies a set of markers based on selection.

Parameters:
    *mark marker list.

Returns:
    Bmarker* new marker list.

Definition at line 102 of file marker.cpp.

  long markers_delete_non_selected (Bmarker ** mark)

Deletes markers not selected.

Parameters:
    **mark pointer to marker list.

Returns:
    long number of remaining markers.

Definition at line 159 of file marker.cpp.

  Transform markers_find_rottrans (Bmarker * set1, Bmarker * set2, double tolerance)

Finds the rotation and shift between two sets of vectors.

Parameters:
    *set1 first coordinate set.
    *set2 second coordinate set.
    tolerance acceptable deviation for fit.

Returns:
    Transform structure with shift, scale, rotation angle, and R factor.

    A large number of angles is tested and the shift calculated at each angle.
    The best angle is selected based on the sum of the standard deviations of
    the x, y and z shifts.
    Outliers are iteratively removed until the shift standard deviations drop
    below a tolerance value.
    The angle returned is the rotation applied to the first set to obtain
    an estimate of the second set.
    Requirement: The two sets must have the same number of points.

Definition at line 416 of file marker.cpp.

  int markers_findOneToOne (Bmarker * refset, Bmarker * applyset)

Definition at line 642 of file marker.cpp.

  long markers_limit (int target_num, int sign, Bmarker ** set)

This method constricts a marker set to target_num points.

Author:
    Samuel Payne

Parameters:
    target_num number of points desired in set.
    sign sign to direct sorting.
    **set pointer to set containing all the points.

Returns:
    long number of points selected.

    This finds the target_num darkest points in the set.  The extreme
    grey scale value associated with each point is held in value field
    of the Point structure.  This is copied into an array and sorted. The
    cutoff value is the target_num index in the array.  A new array of
    points is created containing points below the cutoff and then returned.

Definition at line 909 of file marker.cpp.

  Transform* markers_map_and_find_transform (Bmarker ** set, int nseries, int refset, Vector3< long > size)

This function finds the transform parameters between sets of coordinates. These sets are expected to have a large intersection, but do not have to be 1 to 1.

Author:
    Samuel Payne

Parameters:
    **set set of coordinates from images to be aligned.
    nseries number of images in the set.
    refset reference set number.
    size size of images/frames of sets.

Returns:
    Transform* list with shift, scale, rotation angle, and R factor.

    Gets a one to one mapping of the two coordinate sets using
    markers_find_rottrans to compare pairs of sets.
    A postscript file is made to graphically show the deviations of each
    point from its calculated position.
    Assumptions: This assumes each set has been sorted according to
    distance from the center of the set.

Definition at line 585 of file marker.cpp.

  long markers_renumber (Bmarker * mark)

Renumbers a set of markers.

Parameters:
    **mark pointer to marker list.

Returns:
    long number of markers.

Definition at line 1150 of file marker.cpp.

  double * markers_RoughMatch (Bmarker * setA, Bmarker * setB, double dist_cutoff)

Definition at line 763 of file marker.cpp.

  Bmarker* markers_sort_by_id (Bmarker ** mark)

Sorts a set of markers by ID number.

Parameters:
    **mark pointer to marker list.

Returns:
    Bmarker* new pointer to marker list.

Definition at line 1104 of file marker.cpp.

  int markers_sort_rel_distance (Bmarker * set, Bmarker * ref)

Definition at line 966 of file marker.cpp.

  Bmodel* model_from_markers (Bmarker * markers, Vector3< double > origin, Vector3< double > sam)

Convert markers to a model.

Parameters:
    *markers linked list of markers.
    origin marker origin.
    sam scaling marker coordinates.

Returns:
    Bmodel* new model.

Definition at line 1002 of file marker.cpp.

Variable Documentation

  int verbose

Author

Generated automatically by Doxygen for Bsoft from the source code.