<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<section xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="_marker_8cpp">
<title>/Users/bernard/b20/bsoft/src/util/marker.cpp File Reference</title>
<indexterm><primary>/Users/bernard/b20/bsoft/src/util/marker.cpp</primary></indexterm>
<para>

<para>Functions for dealing with markers and linkers. </para>
 
</para>
<programlisting>#include &quot;rwmodel.h&quot;
#include &quot;marker.h&quot;
#include &quot;matrix_linear.h&quot;
#include &quot;Matrix3.h&quot;
#include &quot;Matrix.h&quot;
#include &quot;ps_marker.h&quot;
#include &quot;qsort_functions.h&quot;
#include &quot;linked_list.h&quot;
#include &quot;utilities.h&quot;
#include &quot;timer.h&quot;
#include &lt;fstream&gt;
</programlisting><simplesect>
    <title>Functions    </title>
        <itemizedlist>
            <listitem><para>int <link linkend="_marker_8cpp_1abb9f54663ab4c473a45863767c900158">markers_findOneToOne</link> (<link linkend="_struct_bmarker">Bmarker</link> *refset, <link linkend="_struct_bmarker">Bmarker</link> *applyset)</para>
</listitem>
            <listitem><para>double * <link linkend="_marker_8cpp_1a633889dd80f7ccc2787028169151776c">markers_RoughMatch</link> (<link linkend="_struct_bmarker">Bmarker</link> *setA, <link linkend="_struct_bmarker">Bmarker</link> *setB, double dist_cutoff)</para>
</listitem>
            <listitem><para>int <link linkend="_marker_8cpp_1a92f54bd05860c062fb0bae2a33dbfe91">markers_sort_rel_distance</link> (<link linkend="_struct_bmarker">Bmarker</link> *set, <link linkend="_struct_bmarker">Bmarker</link> *ref)</para>
</listitem>
            <listitem><para>long <link linkend="_marker_8cpp_1a5b4c8ce8df8122b30f6a7655c624be55">marker_stats</link> (<link linkend="_struct_bmarker">Bmarker</link> *markers)</para>

<para>Calculating marker statistics. </para>
</listitem>
            <listitem><para><link linkend="_struct_bmarker">Bmarker</link> * <link linkend="_marker_8cpp_1a2e2af9a9d51fc56caa5291ad10a3a85d">markers_copy</link> (<link linkend="_struct_bmarker">Bmarker</link> *mark, int sel_flag)</para>
</listitem>
            <listitem><para><link linkend="_struct_bmarker">Bmarker</link> * <link linkend="_marker_8cpp_1a1d9c5d31052da7fd9d0f3551141923cb">markers_copy</link> (<link linkend="_struct_bmarker">Bmarker</link> *mark)</para>

<para>Copies a set of markers. </para>
</listitem>
            <listitem><para><link linkend="_struct_bmarker">Bmarker</link> * <link linkend="_marker_8cpp_1ae787149d4f16ed8eb0f10d2a89f64f38">markers_copy_selected</link> (<link linkend="_struct_bmarker">Bmarker</link> *mark)</para>

<para>Copies a set of markers based on selection. </para>
</listitem>
            <listitem><para>long <link linkend="_marker_8cpp_1a20e13400871aae58f3d9c1e6aca1ef5a">markers_add</link> (<link linkend="_struct_bmarker">Bmarker</link> **mark, <link linkend="_struct_bmarker">Bmarker</link> *mark2, double mindist, int sel)</para>

<para>Adds a set of markers to another. </para>
</listitem>
            <listitem><para>long <link linkend="_marker_8cpp_1a58691ad944627f36a058adc1bfd46bc4">markers_delete_non_selected</link> (<link linkend="_struct_bmarker">Bmarker</link> **mark)</para>

<para>Deletes markers not selected. </para>
</listitem>
            <listitem><para>int <link linkend="_marker_8cpp_1a257f5736b771a172cb20524dd8376ad1">marker_shift</link> (<link linkend="_struct_bmarker">Bmarker</link> *markers, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; shift)</para>

<para>Shifting markers. </para>
</listitem>
            <listitem><para>int <link linkend="_marker_8cpp_1ad583a950389ca8fbe9f26c5e67923d97">marker_scale</link> (<link linkend="_struct_bmarker">Bmarker</link> *markers, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; scale)</para>

