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

<para>Reciprocal space refinement of orientation parameters of particle images. </para>
 
</para>
<programlisting>#include &quot;mg_processing.h&quot;
#include &quot;mg_refine.h&quot;
#include &quot;rwmg.h&quot;
#include &quot;mg_ctf.h&quot;
#include &quot;rwimg.h&quot;
#include &quot;Complex.h&quot;
#include &quot;Matrix3.h&quot;
#include &quot;linked_list.h&quot;
#include &quot;random_numbers.h&quot;
#include &quot;utilities.h&quot;
#include &lt;sys/stat.h&gt;
#include &lt;fcntl.h&gt;
</programlisting><simplesect>
    <title>Functions    </title>
        <itemizedlist>
            <listitem><para>long <link linkend="_mg__refine_8cpp_1a5e3ff68cd134b3bcc90a2d1c51519cde">part_refine_orientation</link> (<link linkend="_struct_bparticle">Bparticle</link> *part, <link linkend="_class_bstring">Bstring</link> &amp;partfile, double pixel_size, <link linkend="_class_bimage">Bimage</link> *pref, <link linkend="_class_bimage">Bimage</link> *pmask, <link linkend="_struct_bsymmetry">Bsymmetry</link> *sym, int max_iter, double alpha_step, double accuracy, double shift_step, double shift_accuracy, double hi_res, double lo_res, int fom_type, vector&lt; double &gt; weight, double edge_radius, <link linkend="_class_c_t_fparam">CTFparam</link> *em_ctf, double def_std, double shift_std, double view_std, double max_angle, double max_mag, int flags, <link linkend="_class_f_s_i___kernel">FSI_Kernel</link> *<link linkend="_structkernel">kernel</link>, <link linkend="_fft_8h_1a61d23c567e69684715ea52482137a5e6">fft_plan</link> <link linkend="_bico_8cpp_1a6ecaa8728bab23c3a7d96fe0cadc75f2">planf</link>)</para>

<para>Refine the orientation and origin of one particle with respect to a reference map. </para>
</listitem>
            <listitem><para>double <link linkend="_mg__refine_8cpp_1ab279a16ea1d3aa11bdc174eba7406956">img_refine_monte</link> (<link linkend="_class_bimage">Bimage</link> *p, <link linkend="_class_bimage">Bimage</link> *pref, double hi_res, double lo_res, int max_iter, int fom_type, vector&lt; double &gt; &amp;weight, <link linkend="_class_c_t_fparam">CTFparam</link> *em_ctf, double def_std, double shift_std, double view_std, double max_angle, double max_mag, <link linkend="_class_f_s_i___kernel">FSI_Kernel</link> *<link linkend="_structkernel">kernel</link>, long &amp;number)</para>

<para>Refine the orientation and origin of one particle with respect to a reference map. </para>
</listitem>
            <listitem><para>double <link linkend="_mg__refine_8cpp_1a6abefc026ab89fe047e29333bbd6aa87">img_refine_grid</link> (<link linkend="_class_bimage">Bimage</link> *p, <link linkend="_class_bimage">Bimage</link> *pref, double hi_res, double lo_res, double alpha_step, double accuracy, double shift_step, double shift_accuracy, double max_mag, int fom_type, vector&lt; double &gt; &amp;weight, <link linkend="_class_c_t_fparam">CTFparam</link> *em_ctf, double def_std, <link linkend="_class_f_s_i___kernel">FSI_Kernel</link> *<link linkend="_structkernel">kernel</link>, long &amp;number)</para>

<para>Refine the orientation and origin of one particle with respect to a reference map. </para>
</listitem>
            <listitem><para>long <link linkend="_mg__refine_8cpp_1ac015a84e19818e434f79916bc2e94d87">mg_refine_orientations</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>, <link linkend="_class_bstring">Bstring</link> &amp;reffile, <link linkend="_class_bstring">Bstring</link> &amp;maskfile, <link linkend="_class_bstring">Bstring</link> &amp;sym_string, int <link linkend="_tcltk__bmg_8cpp_1a66823305785303716aa59f76b0e3359d">part_select</link>, int max_iter, double alpha_step, double accuracy, double shift_step, double shift_accuracy, int fom_type, vector&lt; double &gt; weight, double hi_res, double lo_res, int kernel_width, int kernel_power, double edge_radius, double def_std, double shift_std, double view_std, double max_angle, double max_mag, int flags)</para>

