<?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__particles_8h">
<title>/Users/bernard/b20/bsoft/include/mg_particles.h File Reference</title>
<indexterm><primary>/Users/bernard/b20/bsoft/include/mg_particles.h</primary></indexterm>
<para>

<para>Manipulates single particle images. </para>
 
</para>
<programlisting>#include &quot;rwimg.h&quot;
</programlisting><simplesect>
    <title>Functions    </title>
        <itemizedlist>
            <listitem><para>int <link linkend="_mg__particles_8h_1a21b160ebd1952bd2a46dfed95e5f8c91">project_align_particles</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>, int <link linkend="_tcltk__bmg_8cpp_1a66823305785303716aa59f76b0e3359d">part_select</link>, double nuavg, double nustd)</para>

<para>Aligns single particle images based on orientation parameters. </para>
</listitem>
            <listitem><para>int <link linkend="_mg__particles_8h_1a572792d8d3510bcab5f2bd2bd36a99bf">project_center_particles</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>, int <link linkend="_tcltk__bmg_8cpp_1a66823305785303716aa59f76b0e3359d">part_select</link>, double nuavg, double nustd)</para>

<para>Centers single particle images based on the parametric center. </para>
</listitem>
            <listitem><para>int <link linkend="_mg__particles_8h_1adf39e793a5acc4d24cc9e28b74489273">project_set_particle_centers</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>, <link linkend="_class_bimage">Bimage</link> *pref, int <link linkend="_tcltk__bmg_8cpp_1a66823305785303716aa59f76b0e3359d">part_select</link>, double hires, double lores)</para>

<para>Calculates centers of single particle images by cross-correlation with a reference. </para>
</listitem>
            <listitem><para>long <link linkend="_mg__particles_8h_1a6a4fb292d5310e7a79bb2c1c07f82b64">project_find_part_centers_in_mgs</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>, double hires, double lores, int filter_flag)</para>

<para>Finds the centers of picked particles within a micrograph. </para>
</listitem>
            <listitem><para>long <link linkend="_mg__particles_8h_1a20b479d1317983b450baec2e144adda0">mg_find_part_centers</link> (<link linkend="_struct_bmicrograph">Bmicrograph</link> *mg, double hires, double lores, int filter_flag)</para>

<para>Finds the centers of picked particles within a micrograph. </para>
</listitem>
            <listitem><para><link linkend="_class_bimage">Bimage</link> * <link linkend="_mg__particles_8h_1a003fec362a2a3956ea28da37316251e2">project_find_particle_centers</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>, int max_iter, int <link linkend="_tcltk__bmg_8cpp_1a66823305785303716aa59f76b0e3359d">part_select</link>, double hires, double lores)</para>

<para>Calculates centers of single particle images. </para>
</listitem>
            <listitem><para>long <link linkend="_mg__particles_8h_1ab1d281fc53acc8dd1c0851d3ff48d0ac">project_mask_particles</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>, <link linkend="_class_bimage">Bimage</link> *pmask, <link linkend="_class_bstring">Bstring</link> &amp;partpath)</para>

<para>Calculates centers of single particle images. </para>
</listitem>
            <listitem><para>long <link linkend="_mg__particles_8h_1a7f91e58c5f4aee2b1192291c63332fc1">project_compare_particles</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>, <link linkend="_struct_bproject">Bproject</link> *projcomp)</para>

<para>Compares the coordinates of particles between two files. </para>
</listitem>
            <listitem><para>double <link linkend="_mg__particles_8h_1ab98bc39b1c1bbe3b81859cb195334493">project_tilt_from_particle_defocus</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>)</para>

<para>Finds the tilt axis from refined particle defocus values. </para>
</listitem>
            <listitem><para>long <link linkend="_mg__particles_8h_1abec758ec2e9044e54a28b398bb206811">project_set_particle_defocus_from_tilt</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>, double axis, double tilt)</para>

<para>Finds the tilt axis from refined particle defocus values. </para>
</listitem>
        </itemizedlist>
</simplesect>
<section>
<title>Detailed Description</title>

<para>Manipulates single particle images. </para>

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

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

<para>Created: 20080424 </para>