<para>Scaling markers. </para>
</listitem>
            <listitem><para>int <link linkend="_marker_8cpp_1a10d7db0d81db6bdd5a293509768695fd">marker_transform</link> (<link linkend="_struct_bmarker">Bmarker</link> *markers, <link linkend="_class_transform">Transform</link> t)</para>

<para>Transforming markers. </para>
</listitem>
            <listitem><para>double <link linkend="_marker_8cpp_1a76459be56c43305f6712ec108c9f07c9">marker_compare</link> (<link linkend="_struct_bmarker">Bmarker</link> *mark1, <link linkend="_struct_bmarker">Bmarker</link> *mark2)</para>

<para>Compare marker sets and calculates the root-mean-square deviation. </para>
</listitem>
            <listitem><para><link linkend="_class_matrix3">Matrix3</link> <link linkend="_marker_8cpp_1a496c1b08bd775237363a5e42dc54daab">marker_find_matrix</link> (<link linkend="_struct_bmarker">Bmarker</link> *markers1, <link linkend="_struct_bmarker">Bmarker</link> *markers2, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; origin1, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; origin2)</para>

<para>Determines the rotation matrix between two sets of markers. </para>
</listitem>
            <listitem><para><link linkend="_class_transform">Transform</link> <link linkend="_marker_8cpp_1ae1dfc5a7aeff67ddf02ff66d5ba2caca">marker_find_transform</link> (<link linkend="_struct_bmarker">Bmarker</link> *markers1, <link linkend="_struct_bmarker">Bmarker</link> *markers2, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; origin)</para>

<para>Determines the rotation matrix between two sets of markers. </para>
</listitem>
            <listitem><para><link linkend="_class_transform">Transform</link> <link linkend="_marker_8cpp_1a1d44aade79bef2180efd24c511dc891d">markers_find_rottrans</link> (<link linkend="_struct_bmarker">Bmarker</link> *set1, <link linkend="_struct_bmarker">Bmarker</link> *set2, double tolerance)</para>

<para>Finds the rotation and shift between two sets of vectors. </para>
</listitem>
            <listitem><para><link linkend="_class_transform">Transform</link> * <link linkend="_marker_8cpp_1a2cfaa20607e6350771f0746b522301d4">markers_map_and_find_transform</link> (<link linkend="_struct_bmarker">Bmarker</link> **set, int nseries, int refset, <link linkend="_class_vector3">Vector3</link>&lt; long &gt; size)</para>

<para>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. </para>
</listitem>
            <listitem><para>long <link linkend="_marker_8cpp_1ab4da75a2623bc485f31deff3383c90e8">markers_limit</link> (int target_num, int sign, <link linkend="_struct_bmarker">Bmarker</link> **set)</para>

<para>This method constricts a marker set to target_num points. </para>
</listitem>
            <listitem><para><link linkend="_struct_bmodel">Bmodel</link> * <link linkend="_marker_8cpp_1a56dbe56df8afc1c1ff7a2e9209d6e319">model_from_markers</link> (<link linkend="_struct_bmarker">Bmarker</link> *markers, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; origin, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; sam)</para>

<para>Convert markers to a model. </para>
</listitem>
            <listitem><para>int <link linkend="_marker_8cpp_1a335e64e5d16f67b64aca9a02a62ba225">marker_plane</link> (<link linkend="_struct_bmarker">Bmarker</link> *markers, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; origin)</para>

<para>Fits a plane to a set of markers. </para>
</listitem>
            <listitem><para><link linkend="_struct_bmarker">Bmarker</link> * <link linkend="_marker_8cpp_1ae3c28ba363e5180eef4bb943e653c61a">markers_sort_by_id</link> (<link linkend="_struct_bmarker">Bmarker</link> **mark)</para>

<para>Sorts a set of markers by ID number. </para>
</listitem>
            <listitem><para>long <link linkend="_marker_8cpp_1af3fb80cad13cdcf43c13dc73019b1b0e">markers_renumber</link> (<link linkend="_struct_bmarker">Bmarker</link> *mark)</para>

<para>Renumbers a set of markers. </para>
</listitem>
            <listitem><para>long <link linkend="_marker_8cpp_1ae48d10c460b6b0d8d8d45b610a4412a2">markers_center</link> (<link linkend="_struct_bmarker">Bmarker</link> *mark, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; center)</para>