<para>Refine the orientation and origin with respect to a reference map. </para>
</listitem>
            <listitem><para>long <link linkend="_mg__refine_8cpp_1a1331dbbf289ab81924b877ebbe99d9de">project_refine_orientations</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>, <link linkend="_class_bstring">Bstring</link> &amp;reffile, <link linkend="_class_bstring">Bstring</link> &amp;maskfile, <link linkend="_class_bstring">Bstring</link> &amp;sym_string, int <link linkend="_tcltk__bmg_8cpp_1a66823305785303716aa59f76b0e3359d">part_select</link>, int max_iter, double alpha_step, double accuracy, double shift_step, double shift_accuracy, int fom_type, vector&lt; double &gt; weight, double hi_res, double lo_res, int kernel_width, int kernel_power, double edge_radius, double def_std, double shift_std, double view_std, double max_angle, double max_mag, int flags)</para>
</listitem>
            <listitem><para>double <link linkend="_mg__refine_8cpp_1a7e64fddb32060025af5e03021151a146">img_recip_space_fom</link> (<link linkend="_class_bimage">Bimage</link> *p, <link linkend="_class_bimage">Bimage</link> *pref, double hi_res, double lo_res, int fom_type, vector&lt; double &gt; &amp;weight, int apply_ctf, <link linkend="_class_c_t_fparam">CTFparam</link> *em_ctf)</para>
</listitem>
            <listitem><para>double <link linkend="_mg__refine_8cpp_1af90397092d5a8de64119571612f2e4f2">img_fit_in_recip_space_monte</link> (<link linkend="_class_bimage">Bimage</link> *p, <link linkend="_class_bimage">Bimage</link> *pref, double hi_res, double lo_res, int max_iter, int fom_type, vector&lt; double &gt; &amp;weight, <link linkend="_class_c_t_fparam">CTFparam</link> *em_ctf, double def_std, double shift_std, <link linkend="_class_f_s_i___kernel">FSI_Kernel</link> *<link linkend="_structkernel">kernel</link>, long &amp;number)</para>
</listitem>
            <listitem><para>double <link linkend="_mg__refine_8cpp_1a4ad44ccbc884097f75e7b1dcaad4b571">img_fit_in_recip_space_grid</link> (<link linkend="_class_bimage">Bimage</link> *p, <link linkend="_class_bimage">Bimage</link> *pref, double hi_res, double lo_res, double step, double accuracy, int fom_type, vector&lt; double &gt; &amp;weight, <link linkend="_class_c_t_fparam">CTFparam</link> *em_ctf, double def_std, <link linkend="_class_f_s_i___kernel">FSI_Kernel</link> *<link linkend="_structkernel">kernel</link>, long &amp;number)</para>
</listitem>
        </itemizedlist>
</simplesect>
<simplesect>
    <title>Variables    </title>
        <itemizedlist>
            <listitem><para>int <link linkend="_mg__refine_8cpp_1a0b2caeb4b6f130be43e5a2f0267dd453">verbose</link></para>
</listitem>
        </itemizedlist>
</simplesect>
<section>
<title>Detailed Description</title>

<para>Reciprocal space refinement of orientation parameters of particle images. </para>

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

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

<para>Created: 20070115 </para>

<para>Modified: 20190207 </para>
</formalpara>
</para>
</section>
<section>
<title>Function Documentation</title>
<anchor xml:id="_mg__refine_8cpp_1a4ad44ccbc884097f75e7b1dcaad4b571"/>    <section>
    <title>img_fit_in_recip_space_grid()</title>
