<?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="_mg__random_8cpp">
<title>/Users/bernard/b20/bsoft/src/mg/mg_random.cpp File Reference</title>
<indexterm><primary>/Users/bernard/b20/bsoft/src/mg/mg_random.cpp</primary></indexterm>
<para>

<para>Functions for applying some randomization to parameters. </para>
 
</para>
<programlisting>#include &quot;mg_random.h&quot;
#include &quot;linked_list.h&quot;
#include &quot;random_numbers.h&quot;
#include &quot;utilities.h&quot;
</programlisting><simplesect>
    <title>Functions    </title>
        <itemizedlist>
            <listitem><para>int <link linkend="_mg__random_8cpp_1a1684e735ee263cbc709bd411ed9fb053">project_random_defocus</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>, double std)</para>

<para>Introduces random errors into micrograph defocus averages. </para>
</listitem>
            <listitem><para>int <link linkend="_mg__random_8cpp_1a95aa1495e4f7d731680dd55a7e8dea3f">project_random_origins</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>, double std)</para>

<para>Introduces random errors into particle origins. </para>
</listitem>
            <listitem><para>int <link linkend="_mg__random_8cpp_1adf5f98de89b2debfbd1bd2b0cd5665a1">project_random_views</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>)</para>

<para>Replace the original particle orientations by random views. </para>
</listitem>
            <listitem><para>int <link linkend="_mg__random_8cpp_1a8f4f05ab680cbc97f95a304ce87785b3">project_random_helical_views</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>)</para>

<para>Replace the original particle orientations by random side views for a helix. </para>
</listitem>
            <listitem><para>double <link linkend="_mg__random_8cpp_1a1287aa111270be7ca2e01de04ebf9095">particle_random_view</link> (<link linkend="_struct_bparticle">Bparticle</link> *part, double std)</para>
</listitem>
            <listitem><para>int <link linkend="_mg__random_8cpp_1ae5947d2b739f8943c9e9ef7225b7d1cd">project_random_views</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>, double std)</para>

<para>Introduces random errors into particle views. </para>
</listitem>
            <listitem><para>int <link linkend="_mg__random_8cpp_1a53c2d1ca276dfd18ef3c065af89d3cad">project_random_magnification</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>, double std)</para>

<para>Introduces random errors into particle magnifications. </para>
</listitem>
            <listitem><para>int <link linkend="_mg__random_8cpp_1adbdfbee0b33f73cf826bddfc03340021">project_random_symmetry_related_views</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>, <link linkend="_struct_bsymmetry">Bsymmetry</link> *sym)</para>

<para>Replaces the original orientations by symmetry-related views. </para>
</listitem>
        </itemizedlist>
</simplesect>
<simplesect>
    <title>Variables    </title>
        <itemizedlist>
            <listitem><para>int <link linkend="_mg__random_8cpp_1a0b2caeb4b6f130be43e5a2f0267dd453">verbose</link></para>
</listitem>
        </itemizedlist>
</simplesect>
<section>
<title>Detailed Description</title>

<para>Functions for applying some randomization to parameters. </para>

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

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

<para>Created: 20010206 </para>

<para>Modified: 20140225 </para>
</formalpara>
</para>
</section>
<section>
<title>Function Documentation</title>
<anchor xml:id="_mg__random_8cpp_1a1287aa111270be7ca2e01de04ebf9095"/>    <section>
    <title>particle_random_view()</title>
<indexterm><primary>particle_random_view</primary><secondary>mg_random.cpp</secondary></indexterm>
<indexterm><primary>mg_random.cpp</primary><secondary>particle_random_view</secondary></indexterm>
<para><computeroutput>double particle_random_view (<link linkend="_struct_bparticle">Bparticle</link> * part, double std)</computeroutput></para><para>
Definition at line 227 of file mg_random.cpp.</para>
    </section><anchor xml:id="_mg__random_8cpp_1a1684e735ee263cbc709bd411ed9fb053"/>    <section>
    <title>project_random_defocus()</title>
<indexterm><primary>project_random_defocus</primary><secondary>mg_random.cpp</secondary></indexterm>
<indexterm><primary>mg_random.cpp</primary><secondary>project_random_defocus</secondary></indexterm>
<para><computeroutput>int project_random_defocus (<link linkend="_struct_bproject">Bproject</link> * project, double std)</computeroutput></para><para>

<para>Introduces random errors into micrograph defocus averages. </para>
</para>

<para><literallayout><computeroutput>The random deviations are obtained from a Gaussian distribution
generator.
</computeroutput></literallayout></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>*project</entry>
                                <entry>
<para>project parameter structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>std</entry>
                                <entry>
<para>standard deviation of random error (angstroms). </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int 0. </para>
</formalpara>
</para>
<para>
Definition at line 28 of file mg_random.cpp.</para>
    </section><anchor xml:id="_mg__random_8cpp_1a8f4f05ab680cbc97f95a304ce87785b3"/>    <section>
    <title>project_random_helical_views()</title>
<indexterm><primary>project_random_helical_views</primary><secondary>mg_random.cpp</secondary></indexterm>
<indexterm><primary>mg_random.cpp</primary><secondary>project_random_helical_views</secondary></indexterm>
<para><computeroutput>int project_random_helical_views (<link linkend="_struct_bproject">Bproject</link> * project)</computeroutput></para><para>

<para>Replace the original particle orientations by random side views for a helix. </para>
</para>

<para><literallayout><computeroutput>The random views are generated in the ranges {[0,1], [0,1], [0,1], [-PI,PI]}.
</computeroutput></literallayout></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>*project</entry>
                                <entry>