<para>Centers a set of markers. </para>
</listitem>
            <listitem><para><link linkend="_struct_bmarker">Bmarker</link> * <link linkend="_marker_8cpp_1ad81da09c81ca67963b2e12691ca741ca">marker_set_at_radius</link> (double rad, double ainc)</para>

<para>Generates a marker set at a given radius with z=0. </para>
</listitem>
            <listitem><para>int <link linkend="_marker_8cpp_1a8960f3974caea0efc3935386042eaa98">marker_sets_to_bild</link> (<link linkend="_class_bstring">Bstring</link> &amp;filename, <link linkend="_struct_bmarker">Bmarker</link> *mark1, <link linkend="_struct_bmarker">Bmarker</link> *mark2)</para>

<para>Generates a bild file with the two marker sets. </para>
</listitem>
        </itemizedlist>
</simplesect>
<simplesect>
    <title>Variables    </title>
        <itemizedlist>
            <listitem><para>int <link linkend="_marker_8cpp_1a0b2caeb4b6f130be43e5a2f0267dd453">verbose</link></para>
</listitem>
        </itemizedlist>
</simplesect>
<section>
<title>Detailed Description</title>

<para>Functions for dealing with markers and linkers. </para>

<para><formalpara><title>Author: </title>

<para>Bernard Heymann </para>
</formalpara>
<formalpara><title>Date: </title>

<para>Created: 20020619 </para>

<para>Modified: 20170823 </para>
</formalpara>
</para>
</section>
<section>
<title>Function Documentation</title>
<anchor xml:id="_marker_8cpp_1a76459be56c43305f6712ec108c9f07c9"/>    <section>
    <title>marker_compare()</title>
<indexterm><primary>marker_compare</primary><secondary>marker.cpp</secondary></indexterm>
<indexterm><primary>marker.cpp</primary><secondary>marker_compare</secondary></indexterm>
<para><computeroutput>double marker_compare (<link linkend="_struct_bmarker">Bmarker</link> * mark1, <link linkend="_struct_bmarker">Bmarker</link> * mark2)</computeroutput></para><para>

<para>Compare marker sets and calculates the root-mean-square deviation. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*mark1</entry>
                                <entry>
<para>linked list of markers. </para>
</entry>
                            </row>
                            <row>
                                <entry>*mark2</entry>
                                <entry>
<para>linked list of markers. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>double RMSD. </para>
</formalpara>
</para>
<para>
Definition at line 248 of file marker.cpp.</para>
    </section><anchor xml:id="_marker_8cpp_1a496c1b08bd775237363a5e42dc54daab"/>    <section>
    <title>marker_find_matrix()</title>
<indexterm><primary>marker_find_matrix</primary><secondary>marker.cpp</secondary></indexterm>
<indexterm><primary>marker.cpp</primary><secondary>marker_find_matrix</secondary></indexterm>
<para><computeroutput><link linkend="_class_matrix3">Matrix3</link> marker_find_matrix (<link linkend="_struct_bmarker">Bmarker</link> * markers1, <link linkend="_struct_bmarker">Bmarker</link> * markers2, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; origin1, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; origin2)</computeroutput></para><para>

<para>Determines the rotation matrix between two sets of markers. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*markers1</entry>
                                <entry>
<para>linked list of markers. </para>
</entry>
                            </row>
                            <row>
                                <entry>*markers2</entry>
                                <entry>
<para>linked list of markers. </para>
</entry>
                            </row>
                            <row>
                                <entry>origin1</entry>
                                <entry>
<para>origin of first set. </para>
</entry>
                            </row>
                            <row>
                                <entry>origin2</entry>
                                <entry>
<para>origin of second set. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para><link linkend="_class_matrix3">Matrix3</link> rotation matrix. <literallayout><computeroutput>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.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 279 of file marker.cpp.</para>
    </section><anchor xml:id="_marker_8cpp_1ae1dfc5a7aeff67ddf02ff66d5ba2caca"/>    <section>
    <title>marker_find_transform()</title>