<indexterm><primary>img_fit_in_recip_space_grid</primary><secondary>mg_refine.cpp</secondary></indexterm>
<indexterm><primary>mg_refine.cpp</primary><secondary>img_fit_in_recip_space_grid</secondary></indexterm>
<para><computeroutput>double img_fit_in_recip_space_grid (<link linkend="_class_bimage">Bimage</link> * p, <link linkend="_class_bimage">Bimage</link> * pref, double hi_res, double lo_res, double step, double accuracy, int fom_type, vector&lt; double &gt; &amp; weight, <link linkend="_class_c_t_fparam">CTFparam</link> * em_ctf, double def_std, <link linkend="_class_f_s_i___kernel">FSI_Kernel</link> * kernel, long &amp; number)</computeroutput></para><para>
Definition at line 849 of file mg_refine.cpp.</para>
    </section><anchor xml:id="_mg__refine_8cpp_1af90397092d5a8de64119571612f2e4f2"/>    <section>
    <title>img_fit_in_recip_space_monte()</title>
<indexterm><primary>img_fit_in_recip_space_monte</primary><secondary>mg_refine.cpp</secondary></indexterm>
<indexterm><primary>mg_refine.cpp</primary><secondary>img_fit_in_recip_space_monte</secondary></indexterm>
<para><computeroutput>double img_fit_in_recip_space_monte (<link linkend="_class_bimage">Bimage</link> * p, <link linkend="_class_bimage">Bimage</link> * pref, double hi_res, double lo_res, int max_iter, int fom_type, vector&lt; double &gt; &amp; weight, <link linkend="_class_c_t_fparam">CTFparam</link> * em_ctf, double def_std, double shift_std, <link linkend="_class_f_s_i___kernel">FSI_Kernel</link> * kernel, long &amp; number)</computeroutput></para><para>
Definition at line 769 of file mg_refine.cpp.</para>
    </section><anchor xml:id="_mg__refine_8cpp_1a7e64fddb32060025af5e03021151a146"/>    <section>
    <title>img_recip_space_fom()</title>
<indexterm><primary>img_recip_space_fom</primary><secondary>mg_refine.cpp</secondary></indexterm>
<indexterm><primary>mg_refine.cpp</primary><secondary>img_recip_space_fom</secondary></indexterm>
<para><computeroutput>double img_recip_space_fom (<link linkend="_class_bimage">Bimage</link> * p, <link linkend="_class_bimage">Bimage</link> * pref, double hi_res, double lo_res, int fom_type, vector&lt; double &gt; &amp; weight, int apply_ctf, <link linkend="_class_c_t_fparam">CTFparam</link> * em_ctf)</computeroutput></para><para>
Definition at line 654 of file mg_refine.cpp.</para>
    </section><anchor xml:id="_mg__refine_8cpp_1a6abefc026ab89fe047e29333bbd6aa87"/>    <section>
    <title>img_refine_grid()</title>
<indexterm><primary>img_refine_grid</primary><secondary>mg_refine.cpp</secondary></indexterm>
<indexterm><primary>mg_refine.cpp</primary><secondary>img_refine_grid</secondary></indexterm>
<para><computeroutput>double img_refine_grid (<link linkend="_class_bimage">Bimage</link> * p, <link linkend="_class_bimage">Bimage</link> * pref, double hi_res, double lo_res, double alpha_step, double accuracy, double shift_step, double shift_accuracy, double max_mag, int fom_type, vector&lt; double &gt; &amp; weight, <link linkend="_class_c_t_fparam">CTFparam</link> * em_ctf, double def_std, <link linkend="_class_f_s_i___kernel">FSI_Kernel</link> * kernel, long &amp; number)</computeroutput></para><para>

<para>Refine the orientation and origin of one particle with respect to a reference map. </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>*p</entry>
                                <entry>
<para>particle image. </para>
</entry>
                            </row>
                            <row>
                                <entry>*pref</entry>
                                <entry>
<para>reference map. </para>
</entry>
                            </row>
                            <row>
                                <entry>hi_res</entry>
                                <entry>
<para>high resolution limit (angstrom). </para>
</entry>
                            </row>
                            <row>
                                <entry>lo_res</entry>
                                <entry>
<para>low resolution limit (angstrom). </para>
</entry>
                            </row>
                            <row>
                                <entry>alpha_step</entry>
                                <entry>