<para>project parameter structure. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int 0. </para>
</formalpara>
</para>
<para>
Definition at line 179 of file mg_random.cpp.</para>
    </section><anchor xml:id="_mg__random_8cpp_1a53c2d1ca276dfd18ef3c065af89d3cad"/>    <section>
    <title>project_random_magnification()</title>
<indexterm><primary>project_random_magnification</primary><secondary>mg_random.cpp</secondary></indexterm>
<indexterm><primary>mg_random.cpp</primary><secondary>project_random_magnification</secondary></indexterm>
<para><computeroutput>int project_random_magnification (<link linkend="_struct_bproject">Bproject</link> * project, double std)</computeroutput></para><para>

<para>Introduces random errors into particle magnifications. </para>
</para>

<para><literallayout><computeroutput>The random deviations are obtained from a Gaussian distribution
generator.
</computeroutput></literallayout></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>*project</entry>
                                <entry>
<para>project parameter structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>std</entry>
                                <entry>
<para>standard deviation of random error (fraction). </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int 0. </para>
</formalpara>
</para>
<para>
Definition at line 313 of file mg_random.cpp.</para>
    </section><anchor xml:id="_mg__random_8cpp_1a95aa1495e4f7d731680dd55a7e8dea3f"/>    <section>
    <title>project_random_origins()</title>
<indexterm><primary>project_random_origins</primary><secondary>mg_random.cpp</secondary></indexterm>
<indexterm><primary>mg_random.cpp</primary><secondary>project_random_origins</secondary></indexterm>
<para><computeroutput>int project_random_origins (<link linkend="_struct_bproject">Bproject</link> * project, double std)</computeroutput></para><para>

<para>Introduces random errors into particle origins. </para>
</para>

<para><literallayout><computeroutput>The random deviations are obtained from a Gaussian distribution
generator.
</computeroutput></literallayout></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>*project</entry>
                                <entry>
<para>project parameter structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>std</entry>
                                <entry>
<para>standard deviation of random error (pixels). </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int 0. </para>
</formalpara>
</para>
<para>
Definition at line 73 of file mg_random.cpp.</para>
    </section><anchor xml:id="_mg__random_8cpp_1adbdfbee0b33f73cf826bddfc03340021"/>    <section>
    <title>project_random_symmetry_related_views()</title>
<indexterm><primary>project_random_symmetry_related_views</primary><secondary>mg_random.cpp</secondary></indexterm>
<indexterm><primary>mg_random.cpp</primary><secondary>project_random_symmetry_related_views</secondary></indexterm>
<para><computeroutput>int project_random_symmetry_related_views (<link linkend="_struct_bproject">Bproject</link> * project, <link linkend="_struct_bsymmetry">Bsymmetry</link> * sym)</computeroutput></para><para>

<para>Replaces the original orientations by symmetry-related views. </para>
</para>

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

<para>Eduardo Sanz-Garcia and David Belnap <literallayout><computeroutput>For each particle all the symmetry-related views are generated and
one randomly selected.
</computeroutput></literallayout></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>*project</entry>
                                <entry>
<para>project parameter structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>*sym</entry>
                                <entry>
<para>symmetry structure. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int 0. </para>
</formalpara>
</para>
<para>
Definition at line 362 of file mg_random.cpp.</para>
    </section><anchor xml:id="_mg__random_8cpp_1adf5f98de89b2debfbd1bd2b0cd5665a1"/>    <section>
    <title>project_random_views()<computeroutput>[1/2]</computeroutput></title>
<indexterm><primary>project_random_views</primary><secondary>mg_random.cpp</secondary></indexterm>
<indexterm><primary>mg_random.cpp</primary><secondary>project_random_views</secondary></indexterm>
<para><computeroutput>int project_random_views (<link linkend="_struct_bproject">Bproject</link> * project)</computeroutput></para><para>

<para>Replace the original particle orientations by random views. </para>
</para>

<para><literallayout><computeroutput>The random views are generated in the ranges {[0,1], [0,1], [0,1], [-PI,PI]}.
</computeroutput></literallayout></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>*project</entry>
                                <entry>
<para>project parameter structure. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int 0. </para>
</formalpara>
</para>
<para>
Definition at line 130 of file mg_random.cpp.</para>
    </section><anchor xml:id="_mg__random_8cpp_1ae5947d2b739f8943c9e9ef7225b7d1cd"/>    <section>
    <title>project_random_views()<computeroutput>[2/2]</computeroutput></title>
<indexterm><primary>project_random_views</primary><secondary>mg_random.cpp</secondary></indexterm>
<indexterm><primary>mg_random.cpp</primary><secondary>project_random_views</secondary></indexterm>
<para><computeroutput>int project_random_views (<link linkend="_struct_bproject">Bproject</link> * project, double std)</computeroutput></para><para>

<para>Introduces random errors into particle views. </para>
</para>

<para><literallayout><computeroutput>The random deviations are obtained from a Gaussian distribution
generator.
</computeroutput></literallayout></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>*project</entry>
                                <entry>
<para>project parameter structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>std</entry>
                                <entry>
<para>standard deviation of random error (radians). </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int 0. </para>
</formalpara>
</para>
<para>
Definition at line 255 of file mg_random.cpp.</para>
</section>
</section>
<section>
<title>Variable Documentation</title>
<anchor xml:id="_mg__random_8cpp_1a0b2caeb4b6f130be43e5a2f0267dd453"/>    <section>
    <title>verbose</title>
<indexterm><primary>verbose</primary><secondary>mg_random.cpp</secondary></indexterm>
<indexterm><primary>mg_random.cpp</primary><secondary>verbose</secondary></indexterm>
<para><computeroutput>int verbose</computeroutput></para></section>
</section>
</section>