<indexterm><primary>marker_find_transform</primary><secondary>marker.cpp</secondary></indexterm>
<indexterm><primary>marker.cpp</primary><secondary>marker_find_transform</secondary></indexterm>
<para><computeroutput><link linkend="_class_transform">Transform</link> marker_find_transform (<link linkend="_struct_bmarker">Bmarker</link> * markers1, <link linkend="_struct_bmarker">Bmarker</link> * markers2, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; origin)</computeroutput></para><para>

<para>Determines the rotation matrix between two sets of markers. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*markers1</entry>
                                <entry>
<para>linked list of markers. </para>
</entry>
                            </row>
                            <row>
                                <entry>*markers2</entry>
                                <entry>
<para>linked list of markers. </para>
</entry>
                            </row>
                            <row>
                                <entry>origin</entry>
                                <entry>
<para>origin of rotation. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para><link linkend="_class_transform">Transform</link> transform structure. <literallayout><computeroutput>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.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 346 of file marker.cpp.</para>
    </section><anchor xml:id="_marker_8cpp_1a335e64e5d16f67b64aca9a02a62ba225"/>    <section>
    <title>marker_plane()</title>
<indexterm><primary>marker_plane</primary><secondary>marker.cpp</secondary></indexterm>
<indexterm><primary>marker.cpp</primary><secondary>marker_plane</secondary></indexterm>
<para><computeroutput>int marker_plane (<link linkend="_struct_bmarker">Bmarker</link> * markers, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; origin)</computeroutput></para><para>

<para>Fits a plane to a set of markers. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*markers</entry>
                                <entry>
<para>linked list of markers. </para>
</entry>
                            </row>
                            <row>
                                <entry>origin</entry>
                                <entry>
<para>marker origin. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int 0. <literallayout><computeroutput>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)
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 1042 of file marker.cpp.</para>
    </section><anchor xml:id="_marker_8cpp_1ad583a950389ca8fbe9f26c5e67923d97"/>    <section>
    <title>marker_scale()</title>
<indexterm><primary>marker_scale</primary><secondary>marker.cpp</secondary></indexterm>
<indexterm><primary>marker.cpp</primary><secondary>marker_scale</secondary></indexterm>
<para><computeroutput>int marker_scale (<link linkend="_struct_bmarker">Bmarker</link> * markers, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; scale)</computeroutput></para><para>

<para>Scaling markers. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*markers</entry>
                                <entry>
<para>linked list of markers. </para>
</entry>
                            </row>
                            <row>
                                <entry>scale</entry>
                                <entry>
<para>scale vector. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int error code (&lt;0 means failure). </para>
</formalpara>
</para>
<para>
Definition at line 208 of file marker.cpp.</para>
    </section><anchor xml:id="_marker_8cpp_1ad81da09c81ca67963b2e12691ca741ca"/>    <section>
    <title>marker_set_at_radius()</title>
<indexterm><primary>marker_set_at_radius</primary><secondary>marker.cpp</secondary></indexterm>
<indexterm><primary>marker.cpp</primary><secondary>marker_set_at_radius</secondary></indexterm>
<para><computeroutput><link linkend="_struct_bmarker">Bmarker</link>* marker_set_at_radius (double rad, double ainc)</computeroutput></para><para>

<para>Generates a marker set at a given radius with z=0. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>rad</entry>
                                <entry>
<para>radius. </para>
</entry>
                            </row>
                            <row>
                                <entry>ainc</entry>
                                <entry>
<para>angular increment. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int 0, &lt;0 on error. <literallayout><computeroutput>Markers are generated at the given radius and angular increments.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 1208 of file marker.cpp.</para>
    </section><anchor xml:id="_marker_8cpp_1a8960f3974caea0efc3935386042eaa98"/>    <section>
    <title>marker_sets_to_bild()</title>
<indexterm><primary>marker_sets_to_bild</primary><secondary>marker.cpp</secondary></indexterm>
<indexterm><primary>marker.cpp</primary><secondary>marker_sets_to_bild</secondary></indexterm>
<para><computeroutput>int marker_sets_to_bild (<link linkend="_class_bstring">Bstring</link> &amp; filename, <link linkend="_struct_bmarker">Bmarker</link> * mark1, <link linkend="_struct_bmarker">Bmarker</link> * mark2)</computeroutput></para><para>

<para>Generates a bild file with the two marker sets. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>&amp;filename</entry>
                                <entry>