<para>grid search angular step size. </para>
</entry>
                            </row>
                            <row>
                                <entry>accuracy</entry>
                                <entry>
<para>grid search accuracy. </para>
</entry>
                            </row>
                            <row>
                                <entry>shift_step</entry>
                                <entry>
<para>grid shift size. </para>
</entry>
                            </row>
                            <row>
                                <entry>shift_accuracy</entry>
                                <entry>
<para>grid shift accuracy. </para>
</entry>
                            </row>
                            <row>
                                <entry>max_mag</entry>
                                <entry>
<para>maximum magnification adjustment. </para>
</entry>
                            </row>
                            <row>
                                <entry>fom_type</entry>
                                <entry>
<para>type of resolution measure: 0=FRC, 1=DPR </para>
</entry>
                            </row>
                            <row>
                                <entry>weight</entry>
                                <entry>
<para>1D reciprocal space weight curve. </para>
</entry>
                            </row>
                            <row>
                                <entry>*em_ctf</entry>
                                <entry>
<para>CTF parameters (if NULL, not used). </para>
</entry>
                            </row>
                            <row>
                                <entry>def_std</entry>
                                <entry>
<para>defocus step size. </para>
</entry>
                            </row>
                            <row>
                                <entry>*kernel</entry>
                                <entry>
<para>interpolation kernel. </para>
</entry>
                            </row>
                            <row>
                                <entry>&amp;number</entry>
                                <entry>
<para>number of comparisons. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>double best figure-of-merit. <literallayout><computeroutput>The orientation and origin are refined using a grid search
with selection based on the FSC or DPR.
The best result is returned in the orientation parameters of the image structure.
The FOM in the image structure is the first FOM determined, while the best
FOM is returned.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 1060 of file mg_refine.cpp.</para>
    </section><anchor xml:id="_mg__refine_8cpp_1ab279a16ea1d3aa11bdc174eba7406956"/>    <section>
    <title>img_refine_monte()</title>
<indexterm><primary>img_refine_monte</primary><secondary>mg_refine.cpp</secondary></indexterm>
<indexterm><primary>mg_refine.cpp</primary><secondary>img_refine_monte</secondary></indexterm>
<para><computeroutput>double img_refine_monte (<link linkend="_class_bimage">Bimage</link> * p, <link linkend="_class_bimage">Bimage</link> * pref, double hi_res, double lo_res, int max_iter, int fom_type, vector&lt; double &gt; &amp; weight, <link linkend="_class_c_t_fparam">CTFparam</link> * em_ctf, double def_std, double shift_std, double view_std, double max_angle, double max_mag, <link linkend="_class_f_s_i___kernel">FSI_Kernel</link> * kernel, long &amp; number)</computeroutput></para><para>

<para>Refine the orientation and origin of one particle with respect to a reference map. </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>*p</entry>
                                <entry>
<para>particle image. </para>
</entry>
                            </row>
                            <row>
                                <entry>*pref</entry>
                                <entry>
<para>reference map. </para>
</entry>
                            </row>
                            <row>
                                <entry>hi_res</entry>
                                <entry>
<para>high resolution limit (angstrom). </para>
</entry>
                            </row>
                            <row>
                                <entry>lo_res</entry>
                                <entry>
<para>low resolution limit (angstrom). </para>
</entry>
                            </row>
                            <row>
                                <entry>max_iter</entry>
                                <entry>
<para>maximum number of refining iterations. </para>
</entry>
                            </row>
                            <row>
                                <entry>fom_type</entry>
                                <entry>
<para>type of resolution measure: 0=FRC, 1=DPR </para>
</entry>
                            </row>
                            <row>
                                <entry>weight</entry>
                                <entry>
<para>1D reciprocal space weight curve. </para>
</entry>
                            </row>
                            <row>
                                <entry>*em_ctf</entry>
                                <entry>
<para>CTF parameters (if NULL, not used). </para>
</entry>
                            </row>
                            <row>
                                <entry>def_std</entry>
                                <entry>
<para>random defocus standard deviation </para>
</entry>
                            </row>
                            <row>
                                <entry>shift_std</entry>
                                <entry>