<para>Modified: 20180102 </para>
</formalpara>
</para>
</section>
<section>
<title>Function Documentation</title>
<anchor xml:id="_mg__particles_8h_1a20b479d1317983b450baec2e144adda0"/>    <section>
    <title>mg_find_part_centers()</title>
<indexterm><primary>mg_find_part_centers</primary><secondary>mg_particles.h</secondary></indexterm>
<indexterm><primary>mg_particles.h</primary><secondary>mg_find_part_centers</secondary></indexterm>
<para><computeroutput>long mg_find_part_centers (<link linkend="_struct_bmicrograph">Bmicrograph</link> * mg, double hires, double lores, int filter_flag)</computeroutput></para><para>

<para>Finds the centers of picked particles within a micrograph. </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>*mg</entry>
                                <entry>
<para>micrograph parameter structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>hires</entry>
                                <entry>
<para>high resolution limit. </para>
</entry>
                            </row>
                            <row>
                                <entry>lores</entry>
                                <entry>
<para>low resolution limit. </para>
</entry>
                            </row>
                            <row>
                                <entry>filter_flag</entry>
                                <entry>
<para>flag to filter extremes in particles. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>long number of particles. <literallayout><computeroutput>An image processing parameter structure loaded with micrograph
information is used to extract particle images from the micrograph
image using the particle coordinates in the parameter structure.
The extracted particle images are each rotated by PI and the shift
found by cross-correlation between the unrotated and rotated images.
The particle coordinates in the parameter structure are updated with
the shift.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 354 of file mg_particles.cpp.</para>
    </section><anchor xml:id="_mg__particles_8h_1a21b160ebd1952bd2a46dfed95e5f8c91"/>    <section>
    <title>project_align_particles()</title>
<indexterm><primary>project_align_particles</primary><secondary>mg_particles.h</secondary></indexterm>
<indexterm><primary>mg_particles.h</primary><secondary>project_align_particles</secondary></indexterm>
<para><computeroutput>int project_align_particles (<link linkend="_struct_bproject">Bproject</link> * project, int part_select, double nuavg, double nustd)</computeroutput></para><para>

<para>Aligns single particle images based on orientation parameters. </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>*project</entry>
                                <entry>
<para>image processing parameter structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>part_select</entry>
                                <entry>
<para>selection number from the selection column. </para>
</entry>
                            </row>
                            <row>
                                <entry>nuavg</entry>
                                <entry>
<para>rescale to new average. </para>
</entry>
                            </row>
                            <row>
                                <entry>nustd</entry>
                                <entry>
<para>rescale to new standard deviation. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int 0. <literallayout><computeroutput>Each selected particle image is rotated and shifted.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 33 of file mg_particles.cpp.</para>
    </section><anchor xml:id="_mg__particles_8h_1a572792d8d3510bcab5f2bd2bd36a99bf"/>    <section>
    <title>project_center_particles()</title>
<indexterm><primary>project_center_particles</primary><secondary>mg_particles.h</secondary></indexterm>
<indexterm><primary>mg_particles.h</primary><secondary>project_center_particles</secondary></indexterm>
<para><computeroutput>int project_center_particles (<link linkend="_struct_bproject">Bproject</link> * project, int part_select, double nuavg, double nustd)</computeroutput></para><para>

<para>Centers single particle images based on the parametric center. </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>*project</entry>
                                <entry>
<para>image processing parameter structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>part_select</entry>
                                <entry>
<para>selection number from the selection column. </para>
</entry>
                            </row>
                            <row>
                                <entry>nuavg</entry>
                                <entry>
<para>rescale to new average. </para>
</entry>
                            </row>
                            <row>
                                <entry>nustd</entry>
                                <entry>
<para>rescale to new standard deviation. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int 0. <literallayout><computeroutput>Each particle image is shifted to center the origin.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 135 of file mg_particles.cpp.</para>
    </section><anchor xml:id="_mg__particles_8h_1a7f91e58c5f4aee2b1192291c63332fc1"/>    <section>
    <title>project_compare_particles()</title>