<para>bild format file name. </para>
</entry>
                            </row>
                            <row>
                                <entry>*mark1</entry>
                                <entry>
<para>marker list 1. </para>
</entry>
                            </row>
                            <row>
                                <entry>*mark2</entry>
                                <entry>
<para>marker list 2. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int 0, &lt;0 on error. <literallayout><computeroutput>A sphere is drawn for every marker.
The first set is red and the second set is blue.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 1237 of file marker.cpp.</para>
    </section><anchor xml:id="_marker_8cpp_1a257f5736b771a172cb20524dd8376ad1"/>    <section>
    <title>marker_shift()</title>
<indexterm><primary>marker_shift</primary><secondary>marker.cpp</secondary></indexterm>
<indexterm><primary>marker.cpp</primary><secondary>marker_shift</secondary></indexterm>
<para><computeroutput>int marker_shift (<link linkend="_struct_bmarker">Bmarker</link> * markers, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; shift)</computeroutput></para><para>

<para>Shifting markers. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*markers</entry>
                                <entry>
<para>linked list of markers. </para>
</entry>
                            </row>
                            <row>
                                <entry>shift</entry>
                                <entry>
<para>shift vector. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int error code (&lt;0 means failure). </para>
</formalpara>
</para>
<para>
Definition at line 192 of file marker.cpp.</para>
    </section><anchor xml:id="_marker_8cpp_1a5b4c8ce8df8122b30f6a7655c624be55"/>    <section>
    <title>marker_stats()</title>
<indexterm><primary>marker_stats</primary><secondary>marker.cpp</secondary></indexterm>
<indexterm><primary>marker.cpp</primary><secondary>marker_stats</secondary></indexterm>
<para><computeroutput>long marker_stats (<link linkend="_struct_bmarker">Bmarker</link> * markers)</computeroutput></para><para>

<para>Calculating marker statistics. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*markers</entry>
                                <entry>
<para>list of markers. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>long number of markers (&lt;0 means failure). </para>
</formalpara>
</para>
<para>
Definition at line 34 of file marker.cpp.</para>
    </section><anchor xml:id="_marker_8cpp_1a10d7db0d81db6bdd5a293509768695fd"/>    <section>
    <title>marker_transform()</title>
<indexterm><primary>marker_transform</primary><secondary>marker.cpp</secondary></indexterm>
<indexterm><primary>marker.cpp</primary><secondary>marker_transform</secondary></indexterm>
<para><computeroutput>int marker_transform (<link linkend="_struct_bmarker">Bmarker</link> * markers, <link linkend="_class_transform">Transform</link> t)</computeroutput></para><para>

<para>Transforming markers. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*markers</entry>
                                <entry>
<para>linked list of markers. </para>
</entry>
                            </row>
                            <row>
                                <entry>t</entry>
                                <entry>
<para>transform structure. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int number of markers. </para>
</formalpara>
</para>
<para>
Definition at line 226 of file marker.cpp.</para>
    </section><anchor xml:id="_marker_8cpp_1a20e13400871aae58f3d9c1e6aca1ef5a"/>    <section>
    <title>markers_add()</title>
<indexterm><primary>markers_add</primary><secondary>marker.cpp</secondary></indexterm>
<indexterm><primary>marker.cpp</primary><secondary>markers_add</secondary></indexterm>
<para><computeroutput>long markers_add (<link linkend="_struct_bmarker">Bmarker</link> ** mark, <link linkend="_struct_bmarker">Bmarker</link> * mark2, double mindist, int sel)</computeroutput></para><para>

<para>Adds a set of markers to another. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>**mark</entry>
                                <entry>
<para>marker list. </para>
</entry>
                            </row>
                            <row>
                                <entry>*mark2</entry>
                                <entry>
<para>marker list to add. </para>
</entry>
                            </row>
                            <row>
                                <entry>mindist</entry>
                                <entry>
<para>minimum distance between markers. </para>
</entry>
                            </row>
                            <row>
                                <entry>sel</entry>
                                <entry>
<para>selection flag to set for second list. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>Bmarker* new marker list. <literallayout><computeroutput>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.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 120 of file marker.cpp.</para>
    </section><anchor xml:id="_marker_8cpp_1ae48d10c460b6b0d8d8d45b610a4412a2"/>    <section>
    <title>markers_center()</title>