<para>random origin shift standard deviation. </para>
</entry>
                            </row>
                            <row>
                                <entry>view_std</entry>
                                <entry>
<para>random view shift standard deviation. </para>
</entry>
                            </row>
                            <row>
                                <entry>max_angle</entry>
                                <entry>
<para>maximum random rotation angle adjustment. </para>
</entry>
                            </row>
                            <row>
                                <entry>max_mag</entry>
                                <entry>
<para>maximum magnification adjustment. </para>
</entry>
                            </row>
                            <row>
                                <entry>*kernel</entry>
                                <entry>
<para>interpolation kernel. </para>
</entry>
                            </row>
                            <row>
                                <entry>&amp;number</entry>
                                <entry>
<para>number of comparisons. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>double best figure-of-merit. <literallayout><computeroutput>The orientation and origin are iteratively modified in small random steps,
with selection based on the Fourier shell correlation.
The best result is returned in the orientation parameters of the image structure.
The FOM in the image structure is the first FOM determined, while the best
FOM is returned.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 963 of file mg_refine.cpp.</para>
    </section><anchor xml:id="_mg__refine_8cpp_1ac015a84e19818e434f79916bc2e94d87"/>    <section>
    <title>mg_refine_orientations()</title>
<indexterm><primary>mg_refine_orientations</primary><secondary>mg_refine.cpp</secondary></indexterm>
<indexterm><primary>mg_refine.cpp</primary><secondary>mg_refine_orientations</secondary></indexterm>
<para><computeroutput>long mg_refine_orientations (<link linkend="_struct_bproject">Bproject</link> * project, <link linkend="_class_bstring">Bstring</link> &amp; reffile, <link linkend="_class_bstring">Bstring</link> &amp; maskfile, <link linkend="_class_bstring">Bstring</link> &amp; sym_string, int part_select, int max_iter, double alpha_step, double accuracy, double shift_step, double shift_accuracy, int fom_type, vector&lt; double &gt; weight, double hi_res, double lo_res, int kernel_width, int kernel_power, double edge_radius, double def_std, double shift_std, double view_std, double max_angle, double max_mag, int flags)</computeroutput></para><para>

<para>Refine the orientation and origin with respect to a reference map. </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>&amp;reffile</entry>
                                <entry>
<para>file containing reference map. </para>
</entry>
                            </row>
                            <row>
                                <entry>&amp;maskfile</entry>
                                <entry>
<para>file containing a real space mask (can be empty). </para>
</entry>
                            </row>
                            <row>
                                <entry>&amp;sym_string</entry>
                                <entry>
<para>point group symmetry designator. </para>
</entry>
                            </row>
                            <row>
                                <entry>part_select</entry>
                                <entry>
<para>particle selection for processing. </para>
</entry>
                            </row>
                            <row>
                                <entry>max_iter</entry>
                                <entry>
<para>Monte Carlo maximum number of refining iterations. </para>
</entry>
                            </row>
                            <row>
                                <entry>alpha_step</entry>
                                <entry>
<para>grid search angular step size. </para>
</entry>
                            </row>
                            <row>
                                <entry>accuracy</entry>
                                <entry>
<para>grid search accuracy. </para>
</entry>
                            </row>
                            <row>
                                <entry>shift_step</entry>
                                <entry>
<para>grid shift size. </para>
</entry>
                            </row>
                            <row>
                                <entry>shift_accuracy</entry>
                                <entry>
<para>grid shift accuracy. </para>
</entry>
                            </row>
                            <row>
                                <entry>fom_type</entry>
                                <entry>
<para>type of resolution measure: 0=FRC, 1=DPR </para>
</entry>
                            </row>
                            <row>
                                <entry>weight</entry>
                                <entry>
<para>1D reciprocal space weight curve. </para>
</entry>
                            </row>
                            <row>
                                <entry>hi_res</entry>
                                <entry>
<para>high resolution limit (angstrom). </para>
</entry>
                            </row>
                            <row>
                                <entry>lo_res</entry>
                                <entry>
<para>low resolution limit (angstrom). </para>
</entry>
                            </row>
                            <row>
                                <entry>kernel_width</entry>
                                <entry>