<indexterm><primary>project_compare_particles</primary><secondary>mg_particles.h</secondary></indexterm>
<indexterm><primary>mg_particles.h</primary><secondary>project_compare_particles</secondary></indexterm>
<para><computeroutput>long project_compare_particles (<link linkend="_struct_bproject">Bproject</link> * project, <link linkend="_struct_bproject">Bproject</link> * projcomp)</computeroutput></para><para>

<para>Compares the coordinates of particles between two files. </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>*project</entry>
                                <entry>
<para>project parameter structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>*projcomp</entry>
                                <entry>
<para>comparable project parameter structure. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>long number of common particles. <literallayout><computeroutput>The coordinates of particles in one parameter file is compared to
that of a reference parameter file.
The two parameter files must have the same field and micrograph ID&apos;s.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 650 of file mg_particles.cpp.</para>
    </section><anchor xml:id="_mg__particles_8h_1a6a4fb292d5310e7a79bb2c1c07f82b64"/>    <section>
    <title>project_find_part_centers_in_mgs()</title>
<indexterm><primary>project_find_part_centers_in_mgs</primary><secondary>mg_particles.h</secondary></indexterm>
<indexterm><primary>mg_particles.h</primary><secondary>project_find_part_centers_in_mgs</secondary></indexterm>
<para><computeroutput>long project_find_part_centers_in_mgs (<link linkend="_struct_bproject">Bproject</link> * project, double hires, double lores, int filter_flag)</computeroutput></para><para>

<para>Finds the centers of picked particles within a micrograph. </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>*project</entry>
                                <entry>
<para>project parameter structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>hires</entry>
                                <entry>
<para>high resolution limit. </para>
</entry>
                            </row>
                            <row>
                                <entry>lores</entry>
                                <entry>
<para>low resolution limit. </para>
</entry>
                            </row>
                            <row>
                                <entry>filter_flag</entry>
                                <entry>
<para>flag to filter extremes in particles. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int 0. <literallayout><computeroutput>An image processing parameter structure loaded with micrograph
information is used to extract particle images from the micrograph
image using the particle coordinates in the parameter structure.
The extracted particle images are each rotated by PI and the shift
found by cross-correlation between the unrotated and rotated images.
The particle coordinates in the parameter structure are updated with
the shift.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 319 of file mg_particles.cpp.</para>
    </section><anchor xml:id="_mg__particles_8h_1a003fec362a2a3956ea28da37316251e2"/>    <section>
    <title>project_find_particle_centers()</title>
<indexterm><primary>project_find_particle_centers</primary><secondary>mg_particles.h</secondary></indexterm>
<indexterm><primary>mg_particles.h</primary><secondary>project_find_particle_centers</secondary></indexterm>
<para><computeroutput><link linkend="_class_bimage">Bimage</link>* project_find_particle_centers (<link linkend="_struct_bproject">Bproject</link> * project, int max_iter, int part_select, double hires, double lores)</computeroutput></para><para>

<para>Calculates centers of single particle images. </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>*project</entry>
                                <entry>
<para>image processing parameter structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>max_iter</entry>
                                <entry>
<para>maximum number of iterations. </para>
</entry>
                            </row>
                            <row>
                                <entry>part_select</entry>
                                <entry>
<para>selection number from the selection column. </para>
</entry>
                            </row>
                            <row>
                                <entry>hires</entry>
                                <entry>
<para>high resolution limit. </para>
</entry>
                            </row>
                            <row>
                                <entry>lores</entry>
                                <entry>
<para>low resolution limit. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>Bimage* final image composite reference. <literallayout><computeroutput>A composite image is generated from the selected particles and radially
symmetrized. Each image shift is then determined by cross correlation.
This is repeated until the chnage in image shifts decreases below
a threshold.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 408 of file mg_particles.cpp.</para>
    </section><anchor xml:id="_mg__particles_8h_1ab1d281fc53acc8dd1c0851d3ff48d0ac"/>    <section>
    <title>project_mask_particles()</title>