<indexterm><primary>markers_center</primary><secondary>marker.cpp</secondary></indexterm>
<indexterm><primary>marker.cpp</primary><secondary>markers_center</secondary></indexterm>
<para><computeroutput>long markers_center (<link linkend="_struct_bmarker">Bmarker</link> * mark, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; center)</computeroutput></para><para>

<para>Centers a set of markers. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>**mark</entry>
                                <entry>
<para>pointer to marker list. </para>
</entry>
                            </row>
                            <row>
                                <entry>center</entry>
                                <entry>
<para>center to shift to. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>long number of markers. <literallayout><computeroutput>The marker center is calculated and the all markers shifted by the
difference with the target center.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 1176 of file marker.cpp.</para>
    </section><anchor xml:id="_marker_8cpp_1a2e2af9a9d51fc56caa5291ad10a3a85d"/>    <section>
    <title>markers_copy()<computeroutput>[1/2]</computeroutput></title>
<indexterm><primary>markers_copy</primary><secondary>marker.cpp</secondary></indexterm>
<indexterm><primary>marker.cpp</primary><secondary>markers_copy</secondary></indexterm>
<para><computeroutput><link linkend="_struct_bmarker">Bmarker</link>* markers_copy (<link linkend="_struct_bmarker">Bmarker</link> * mark, int sel_flag)</computeroutput></para><para>
Definition at line 61 of file marker.cpp.</para>
    </section><anchor xml:id="_marker_8cpp_1a1d9c5d31052da7fd9d0f3551141923cb"/>    <section>
    <title>markers_copy()<computeroutput>[2/2]</computeroutput></title>
<indexterm><primary>markers_copy</primary><secondary>marker.cpp</secondary></indexterm>
<indexterm><primary>marker.cpp</primary><secondary>markers_copy</secondary></indexterm>
<para><computeroutput><link linkend="_struct_bmarker">Bmarker</link>* markers_copy (<link linkend="_struct_bmarker">Bmarker</link> * mark)</computeroutput></para><para>

<para>Copies a set of markers. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*mark</entry>
                                <entry>
<para>marker list. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>Bmarker* new marker list. </para>
</formalpara>
</para>
<para>
Definition at line 92 of file marker.cpp.</para>
    </section><anchor xml:id="_marker_8cpp_1ae787149d4f16ed8eb0f10d2a89f64f38"/>    <section>
    <title>markers_copy_selected()</title>
<indexterm><primary>markers_copy_selected</primary><secondary>marker.cpp</secondary></indexterm>
<indexterm><primary>marker.cpp</primary><secondary>markers_copy_selected</secondary></indexterm>
<para><computeroutput><link linkend="_struct_bmarker">Bmarker</link>* markers_copy_selected (<link linkend="_struct_bmarker">Bmarker</link> * mark)</computeroutput></para><para>

<para>Copies a set of markers based on selection. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*mark</entry>
                                <entry>
<para>marker list. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>Bmarker* new marker list. </para>
</formalpara>
</para>
<para>
Definition at line 102 of file marker.cpp.</para>
    </section><anchor xml:id="_marker_8cpp_1a58691ad944627f36a058adc1bfd46bc4"/>    <section>
    <title>markers_delete_non_selected()</title>
<indexterm><primary>markers_delete_non_selected</primary><secondary>marker.cpp</secondary></indexterm>
<indexterm><primary>marker.cpp</primary><secondary>markers_delete_non_selected</secondary></indexterm>
<para><computeroutput>long markers_delete_non_selected (<link linkend="_struct_bmarker">Bmarker</link> ** mark)</computeroutput></para><para>

<para>Deletes markers not selected. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>**mark</entry>
                                <entry>
<para>pointer to marker list. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>long number of remaining markers. </para>
</formalpara>
</para>
<para>
Definition at line 159 of file marker.cpp.</para>
    </section><anchor xml:id="_marker_8cpp_1a1d44aade79bef2180efd24c511dc891d"/>    <section>
    <title>markers_find_rottrans()</title>
<indexterm><primary>markers_find_rottrans</primary><secondary>marker.cpp</secondary></indexterm>
<indexterm><primary>marker.cpp</primary><secondary>markers_find_rottrans</secondary></indexterm>
<para><computeroutput><link linkend="_class_transform">Transform</link> markers_find_rottrans (<link linkend="_struct_bmarker">Bmarker</link> * set1, <link linkend="_struct_bmarker">Bmarker</link> * set2, double tolerance)</computeroutput></para><para>