<para>interpolation kernel width. </para>
</entry>
                            </row>
                            <row>
                                <entry>kernel_power</entry>
                                <entry>
<para>interpolation kernel power. </para>
</entry>
                            </row>
                            <row>
                                <entry>edge_radius</entry>
                                <entry>
<para>edge radius to mask background using previous origin. </para>
</entry>
                            </row>
                            <row>
                                <entry>def_std</entry>
                                <entry>
<para>random defocus standard deviation </para>
</entry>
                            </row>
                            <row>
                                <entry>shift_std</entry>
                                <entry>
<para>random origin shift standard deviation. </para>
</entry>
                            </row>
                            <row>
                                <entry>view_std</entry>
                                <entry>
<para>random view shift standard deviation. </para>
</entry>
                            </row>
                            <row>
                                <entry>max_angle</entry>
                                <entry>
<para>maximum random rotation angle adjustment. </para>
</entry>
                            </row>
                            <row>
                                <entry>max_mag</entry>
                                <entry>
<para>maximum magnification adjustment. </para>
</entry>
                            </row>
                            <row>
                                <entry>flags</entry>
                                <entry>
<para>option flags. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>long number of comparisons, &lt;0 on error. <literallayout><computeroutput>The orientation, origin, magnitude and defocus are refined for each particle.
The default method uses a grid search around the existing view and origin.
Specifying the maximum number of iterations switches the algorithm to a
Monte Carlo search for the best parameters.
The FOM is either based on the FSC or the DPR.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 77 of file mg_refine.cpp.</para>
    </section><anchor xml:id="_mg__refine_8cpp_1a5e3ff68cd134b3bcc90a2d1c51519cde"/>    <section>
    <title>part_refine_orientation()</title>
<indexterm><primary>part_refine_orientation</primary><secondary>mg_refine.cpp</secondary></indexterm>
<indexterm><primary>mg_refine.cpp</primary><secondary>part_refine_orientation</secondary></indexterm>
<para><computeroutput>long part_refine_orientation (<link linkend="_struct_bparticle">Bparticle</link> * part, <link linkend="_class_bstring">Bstring</link> &amp; partfile, double pixel_size, <link linkend="_class_bimage">Bimage</link> * pref, <link linkend="_class_bimage">Bimage</link> * pmask, <link linkend="_struct_bsymmetry">Bsymmetry</link> * sym, int max_iter, double alpha_step, double accuracy, double shift_step, double shift_accuracy, double hi_res, double lo_res, int fom_type, vector&lt; double &gt; weight, double edge_radius, <link linkend="_class_c_t_fparam">CTFparam</link> * em_ctf, double def_std, double shift_std, double view_std, double max_angle, double max_mag, int flags, <link linkend="_class_f_s_i___kernel">FSI_Kernel</link> * kernel, <link linkend="_fft_8h_1a61d23c567e69684715ea52482137a5e6">fft_plan</link> planf)</computeroutput></para><para>

<para>Refine the orientation and origin of one particle with respect to a reference map. </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>*part</entry>
                                <entry>
<para>particle. </para>
</entry>
                            </row>
                            <row>
                                <entry>&amp;partfile</entry>
                                <entry>
<para>particle filename. </para>
</entry>
                            </row>
                            <row>
                                <entry>pixel_size</entry>
                                <entry>
<para>pixel size. </para>
</entry>
                            </row>
                            <row>
                                <entry>*pref</entry>
                                <entry>
<para>reference map. </para>
</entry>
                            </row>
                            <row>
                                <entry>*pmask</entry>
                                <entry>
<para>mask. </para>
</entry>
                            </row>
                            <row>
                                <entry>*sym</entry>
                                <entry>
<para>symmetry structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>max_iter</entry>
                                <entry>
<para>maximum number of refining iterations. </para>
</entry>
                            </row>
                            <row>
                                <entry>alpha_step</entry>
                                <entry>
<para>grid search angular step size. </para>
</entry>
                            </row>
                            <row>
                                <entry>accuracy</entry>
                                <entry>