<indexterm><primary>project_mask_particles</primary><secondary>mg_particles.h</secondary></indexterm>
<indexterm><primary>mg_particles.h</primary><secondary>project_mask_particles</secondary></indexterm>
<para><computeroutput>long project_mask_particles (<link linkend="_struct_bproject">Bproject</link> * project, <link linkend="_class_bimage">Bimage</link> * pmask, <link linkend="_class_bstring">Bstring</link> &amp; partpath)</computeroutput></para><para>

<para>Calculates centers of single particle images. </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>*project</entry>
                                <entry>
<para>image processing parameter structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>*pmask</entry>
                                <entry>
<para>3D volume mask to be projected. </para>
</entry>
                            </row>
                            <row>
                                <entry>&amp;partpath</entry>
                                <entry>
<para>new path to particle files. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>long number of particles masked. <literallayout><computeroutput>A 3D mask is projected into each particle view and the particle image masked.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 579 of file mg_particles.cpp.</para>
    </section><anchor xml:id="_mg__particles_8h_1adf39e793a5acc4d24cc9e28b74489273"/>    <section>
    <title>project_set_particle_centers()</title>
<indexterm><primary>project_set_particle_centers</primary><secondary>mg_particles.h</secondary></indexterm>
<indexterm><primary>mg_particles.h</primary><secondary>project_set_particle_centers</secondary></indexterm>
<para><computeroutput>int project_set_particle_centers (<link linkend="_struct_bproject">Bproject</link> * project, <link linkend="_class_bimage">Bimage</link> * pref, int part_select, double hires, double lores)</computeroutput></para><para>

<para>Calculates centers of single particle images by cross-correlation with a reference. </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>*project</entry>
                                <entry>
<para>image processing parameter structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>*pref</entry>
                                <entry>
<para>reference image. </para>
</entry>
                            </row>
                            <row>
                                <entry>part_select</entry>
                                <entry>
<para>selection number from the selection column. </para>
</entry>
                            </row>
                            <row>
                                <entry>hires</entry>
                                <entry>
<para>high resolution limit. </para>
</entry>
                            </row>
                            <row>
                                <entry>lores</entry>
                                <entry>
<para>low resolution limit. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int 0. <literallayout><computeroutput>Each particle image shift is determined by cross correlation with
the reference image.
The reference must be the same size as the particle images.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 260 of file mg_particles.cpp.</para>
    </section><anchor xml:id="_mg__particles_8h_1abec758ec2e9044e54a28b398bb206811"/>    <section>
    <title>project_set_particle_defocus_from_tilt()</title>
<indexterm><primary>project_set_particle_defocus_from_tilt</primary><secondary>mg_particles.h</secondary></indexterm>
<indexterm><primary>mg_particles.h</primary><secondary>project_set_particle_defocus_from_tilt</secondary></indexterm>
<para><computeroutput>long project_set_particle_defocus_from_tilt (<link linkend="_struct_bproject">Bproject</link> * project, double axis, double tilt)</computeroutput></para><para>

<para>Finds the tilt axis from refined particle defocus values. </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>*project</entry>
                                <entry>
<para>project parameter structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>axis</entry>
                                <entry>
<para>tilt axis angle (radians). </para>
</entry>
                            </row>
                            <row>
                                <entry>tilt</entry>
                                <entry>
<para>tilt angle (radians). </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>long number of selected particles. </para>
</formalpara>
</para>
<para>
Definition at line 802 of file mg_particles.cpp.</para>
    </section><anchor xml:id="_mg__particles_8h_1ab98bc39b1c1bbe3b81859cb195334493"/>    <section>
    <title>project_tilt_from_particle_defocus()</title>
<indexterm><primary>project_tilt_from_particle_defocus</primary><secondary>mg_particles.h</secondary></indexterm>
<indexterm><primary>mg_particles.h</primary><secondary>project_tilt_from_particle_defocus</secondary></indexterm>
<para><computeroutput>double project_tilt_from_particle_defocus (<link linkend="_struct_bproject">Bproject</link> * project)</computeroutput></para><para>

<para>Finds the tilt axis from refined particle defocus values. </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>*project</entry>
                                <entry>
<para>project parameter structure. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>double average tilt axis. </para>
</formalpara>
</para>
<para>
Definition at line 709 of file mg_particles.cpp.</para>
</section>
</section>
</section>