<para>Finds the rotation and shift between two sets of vectors. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*set1</entry>
                                <entry>
<para>first coordinate set. </para>
</entry>
                            </row>
                            <row>
                                <entry>*set2</entry>
                                <entry>
<para>second coordinate set. </para>
</entry>
                            </row>
                            <row>
                                <entry>tolerance</entry>
                                <entry>
<para>acceptable deviation for fit. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para><link linkend="_class_transform">Transform</link> structure with shift, scale, rotation angle, and R factor. <literallayout><computeroutput>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.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 416 of file marker.cpp.</para>
    </section><anchor xml:id="_marker_8cpp_1abb9f54663ab4c473a45863767c900158"/>    <section>
    <title>markers_findOneToOne()</title>
<indexterm><primary>markers_findOneToOne</primary><secondary>marker.cpp</secondary></indexterm>
<indexterm><primary>marker.cpp</primary><secondary>markers_findOneToOne</secondary></indexterm>
<para><computeroutput>int markers_findOneToOne (<link linkend="_struct_bmarker">Bmarker</link> * refset, <link linkend="_struct_bmarker">Bmarker</link> * applyset)</computeroutput></para><para>
Definition at line 642 of file marker.cpp.</para>
    </section><anchor xml:id="_marker_8cpp_1ab4da75a2623bc485f31deff3383c90e8"/>    <section>
    <title>markers_limit()</title>
<indexterm><primary>markers_limit</primary><secondary>marker.cpp</secondary></indexterm>
<indexterm><primary>marker.cpp</primary><secondary>markers_limit</secondary></indexterm>
<para><computeroutput>long markers_limit (int target_num, int sign, <link linkend="_struct_bmarker">Bmarker</link> ** set)</computeroutput></para><para>

<para>This method constricts a marker set to target_num points. </para>
</para>

<para><formalpara><title>Author: </title>

<para>Samuel Payne </para>
</formalpara>

                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>target_num</entry>
                                <entry>
<para>number of points desired in set. </para>
</entry>
                            </row>
                            <row>
                                <entry>sign</entry>
                                <entry>
<para>sign to direct sorting. </para>
</entry>
                            </row>
                            <row>
                                <entry>**set</entry>
                                <entry>
<para>pointer to set containing all the points. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>long number of points selected. <literallayout><computeroutput>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.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 909 of file marker.cpp.</para>
    </section><anchor xml:id="_marker_8cpp_1a2cfaa20607e6350771f0746b522301d4"/>    <section>
    <title>markers_map_and_find_transform()</title>
<indexterm><primary>markers_map_and_find_transform</primary><secondary>marker.cpp</secondary></indexterm>
<indexterm><primary>marker.cpp</primary><secondary>markers_map_and_find_transform</secondary></indexterm>
<para><computeroutput><link linkend="_class_transform">Transform</link>* markers_map_and_find_transform (<link linkend="_struct_bmarker">Bmarker</link> ** set, int nseries, int refset, <link linkend="_class_vector3">Vector3</link>&lt; long &gt; size)</computeroutput></para><para>

<para>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. </para>
</para>

<para><formalpara><title>Author: </title>

<para>Samuel Payne </para>
</formalpara>

                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>**set</entry>
                                <entry>
<para>set of coordinates from images to be aligned. </para>
</entry>
                            </row>
                            <row>
                                <entry>nseries</entry>
                                <entry>
<para>number of images in the set. </para>
</entry>
                            </row>
                            <row>
                                <entry>refset</entry>
                                <entry>
<para>reference set number. </para>
</entry>
                            </row>
                            <row>
                                <entry>size</entry>
                                <entry>
<para>size of images/frames of sets. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>Transform* list with shift, scale, rotation angle, and R factor. <literallayout><computeroutput>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.    
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 585 of file marker.cpp.</para>
    </section><anchor xml:id="_marker_8cpp_1af3fb80cad13cdcf43c13dc73019b1b0e"/>    <section>
    <title>markers_renumber()</title>