<para>grid search accuracy. </para>
</entry>
                            </row>
                            <row>
                                <entry>shift_step</entry>
                                <entry>
<para>grid shift size. </para>
</entry>
                            </row>
                            <row>
                                <entry>shift_accuracy</entry>
                                <entry>
<para>grid shift accuracy. </para>
</entry>
                            </row>
                            <row>
                                <entry>hi_res</entry>
                                <entry>
<para>high resolution limit (angstrom). </para>
</entry>
                            </row>
                            <row>
                                <entry>lo_res</entry>
                                <entry>
<para>low resolution limit (angstrom). </para>
</entry>
                            </row>
                            <row>
                                <entry>fom_type</entry>
                                <entry>
<para>type of resolution measure: 0=FRC, 1=DPR </para>
</entry>
                            </row>
                            <row>
                                <entry>weight</entry>
                                <entry>
<para>1D reciprocal space weight curve. </para>
</entry>
                            </row>
                            <row>
                                <entry>edge_radius</entry>
                                <entry>
<para>edge radius to mask background using previous origin. </para>
</entry>
                            </row>
                            <row>
                                <entry>*em_ctf</entry>
                                <entry>
<para>CTF parameters (if NULL, not used). </para>
</entry>
                            </row>
                            <row>
                                <entry>def_std</entry>
                                <entry>
<para>random defocus standard deviation </para>
</entry>
                            </row>
                            <row>
                                <entry>shift_std</entry>
                                <entry>
<para>random origin shift standard deviation. </para>
</entry>
                            </row>
                            <row>
                                <entry>view_std</entry>
                                <entry>
<para>random view shift standard deviation. </para>
</entry>
                            </row>
                            <row>
                                <entry>max_angle</entry>
                                <entry>
<para>maximum random rotation angle adjustment. </para>
</entry>
                            </row>
                            <row>
                                <entry>max_mag</entry>
                                <entry>
<para>maximum magnification adjustment. </para>
</entry>
                            </row>
                            <row>
                                <entry>flags</entry>
                                <entry>
<para>option flags. </para>
</entry>
                            </row>
                            <row>
                                <entry>*kernel</entry>
                                <entry>
<para>interpolation kernel. </para>
</entry>
                            </row>
                            <row>
                                <entry>planf</entry>
                                <entry>
<para>FFT forward plan for 2D images. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>long number of comparisons. <literallayout><computeroutput>The orientation and origin are iteratively modified in small random steps,
with selection based on the Fourier shell correlation.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 492 of file mg_refine.cpp.</para>
    </section><anchor xml:id="_mg__refine_8cpp_1a1331dbbf289ab81924b877ebbe99d9de"/>    <section>
    <title>project_refine_orientations()</title>
<indexterm><primary>project_refine_orientations</primary><secondary>mg_refine.cpp</secondary></indexterm>
<indexterm><primary>mg_refine.cpp</primary><secondary>project_refine_orientations</secondary></indexterm>
<para><computeroutput>long project_refine_orientations (<link linkend="_struct_bproject">Bproject</link> * project, <link linkend="_class_bstring">Bstring</link> &amp; reffile, <link linkend="_class_bstring">Bstring</link> &amp; maskfile, <link linkend="_class_bstring">Bstring</link> &amp; sym_string, int part_select, int max_iter, double alpha_step, double accuracy, double shift_step, double shift_accuracy, int fom_type, vector&lt; double &gt; weight, double hi_res, double lo_res, int kernel_width, int kernel_power, double edge_radius, double def_std, double shift_std, double view_std, double max_angle, double max_mag, int flags)</computeroutput></para><para>
Definition at line 251 of file mg_refine.cpp.</para>
</section>
</section>
<section>
<title>Variable Documentation</title>
<anchor xml:id="_mg__refine_8cpp_1a0b2caeb4b6f130be43e5a2f0267dd453"/>    <section>
    <title>verbose</title>
<indexterm><primary>verbose</primary><secondary>mg_refine.cpp</secondary></indexterm>
<indexterm><primary>mg_refine.cpp</primary><secondary>verbose</secondary></indexterm>
<para><computeroutput>int verbose</computeroutput></para></section>
</section>
</section>
