![]() |
Bsoft 2.1.4
Bernard's software package
|
Functions for dealing with markers and linkers. More...
#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. More... | |
Vector3< double > | marker_minimum (Bmarker *markers) |
Calculating the minimum marker location. More... | |
Vector3< double > | marker_maximum (Bmarker *markers) |
Calculating the maximum marker location. More... | |
Vector3< double > | marker_range (Bmarker *markers) |
Calculating the marker location range. More... | |
Bmarker * | markers_copy (Bmarker *mark, int sel_flag) |
Copies a set of markers. More... | |
Bmarker * | markers_copy (Bmarker *mark) |
Copies a set of markers. More... | |
Bmarker * | markers_copy_selected (Bmarker *mark) |
Copies a set of markers based on selection. More... | |
long | markers_add (Bmarker **mark, Bmarker *mark2, double mindist, int sel) |
Adds a set of markers to another. More... | |
long | markers_delete_non_selected (Bmarker **mark) |
Deletes markers not selected. More... | |
int | marker_shift (Bmarker *markers, Vector3< double > shift) |
Shifting markers. More... | |
int | marker_scale (Bmarker *markers, Vector3< double > scale) |
Scaling markers. More... | |
int | marker_transform (Bmarker *markers, Transform t) |
Transforming markers. More... | |
double | marker_compare (Bmarker *mark1, Bmarker *mark2) |
Compare marker sets and calculates the root-mean-square deviation. More... | |
Matrix3 | marker_find_matrix (Bmarker *markers1, Bmarker *markers2, Vector3< double > origin1, Vector3< double > origin2) |
Determines the rotation matrix between two sets of markers. More... | |
Transform | marker_find_transform (Bmarker *markers1, Bmarker *markers2, Vector3< double > origin) |
Determines the rotation matrix between two sets of markers. More... | |
Transform | markers_find_rottrans (Bmarker *set1, Bmarker *set2, double tolerance) |
Finds the rotation and shift between two sets of vectors. More... | |
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. More... | |
long | markers_limit (int target_num, int sign, Bmarker **set) |
This method constricts a marker set to target_num points. More... | |
Bmodel * | model_from_markers (Bmarker *markers, Vector3< double > origin, Vector3< double > sam) |
Convert markers to a model. More... | |
Vector3< double > | marker_plane (Bmarker *markers, Vector3< double > origin) |
Fits a plane to a set of markers. More... | |
Bmarker * | markers_sort_by_id (Bmarker **mark) |
Sorts a set of markers by ID number. More... | |
long | markers_renumber (Bmarker *mark) |
Renumbers a set of markers. More... | |
long | markers_center (Bmarker *mark, Vector3< double > center) |
Centers a set of markers. More... | |
Bmarker * | marker_set_at_radius (double rad, double ainc) |
Generates a marker set at a given radius with z=0. More... | |
int | marker_sets_to_bild (Bstring &filename, Bmarker *mark1, Bmarker *mark2) |
Generates a bild file with the two marker sets. More... | |
Variables | |
int | verbose |
Functions for dealing with markers and linkers.
Compare marker sets and calculates the root-mean-square deviation.
*mark1 | linked list of markers. |
*mark2 | linked list of markers. |
Matrix3 marker_find_matrix | ( | Bmarker * | markers1, |
Bmarker * | markers2, | ||
Vector3< double > | origin1, | ||
Vector3< double > | origin2 | ||
) |
Determines the rotation matrix between two sets of markers.
*markers1 | linked list of markers. |
*markers2 | linked list of markers. |
origin1 | origin of first set. |
origin2 | origin of second set. |
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.
Transform marker_find_transform | ( | Bmarker * | markers1, |
Bmarker * | markers2, | ||
Vector3< double > | origin | ||
) |
Determines the rotation matrix between two sets of markers.
*markers1 | linked list of markers. |
*markers2 | linked list of markers. |
origin | origin of rotation. |
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.
Calculating the maximum marker location.
*markers | list of markers. |
Calculating the minimum marker location.
*markers | list of markers. |
Fits a plane to a set of markers.
*markers | linked list of markers. |
origin | marker origin. |
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)
Calculating the marker location range.
*markers | list of markers. |
Scaling markers.
*markers | linked list of markers. |
scale | scale vector. |
Bmarker * marker_set_at_radius | ( | double | rad, |
double | ainc | ||
) |
Generates a marker set at a given radius with z=0.
rad | radius. |
ainc | angular increment. |
Markers are generated at the given radius and angular increments.
Generates a bild file with the two marker sets.
&filename | bild format file name. |
*mark1 | marker list 1. |
*mark2 | marker list 2. |
A sphere is drawn for every marker. The first set is red and the second set is blue.
Shifting markers.
*markers | linked list of markers. |
shift | shift vector. |
long marker_stats | ( | Bmarker * | markers | ) |
Calculating marker statistics.
*markers | list of markers. |
Transforming markers.
*markers | linked list of markers. |
t | transform structure. |
Adds a set of markers to another.
**mark | marker list. |
*mark2 | marker list to add. |
mindist | minimum distance between markers. |
sel | selection flag to set for second 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.
Centers a set of markers.
**mark | pointer to marker list. |
center | center to shift to. |
The marker center is calculated and the all markers shifted by the difference with the target center.
Copies a set of markers.
*mark | marker list. |
Copies a set of markers.
*mark | marker list. |
sel_flag | flag for selection. |
Copies a set of markers based on selection.
*mark | marker list. |
long markers_delete_non_selected | ( | Bmarker ** | mark | ) |
Deletes markers not selected.
**mark | pointer to marker list. |
Finds the rotation and shift between two sets of vectors.
*set1 | first coordinate set. |
*set2 | second coordinate set. |
tolerance | acceptable deviation for fit. |
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.
long markers_limit | ( | int | target_num, |
int | sign, | ||
Bmarker ** | set | ||
) |
This method constricts a marker set to target_num points.
target_num | number of points desired in set. |
sign | sign to direct sorting. |
**set | pointer to set containing all the points. |
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.
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.
**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. |
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.
long markers_renumber | ( | Bmarker * | mark | ) |
Renumbers a set of markers.
**mark | pointer to marker list. |
Sorts a set of markers by ID number.
**mark | pointer to marker list. |
Convert markers to a model.
*markers | linked list of markers. |
origin | marker origin. |
sam | scaling marker coordinates. |
|
extern |