<indexterm><primary>markers_renumber</primary><secondary>marker.cpp</secondary></indexterm>
<indexterm><primary>marker.cpp</primary><secondary>markers_renumber</secondary></indexterm>
<para><computeroutput>long markers_renumber (<link linkend="_struct_bmarker">Bmarker</link> * mark)</computeroutput></para><para>

<para>Renumbers a set of markers. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>**mark</entry>
                                <entry>
<para>pointer to marker list. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>long number of markers. </para>
</formalpara>
</para>
<para>
Definition at line 1150 of file marker.cpp.</para>
    </section><anchor xml:id="_marker_8cpp_1a633889dd80f7ccc2787028169151776c"/>    <section>
    <title>markers_RoughMatch()</title>
<indexterm><primary>markers_RoughMatch</primary><secondary>marker.cpp</secondary></indexterm>
<indexterm><primary>marker.cpp</primary><secondary>markers_RoughMatch</secondary></indexterm>
<para><computeroutput>double * markers_RoughMatch (<link linkend="_struct_bmarker">Bmarker</link> * setA, <link linkend="_struct_bmarker">Bmarker</link> * setB, double dist_cutoff)</computeroutput></para><para>
Definition at line 763 of file marker.cpp.</para>
    </section><anchor xml:id="_marker_8cpp_1ae3c28ba363e5180eef4bb943e653c61a"/>    <section>
    <title>markers_sort_by_id()</title>
<indexterm><primary>markers_sort_by_id</primary><secondary>marker.cpp</secondary></indexterm>
<indexterm><primary>marker.cpp</primary><secondary>markers_sort_by_id</secondary></indexterm>
<para><computeroutput><link linkend="_struct_bmarker">Bmarker</link>* markers_sort_by_id (<link linkend="_struct_bmarker">Bmarker</link> ** mark)</computeroutput></para><para>

<para>Sorts a set of markers by ID number. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>**mark</entry>
                                <entry>
<para>pointer to marker list. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>Bmarker* new pointer to marker list. </para>
</formalpara>
</para>
<para>
Definition at line 1104 of file marker.cpp.</para>
    </section><anchor xml:id="_marker_8cpp_1a92f54bd05860c062fb0bae2a33dbfe91"/>    <section>
    <title>markers_sort_rel_distance()</title>
<indexterm><primary>markers_sort_rel_distance</primary><secondary>marker.cpp</secondary></indexterm>
<indexterm><primary>marker.cpp</primary><secondary>markers_sort_rel_distance</secondary></indexterm>
<para><computeroutput>int markers_sort_rel_distance (<link linkend="_struct_bmarker">Bmarker</link> * set, <link linkend="_struct_bmarker">Bmarker</link> * ref)</computeroutput></para><para>
Definition at line 966 of file marker.cpp.</para>
    </section><anchor xml:id="_marker_8cpp_1a56dbe56df8afc1c1ff7a2e9209d6e319"/>    <section>
    <title>model_from_markers()</title>
<indexterm><primary>model_from_markers</primary><secondary>marker.cpp</secondary></indexterm>
<indexterm><primary>marker.cpp</primary><secondary>model_from_markers</secondary></indexterm>
<para><computeroutput><link linkend="_struct_bmodel">Bmodel</link>* model_from_markers (<link linkend="_struct_bmarker">Bmarker</link> * markers, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; origin, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; sam)</computeroutput></para><para>

<para>Convert markers to a model. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>*markers</entry>
                                <entry>
<para>linked list of markers. </para>
</entry>
                            </row>
                            <row>
                                <entry>origin</entry>
                                <entry>
<para>marker origin. </para>
</entry>
                            </row>
                            <row>
                                <entry>sam</entry>
                                <entry>
<para>scaling marker coordinates. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>Bmodel* new model. </para>
</formalpara>
</para>
<para>
Definition at line 1002 of file marker.cpp.</para>
</section>
</section>
<section>
<title>Variable Documentation</title>
<anchor xml:id="_marker_8cpp_1a0b2caeb4b6f130be43e5a2f0267dd453"/>    <section>
    <title>verbose</title>
<indexterm><primary>verbose</primary><secondary>marker.cpp</secondary></indexterm>
<indexterm><primary>marker.cpp</primary><secondary>verbose</secondary></indexterm>
<para><computeroutput>int verbose</computeroutput></para></section>
</section>
</section>
