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

<para>Functions to align micrographs or coordinates from micrographs and apply the resultant transformation. </para>
 
</para>
<programlisting>#include &quot;Bimage.h&quot;
#include &quot;mg_align.h&quot;
#include &quot;rwimg.h&quot;
#include &quot;mg_processing.h&quot;
#include &quot;mg_img_proc.h&quot;
#include &quot;marker.h&quot;
#include &quot;ps_marker.h&quot;
#include &quot;linked_list.h&quot;
#include &quot;utilities.h&quot;
#include &lt;sys/stat.h&gt;
</programlisting><simplesect>
    <title>Functions    </title>
        <itemizedlist>
            <listitem><para>int <link linkend="_mg__align_8cpp_1a9662f805dd1b4f10fb35674c1d8fa69b">mg_align_coordinates</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>, int refset)</para>

<para>Aligns the particle coordinates of a series of micrographs. </para>
</listitem>
            <listitem><para><link linkend="_class_transform">Transform</link> <link linkend="_mg__align_8cpp_1a19ceb9be403a648693874979f82d7feb">img_align</link> (<link linkend="_class_bimage">Bimage</link> *p1, <link linkend="_class_bimage">Bimage</link> *p2, <link linkend="_class_vector3">Vector3</link>&lt; long &gt; tile_size, double res_lo, double res_hi, double max_shift, int filter_flag, int refine_flag)</para>
</listitem>
            <listitem><para><link linkend="_class_bimage">Bimage</link> * <link linkend="_mg__align_8cpp_1a176bf0d896978cac8d499c66f823fe00">img_sum_subset</link> (<link linkend="_class_bimage">Bimage</link> *p, <link linkend="_class_bstring">Bstring</link> &amp;subset)</para>
</listitem>
            <listitem><para>int <link linkend="_mg__align_8cpp_1a0fe2a50ea1061b8f0363d1fec7330524">mg_align_micrographs</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>, int refset, <link linkend="_class_vector3">Vector3</link>&lt; long &gt; tile_size, double res_lo, double res_hi, double max_shift, int filter_flag, int refine_flag)</para>

<para>Aligns a focal series of micrographs. </para>
</listitem>
            <listitem><para><link linkend="_struct_bmarker">Bmarker</link> * <link linkend="_mg__align_8cpp_1acb712377db79369631608242a639a93b">img_extract_features</link> (<link linkend="_class_bimage">Bimage</link> *p, int extract_method, int target_num, double threshold)</para>
</listitem>
            <listitem><para>int <link linkend="_mg__align_8cpp_1a5d2476a740a9726a32dc3b6015793e4a">mg_align_feature_extraction</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>, int max_features, double res_low, double res_high, double thresh, int extract_method)</para>

<para>Aligns images by feature extraction. </para>
</listitem>
            <listitem><para>int <link linkend="_mg__align_8cpp_1a0a1dc07a0b30cc4755662a41bb53f4fd">mg_apply_transform</link> (<link linkend="_struct_bmicrograph">Bmicrograph</link> *mg_ref, <link linkend="_struct_bmicrograph">Bmicrograph</link> *mg_apply)</para>

<para>Applies a transformation to particle coordinates in a reference micrograph and writes them into an application micrograph structure. </para>
</listitem>
            <listitem><para>int <link linkend="_mg__align_8cpp_1a464413c7113e0c2f2da01c8164d4f5a1">mg_merge_focal_series</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>, int use_old_origins)</para>

<para>Merges corresponding particle images in each focal series. </para>
</listitem>
            <listitem><para>double <link linkend="_mg__align_8cpp_1a17fbd7215ccf763a55a666a07286aaae">field_write_aligned_average</link> (<link linkend="_struct_bfield">Bfield</link> *field, <link linkend="_class_bimage">Bimage</link> *pgr, <link linkend="_class_bstring">Bstring</link> &amp;imgfile, <link linkend="_utilities_8h_1ad8ed01ff3ff33333d8e19db4d2818bb6">DataType</link> datatype, <link linkend="_class_bstring">Bstring</link> &amp;subset, <link linkend="_class_bstring">Bstring</link> &amp;label)</para>
</listitem>
            <listitem><para>double <link linkend="_mg__align_8cpp_1a58112c76e8c506de184d17beddba225f">project_write_aligned_images</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>, <link linkend="_class_bimage">Bimage</link> *pgr, <link linkend="_class_bstring">Bstring</link> &amp;imgfile, <link linkend="_utilities_8h_1ad8ed01ff3ff33333d8e19db4d2818bb6">DataType</link> datatype, <link linkend="_class_bstring">Bstring</link> &amp;label)</para>

<para>Calculates aligned micrograph images and write them to a file. </para>
</listitem>
            <listitem><para>double <link linkend="_mg__align_8cpp_1a5d1eee0e8258aebc6ac84c690a1e7644">mg_write_average_frames</link> (<link linkend="_struct_bmicrograph">Bmicrograph</link> *mg, <link linkend="_class_bimage">Bimage</link> *pgr, <link linkend="_class_bstring">Bstring</link> &amp;avgfile, <link linkend="_utilities_8h_1ad8ed01ff3ff33333d8e19db4d2818bb6">DataType</link> datatype, <link linkend="_class_bstring">Bstring</link> &amp;subset, <link linkend="_class_bstring">Bstring</link> &amp;label)</para>
</listitem>
            <listitem><para>double <link linkend="_mg__align_8cpp_1af597091d3f2f71ae637a1fb486869626">project_write_average_frames</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>, <link linkend="_class_bimage">Bimage</link> *pgr, <link linkend="_class_bstring">Bstring</link> &amp;avgfile, <link linkend="_utilities_8h_1ad8ed01ff3ff33333d8e19db4d2818bb6">DataType</link> datatype, <link linkend="_class_bstring">Bstring</link> &amp;subset, <link linkend="_class_bstring">Bstring</link> &amp;label)</para>

<para>Calculates average micrograph frame images and write them to a file. </para>
</listitem>
            <listitem><para>double <link linkend="_mg__align_8cpp_1a3e2ec4d5f8d34b1007b30fbc51b03931">project_write_aligned_averages</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>, <link linkend="_class_bimage">Bimage</link> *pgr, <link linkend="_class_bstring">Bstring</link> &amp;imgfile, <link linkend="_utilities_8h_1ad8ed01ff3ff33333d8e19db4d2818bb6">DataType</link> datatype, <link linkend="_class_bstring">Bstring</link> &amp;subset, <link linkend="_class_bstring">Bstring</link> &amp;label)</para>

<para>Calculates aligned micrograph images and write them to a file. </para>
</listitem>
            <listitem><para>double <link linkend="_mg__align_8cpp_1aad1d203e84dd56f2adc89b6307358733">mg_align_frames</link> (<link linkend="_struct_bmicrograph">Bmicrograph</link> *mg, int ref_num, <link linkend="_class_bimage">Bimage</link> *pgr, <link linkend="_class_bimage">Bimage</link> *pmask, double hi_res, double lo_res, double shift_limit, double edge_width, double gauss_width, <link linkend="_class_vector3">Vector3</link>&lt; long &gt; bin, <link linkend="_class_j_svalue">JSvalue</link> &amp;dose_frac, <link linkend="_class_bstring">Bstring</link> &amp;subset, int flag)</para>
</listitem>
            <listitem><para>double <link linkend="_mg__align_8cpp_1ad84b9a3135d6cee9b1a669204280ce3f">project_align_frames</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>, int ref_img, <link linkend="_class_bimage">Bimage</link> *pgr, <link linkend="_class_bimage">Bimage</link> *pmask, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; origin, double hi_res, double lo_res, double shift_limit, double edge_width, double gauss_width, <link linkend="_class_vector3">Vector3</link>&lt; long &gt; bin, <link linkend="_class_j_svalue">JSvalue</link> &amp;dose_frac, <link linkend="_class_bstring">Bstring</link> &amp;subset, int flag)</para>

<para>Aligns a series of micrographs by cross-correlation. </para>
</listitem>
            <listitem><para>double <link linkend="_mg__align_8cpp_1ad4a7de67247aaaced780f45ccad7dca0">mg_align_series</link> (<link linkend="_struct_bmicrograph">Bmicrograph</link> *mg, <link linkend="_struct_bmicrograph">Bmicrograph</link> *mg_ref, <link linkend="_class_bimage">Bimage</link> *pref, <link linkend="_class_bimage">Bimage</link> *pgr, <link linkend="_class_bimage">Bimage</link> *pmask, double hi_res, double lo_res, double shift_limit, double edge_width, double gauss_width, <link linkend="_class_vector3">Vector3</link>&lt; long &gt; bin, <link linkend="_fft_8h_1a61d23c567e69684715ea52482137a5e6">fft_plan</link> <link linkend="_bico_8cpp_1a6ecaa8728bab23c3a7d96fe0cadc75f2">planf</link>, <link linkend="_fft_8h_1a61d23c567e69684715ea52482137a5e6">fft_plan</link> <link linkend="_bico_8cpp_1a9ec8849996c5e210d7b7e8e05b98639d">planb</link>)</para>
</listitem>
            <listitem><para>double <link linkend="_mg__align_8cpp_1a49209cd440a08fff2a380c3b97b66dfe">field_align_series</link> (<link linkend="_struct_bfield">Bfield</link> *field, int ref_img, <link linkend="_class_bimage">Bimage</link> *pgr, <link linkend="_class_bimage">Bimage</link> *pmask, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; origin, double hi_res, double lo_res, double shift_limit, double edge_width, double gauss_width, <link linkend="_class_vector3">Vector3</link>&lt; long &gt; bin, <link linkend="_class_bstring">Bstring</link> &amp;subset, int flag)</para>
</listitem>
            <listitem><para>double <link linkend="_mg__align_8cpp_1a50e01b298843bf4dff716d2f15ae92c8">project_align_series</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>, int ref_img, <link linkend="_class_bimage">Bimage</link> *pgr, <link linkend="_class_bimage">Bimage</link> *pmask, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; origin, double hi_res, double lo_res, double shift_limit, double edge_width, double gauss_width, <link linkend="_class_vector3">Vector3</link>&lt; long &gt; bin, <link linkend="_class_bstring">Bstring</link> &amp;subset, int flag)</para>

<para>Aligns a series of micrographs by cross-correlation. </para>
</listitem>
            <listitem><para><link linkend="_class_bimage">Bimage</link> * <link linkend="_mg__align_8cpp_1a0f4eda64e436666cd19451101fc74d2f">mg_tomo_reconstruct</link> (<link linkend="_struct_bmicrograph">Bmicrograph</link> **mgarr, long mg_id, long mg_min, long mg_max, double hi_res, double scale, <link linkend="_class_vector3">Vector3</link>&lt; long &gt; size, long ft_size, <link linkend="_fft_8h_1a61d23c567e69684715ea52482137a5e6">fft_plan</link> <link linkend="_bico_8cpp_1a6ecaa8728bab23c3a7d96fe0cadc75f2">planf</link>, <link linkend="_fft_8h_1a61d23c567e69684715ea52482137a5e6">fft_plan</link> <link linkend="_bico_8cpp_1a9ec8849996c5e210d7b7e8e05b98639d">planb</link>)</para>
</listitem>
            <listitem><para>double <link linkend="_mg__align_8cpp_1a4371b97a29446b84d976d6b9abfe6fda">mg_reconstruct_align</link> (<link linkend="_struct_bmicrograph">Bmicrograph</link> **mgarr, long nmg, long mg_id, long dimg, double resolution, double shift_limit, <link linkend="_class_vector3">Vector3</link>&lt; long &gt; size, double edge_width, double gauss_width, long ft_size, <link linkend="_fft_8h_1a61d23c567e69684715ea52482137a5e6">fft_plan</link> <link linkend="_bico_8cpp_1a6ecaa8728bab23c3a7d96fe0cadc75f2">planf</link>, <link linkend="_fft_8h_1a61d23c567e69684715ea52482137a5e6">fft_plan</link> <link linkend="_bico_8cpp_1a9ec8849996c5e210d7b7e8e05b98639d">planb</link>)</para>
</listitem>
            <listitem><para>long <link linkend="_mg__align_8cpp_1a286ff99aa89b275a1b02a048b80e05c3">project_tomo_align</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>, long thickness, long iter, double dchange, long dimg, double resolution, double shift_limit, double edge_width, double gauss_width)</para>
</listitem>
            <listitem><para>double <link linkend="_mg__align_8cpp_1aa5b1f1dacbaf2cab60b14750f79a6b4d">field_ssnr</link> (<link linkend="_struct_bfield">Bfield</link> *field, <link linkend="_fft_8h_1a61d23c567e69684715ea52482137a5e6">fft_plan</link> plan)</para>
</listitem>
            <listitem><para>double <link linkend="_mg__align_8cpp_1a652a4146eb754826c2dac44f7e9fae7d">project_ssnr</link> (<link linkend="_struct_bproject">Bproject</link> *<link linkend="_tcltk__bmodel_8cpp_1aea438e09dfc03683a0f49a05e9a69cac">project</link>)</para>
</listitem>
        </itemizedlist>
</simplesect>
<simplesect>
    <title>Variables    </title>
        <itemizedlist>
            <listitem><para>int <link linkend="_mg__align_8cpp_1a0b2caeb4b6f130be43e5a2f0267dd453">verbose</link></para>
</listitem>
        </itemizedlist>
</simplesect>
<section>
<title>Detailed Description</title>

<para>Functions to align micrographs or coordinates from micrographs and apply the resultant transformation. </para>

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

<para>Bernard Heymann and Samuel Payne </para>
</formalpara>
<formalpara><title>Date: </title>

<para>Created: 20000505 </para>

<para>Modified: 20191125 (BH) </para>
</formalpara>
</para>
</section>
<section>
<title>Function Documentation</title>
<anchor xml:id="_mg__align_8cpp_1a49209cd440a08fff2a380c3b97b66dfe"/>    <section>
    <title>field_align_series()</title>
<indexterm><primary>field_align_series</primary><secondary>mg_align.cpp</secondary></indexterm>
<indexterm><primary>mg_align.cpp</primary><secondary>field_align_series</secondary></indexterm>
<para><computeroutput>double field_align_series (<link linkend="_struct_bfield">Bfield</link> * field, int ref_img, <link linkend="_class_bimage">Bimage</link> * pgr, <link linkend="_class_bimage">Bimage</link> * pmask, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; origin, double hi_res, double lo_res, double shift_limit, double edge_width, double gauss_width, <link linkend="_class_vector3">Vector3</link>&lt; long &gt; bin, <link linkend="_class_bstring">Bstring</link> &amp; subset, int flag)</computeroutput></para><para>
Definition at line 1400 of file mg_align.cpp.</para>
    </section><anchor xml:id="_mg__align_8cpp_1aa5b1f1dacbaf2cab60b14750f79a6b4d"/>    <section>
    <title>field_ssnr()</title>
<indexterm><primary>field_ssnr</primary><secondary>mg_align.cpp</secondary></indexterm>
<indexterm><primary>mg_align.cpp</primary><secondary>field_ssnr</secondary></indexterm>
<para><computeroutput>double field_ssnr (<link linkend="_struct_bfield">Bfield</link> * field, <link linkend="_fft_8h_1a61d23c567e69684715ea52482137a5e6">fft_plan</link> plan)</computeroutput></para><para>
Definition at line 1880 of file mg_align.cpp.</para>
    </section><anchor xml:id="_mg__align_8cpp_1a17fbd7215ccf763a55a666a07286aaae"/>    <section>
    <title>field_write_aligned_average()</title>
<indexterm><primary>field_write_aligned_average</primary><secondary>mg_align.cpp</secondary></indexterm>
<indexterm><primary>mg_align.cpp</primary><secondary>field_write_aligned_average</secondary></indexterm>
<para><computeroutput>double field_write_aligned_average (<link linkend="_struct_bfield">Bfield</link> * field, <link linkend="_class_bimage">Bimage</link> * pgr, <link linkend="_class_bstring">Bstring</link> &amp; imgfile, <link linkend="_utilities_8h_1ad8ed01ff3ff33333d8e19db4d2818bb6">DataType</link> datatype, <link linkend="_class_bstring">Bstring</link> &amp; subset, <link linkend="_class_bstring">Bstring</link> &amp; label)</computeroutput></para><para>
Definition at line 863 of file mg_align.cpp.</para>
    </section><anchor xml:id="_mg__align_8cpp_1a19ceb9be403a648693874979f82d7feb"/>    <section>
    <title>img_align()</title>
<indexterm><primary>img_align</primary><secondary>mg_align.cpp</secondary></indexterm>
<indexterm><primary>mg_align.cpp</primary><secondary>img_align</secondary></indexterm>
<para><computeroutput><link linkend="_class_transform">Transform</link> img_align (<link linkend="_class_bimage">Bimage</link> * p1, <link linkend="_class_bimage">Bimage</link> * p2, <link linkend="_class_vector3">Vector3</link>&lt; long &gt; tile_size, double res_lo, double res_hi, double max_shift, int filter_flag, int refine_flag)</computeroutput></para><para>
Definition at line 107 of file mg_align.cpp.</para>
    </section><anchor xml:id="_mg__align_8cpp_1acb712377db79369631608242a639a93b"/>    <section>
    <title>img_extract_features()</title>
<indexterm><primary>img_extract_features</primary><secondary>mg_align.cpp</secondary></indexterm>
<indexterm><primary>mg_align.cpp</primary><secondary>img_extract_features</secondary></indexterm>
<para><computeroutput><link linkend="_struct_bmarker">Bmarker</link>* img_extract_features (<link linkend="_class_bimage">Bimage</link> * p, int extract_method, int target_num, double threshold)</computeroutput></para><para>
Definition at line 402 of file mg_align.cpp.</para>
    </section><anchor xml:id="_mg__align_8cpp_1a176bf0d896978cac8d499c66f823fe00"/>    <section>
    <title>img_sum_subset()</title>
<indexterm><primary>img_sum_subset</primary><secondary>mg_align.cpp</secondary></indexterm>
<indexterm><primary>mg_align.cpp</primary><secondary>img_sum_subset</secondary></indexterm>
<para><computeroutput><link linkend="_class_bimage">Bimage</link>* img_sum_subset (<link linkend="_class_bimage">Bimage</link> * p, <link linkend="_class_bstring">Bstring</link> &amp; subset)</computeroutput></para><para>
Definition at line 249 of file mg_align.cpp.</para>
    </section><anchor xml:id="_mg__align_8cpp_1a9662f805dd1b4f10fb35674c1d8fa69b"/>    <section>
    <title>mg_align_coordinates()</title>
<indexterm><primary>mg_align_coordinates</primary><secondary>mg_align.cpp</secondary></indexterm>
<indexterm><primary>mg_align.cpp</primary><secondary>mg_align_coordinates</secondary></indexterm>
<para><computeroutput>int mg_align_coordinates (<link linkend="_struct_bproject">Bproject</link> * project, int refset)</computeroutput></para><para>

<para>Aligns the particle coordinates of a series of micrographs. </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>refset</entry>
                                <entry>
<para>reference image or set of coordinates (-1 means undefined). </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int 0. <literallayout><computeroutput>The sets of micrograph coordinates of a focal series in an image 
processing parameter structure are fitted to each other, giving a 
rotation angle, and shifting and scaling in x and y for each pair 
of micrographs.
There must be the same number of particles in each micrograph
of a focal series.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 38 of file mg_align.cpp.</para>
    </section><anchor xml:id="_mg__align_8cpp_1a5d2476a740a9726a32dc3b6015793e4a"/>    <section>
    <title>mg_align_feature_extraction()</title>
<indexterm><primary>mg_align_feature_extraction</primary><secondary>mg_align.cpp</secondary></indexterm>
<indexterm><primary>mg_align.cpp</primary><secondary>mg_align_feature_extraction</secondary></indexterm>
<para><computeroutput>int mg_align_feature_extraction (<link linkend="_struct_bproject">Bproject</link> * project, int max_features, double res_low, double res_high, double thresh, int extract_method)</computeroutput></para><para>

<para>Aligns images by feature extraction. </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>*project</entry>
                                <entry>
<para>the set of image parameters </para>
</entry>
                            </row>
                            <row>
                                <entry>max_features</entry>
                                <entry>
<para>the maximum number of features to extract </para>
</entry>
                            </row>
                            <row>
                                <entry>res_low</entry>
                                <entry>
<para>the low resolution limit </para>
</entry>
                            </row>
                            <row>
                                <entry>res_high</entry>
                                <entry>
<para>the high resolution limit </para>
</entry>
                            </row>
                            <row>
                                <entry>thresh</entry>
                                <entry>
<para>threshold used for feature extraction </para>
</entry>
                            </row>
                            <row>
                                <entry>extract_method</entry>
                                <entry>
<para>method used for finding the center of particles </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int error code.</para>
</formalpara>
Calculates the transformation parameters for each set images, by picking features in the images and finding the best fit for the matching of the features.</para>

<para>The features are picked and returned using function <link linkend="_mg__align_8cpp_1acb712377db79369631608242a639a93b">img_extract_features()</link>. The set of features is sent to find_transform_params() that finds the transformation parameters that relate the images to each other. The shift in xy directions, the scale in xy directions, and rotation angle is returned. The program works best if the images have at least 40 distinct features. </para>
<para>
Definition at line 541 of file mg_align.cpp.</para>
    </section><anchor xml:id="_mg__align_8cpp_1aad1d203e84dd56f2adc89b6307358733"/>    <section>
    <title>mg_align_frames()</title>
<indexterm><primary>mg_align_frames</primary><secondary>mg_align.cpp</secondary></indexterm>
<indexterm><primary>mg_align.cpp</primary><secondary>mg_align_frames</secondary></indexterm>
<para><computeroutput>double mg_align_frames (<link linkend="_struct_bmicrograph">Bmicrograph</link> * mg, int ref_num, <link linkend="_class_bimage">Bimage</link> * pgr, <link linkend="_class_bimage">Bimage</link> * pmask, double hi_res, double lo_res, double shift_limit, double edge_width, double gauss_width, <link linkend="_class_vector3">Vector3</link>&lt; long &gt; bin, <link linkend="_class_j_svalue">JSvalue</link> &amp; dose_frac, <link linkend="_class_bstring">Bstring</link> &amp; subset, int flag)</computeroutput></para><para>
Definition at line 1183 of file mg_align.cpp.</para>
    </section><anchor xml:id="_mg__align_8cpp_1a0fe2a50ea1061b8f0363d1fec7330524"/>    <section>
    <title>mg_align_micrographs()</title>
<indexterm><primary>mg_align_micrographs</primary><secondary>mg_align.cpp</secondary></indexterm>
<indexterm><primary>mg_align.cpp</primary><secondary>mg_align_micrographs</secondary></indexterm>
<para><computeroutput>int mg_align_micrographs (<link linkend="_struct_bproject">Bproject</link> * project, int refset, <link linkend="_class_vector3">Vector3</link>&lt; long &gt; tile_size, double res_lo, double res_hi, double max_shift, int filter_flag, int refine_flag)</computeroutput></para><para>

<para>Aligns a focal series of micrographs. </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>parameter structure. </para>
</entry>
                            </row>
                            <row>
                                <entry>refset</entry>
                                <entry>
<para>reference image or set of coordinates (&lt; 1 means undefined). </para>
</entry>
                            </row>
                            <row>
                                <entry>tile_size</entry>
                                <entry>
<para>3-valued vector for the size of sub-images. </para>
</entry>
                            </row>
                            <row>
                                <entry>res_lo</entry>
                                <entry>
<para>low resolution limit for cross-correlation. </para>
</entry>
                            </row>
                            <row>
                                <entry>res_hi</entry>
                                <entry>
<para>high resolution limit for cross-correlation. </para>
</entry>
                            </row>
                            <row>
                                <entry>max_shift</entry>
                                <entry>
<para>maximum shift allowed (default 1/4 of tile). </para>
</entry>
                            </row>
                            <row>
                                <entry>filter_flag</entry>
                                <entry>
<para>flag to filter micrograph extremes. </para>
</entry>
                            </row>
                            <row>
                                <entry>refine_flag</entry>
                                <entry>
<para>flag to turn on refinement of shift. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int 0, &lt;0 on error. <literallayout><computeroutput>A series of micrograph images specified in an image processing 
parameter structure are aligned by segmented cross-correlation. The 
micrograph data blocks are assumed to be arranged with a series in
consequent data blocks. The micrographs are segmented into tiles 
and the tile shifts with respect to each other determined by 
cross-correlation. The shifts are assumed to most accurately 
represent the displacement of the center of one tile with respect 
to the center of the corresponding tile in the other micrograph.
The resultant sets of coordinates are fitted to each
other, giving a 3-value shift vector, a 3-value scale vector,
and a rotation angle for each pair of micrographs.
A reference micrograph is chosen as:
    1.  the first micrograph with particle coordinates
    2.  otherwise, the first micrograph
If coordinates are supplied for particles in the reference micrograph,
the determined transformation parameters are applied and written into
the other micrograph structures.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 315 of file mg_align.cpp.</para>
    </section><anchor xml:id="_mg__align_8cpp_1ad4a7de67247aaaced780f45ccad7dca0"/>    <section>
    <title>mg_align_series()</title>
<indexterm><primary>mg_align_series</primary><secondary>mg_align.cpp</secondary></indexterm>
<indexterm><primary>mg_align.cpp</primary><secondary>mg_align_series</secondary></indexterm>
<para><computeroutput>double mg_align_series (<link linkend="_struct_bmicrograph">Bmicrograph</link> * mg, <link linkend="_struct_bmicrograph">Bmicrograph</link> * mg_ref, <link linkend="_class_bimage">Bimage</link> * pref, <link linkend="_class_bimage">Bimage</link> * pgr, <link linkend="_class_bimage">Bimage</link> * pmask, double hi_res, double lo_res, double shift_limit, double edge_width, double gauss_width, <link linkend="_class_vector3">Vector3</link>&lt; long &gt; bin, <link linkend="_fft_8h_1a61d23c567e69684715ea52482137a5e6">fft_plan</link> planf, <link linkend="_fft_8h_1a61d23c567e69684715ea52482137a5e6">fft_plan</link> planb)</computeroutput></para><para>
Definition at line 1356 of file mg_align.cpp.</para>
    </section><anchor xml:id="_mg__align_8cpp_1a0a1dc07a0b30cc4755662a41bb53f4fd"/>    <section>
    <title>mg_apply_transform()</title>
<indexterm><primary>mg_apply_transform</primary><secondary>mg_align.cpp</secondary></indexterm>
<indexterm><primary>mg_align.cpp</primary><secondary>mg_apply_transform</secondary></indexterm>
<para><computeroutput>int mg_apply_transform (<link linkend="_struct_bmicrograph">Bmicrograph</link> * mg_ref, <link linkend="_struct_bmicrograph">Bmicrograph</link> * mg_apply)</computeroutput></para><para>

<para>Applies a transformation to particle coordinates in a reference micrograph and writes them into an application micrograph structure. </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_ref</entry>
                                <entry>
<para>micrograph used as reference. </para>
</entry>
                            </row>
                            <row>
                                <entry>*mg_apply</entry>
                                <entry>
<para>micrograph to apply transformation to. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int 0. <literallayout><computeroutput>The transformation parameters specified in the second micrograph
are used.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 630 of file mg_align.cpp.</para>
    </section><anchor xml:id="_mg__align_8cpp_1a464413c7113e0c2f2da01c8164d4f5a1"/>    <section>
    <title>mg_merge_focal_series()</title>
<indexterm><primary>mg_merge_focal_series</primary><secondary>mg_align.cpp</secondary></indexterm>
<indexterm><primary>mg_align.cpp</primary><secondary>mg_merge_focal_series</secondary></indexterm>
<para><computeroutput>int mg_merge_focal_series (<link linkend="_struct_bproject">Bproject</link> * project, int use_old_origins)</computeroutput></para><para>

<para>Merges corresponding particle images in each focal series. </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>use_old_origins</entry>
                                <entry>
<para>flag to use old origins rather than cross-correlation. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>int error code. </para>
</formalpara>
</para>
<para>
Definition at line 762 of file mg_align.cpp.</para>
    </section><anchor xml:id="_mg__align_8cpp_1a4371b97a29446b84d976d6b9abfe6fda"/>    <section>
    <title>mg_reconstruct_align()</title>
<indexterm><primary>mg_reconstruct_align</primary><secondary>mg_align.cpp</secondary></indexterm>
<indexterm><primary>mg_align.cpp</primary><secondary>mg_reconstruct_align</secondary></indexterm>
<para><computeroutput>double mg_reconstruct_align (<link linkend="_struct_bmicrograph">Bmicrograph</link> ** mgarr, long nmg, long mg_id, long dimg, double resolution, double shift_limit, <link linkend="_class_vector3">Vector3</link>&lt; long &gt; size, double edge_width, double gauss_width, long ft_size, <link linkend="_fft_8h_1a61d23c567e69684715ea52482137a5e6">fft_plan</link> planf, <link linkend="_fft_8h_1a61d23c567e69684715ea52482137a5e6">fft_plan</link> planb)</computeroutput></para><para>
Definition at line 1685 of file mg_align.cpp.</para>
    </section><anchor xml:id="_mg__align_8cpp_1a0f4eda64e436666cd19451101fc74d2f"/>    <section>
    <title>mg_tomo_reconstruct()</title>
<indexterm><primary>mg_tomo_reconstruct</primary><secondary>mg_align.cpp</secondary></indexterm>
<indexterm><primary>mg_align.cpp</primary><secondary>mg_tomo_reconstruct</secondary></indexterm>
<para><computeroutput><link linkend="_class_bimage">Bimage</link>* mg_tomo_reconstruct (<link linkend="_struct_bmicrograph">Bmicrograph</link> ** mgarr, long mg_id, long mg_min, long mg_max, double hi_res, double scale, <link linkend="_class_vector3">Vector3</link>&lt; long &gt; size, long ft_size, <link linkend="_fft_8h_1a61d23c567e69684715ea52482137a5e6">fft_plan</link> planf, <link linkend="_fft_8h_1a61d23c567e69684715ea52482137a5e6">fft_plan</link> planb)</computeroutput></para><para>
Definition at line 1574 of file mg_align.cpp.</para>
    </section><anchor xml:id="_mg__align_8cpp_1a5d1eee0e8258aebc6ac84c690a1e7644"/>    <section>
    <title>mg_write_average_frames()</title>
<indexterm><primary>mg_write_average_frames</primary><secondary>mg_align.cpp</secondary></indexterm>
<indexterm><primary>mg_align.cpp</primary><secondary>mg_write_average_frames</secondary></indexterm>
<para><computeroutput>double mg_write_average_frames (<link linkend="_struct_bmicrograph">Bmicrograph</link> * mg, <link linkend="_class_bimage">Bimage</link> * pgr, <link linkend="_class_bstring">Bstring</link> &amp; avgfile, <link linkend="_utilities_8h_1ad8ed01ff3ff33333d8e19db4d2818bb6">DataType</link> datatype, <link linkend="_class_bstring">Bstring</link> &amp; subset, <link linkend="_class_bstring">Bstring</link> &amp; label)</computeroutput></para><para>
Definition at line 1011 of file mg_align.cpp.</para>
    </section><anchor xml:id="_mg__align_8cpp_1ad84b9a3135d6cee9b1a669204280ce3f"/>    <section>
    <title>project_align_frames()</title>
<indexterm><primary>project_align_frames</primary><secondary>mg_align.cpp</secondary></indexterm>
<indexterm><primary>mg_align.cpp</primary><secondary>project_align_frames</secondary></indexterm>
<para><computeroutput>double project_align_frames (<link linkend="_struct_bproject">Bproject</link> * project, int ref_img, <link linkend="_class_bimage">Bimage</link> * pgr, <link linkend="_class_bimage">Bimage</link> * pmask, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; origin, double hi_res, double lo_res, double shift_limit, double edge_width, double gauss_width, <link linkend="_class_vector3">Vector3</link>&lt; long &gt; bin, <link linkend="_class_j_svalue">JSvalue</link> &amp; dose_frac, <link linkend="_class_bstring">Bstring</link> &amp; subset, int flag)</computeroutput></para><para>

<para>Aligns a series of micrographs by cross-correlation. </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>ref_img</entry>
                                <entry>
<para>reference frame number (starts from 0). </para>
</entry>
                            </row>
                            <row>
                                <entry>*pgr</entry>
                                <entry>
<para>gain reference. </para>
</entry>
                            </row>
                            <row>
                                <entry>*pmask</entry>
                                <entry>
<para>reciprocal space mask, 0&apos;s and 1&apos;s. </para>
</entry>
                            </row>
                            <row>
                                <entry>origin</entry>
                                <entry>
<para>tilt origin. </para>
</entry>
                            </row>
                            <row>
                                <entry>hi_res</entry>
                                <entry>
<para>high resolution limit. </para>
</entry>
                            </row>
                            <row>
                                <entry>lo_res</entry>
                                <entry>
<para>low resolution limit. </para>
</entry>
                            </row>
                            <row>
                                <entry>shift_limit</entry>
                                <entry>
<para>maximum shift from nominal origin of image. </para>
</entry>
                            </row>
                            <row>
                                <entry>edge_width</entry>
                                <entry>
<para>edge smoothing width (not done if 0). </para>
</entry>
                            </row>
                            <row>
                                <entry>gauss_width</entry>
                                <entry>
<para>edge decay width. </para>
</entry>
                            </row>
                            <row>
                                <entry>bin</entry>
                                <entry>
<para>3-value vector of integer bin factors. </para>
</entry>
                            </row>
                            <row>
                                <entry>dose_frac</entry>
                                <entry>
<para>dose fractionation parameters. </para>
</entry>
                            </row>
                            <row>
                                <entry>subset</entry>
                                <entry>
<para>a subset to sum. </para>
</entry>
                            </row>
                            <row>
                                <entry>flag</entry>
                                <entry>
<para>options flag. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>double root-mean-square of offsets. <literallayout><computeroutput>Each micrograph frame is cross-correlated with the reference
frame and the shift determined.
Options encoded in the flag:
1   rescale image based on histogram.
2   weigh by accumulated dose.
4   write aligned frames with insert &quot;_aln&quot;.
8   write aligned frame sum with insert &quot;_sum&quot;.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 1307 of file mg_align.cpp.</para>
    </section><anchor xml:id="_mg__align_8cpp_1a50e01b298843bf4dff716d2f15ae92c8"/>    <section>
    <title>project_align_series()</title>
<indexterm><primary>project_align_series</primary><secondary>mg_align.cpp</secondary></indexterm>
<indexterm><primary>mg_align.cpp</primary><secondary>project_align_series</secondary></indexterm>
<para><computeroutput>double project_align_series (<link linkend="_struct_bproject">Bproject</link> * project, int ref_img, <link linkend="_class_bimage">Bimage</link> * pgr, <link linkend="_class_bimage">Bimage</link> * pmask, <link linkend="_class_vector3">Vector3</link>&lt; double &gt; origin, double hi_res, double lo_res, double shift_limit, double edge_width, double gauss_width, <link linkend="_class_vector3">Vector3</link>&lt; long &gt; bin, <link linkend="_class_bstring">Bstring</link> &amp; subset, int flag)</computeroutput></para><para>

<para>Aligns a series of micrographs by cross-correlation. </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>ref_img</entry>
                                <entry>
<para>reference micrograph number (starts from 0). </para>
</entry>
                            </row>
                            <row>
                                <entry>*pgr</entry>
                                <entry>
<para>gain reference. </para>
</entry>
                            </row>
                            <row>
                                <entry>*pmask</entry>
                                <entry>
<para>reciprocal space mask, 0&apos;s and 1&apos;s. </para>
</entry>
                            </row>
                            <row>
                                <entry>origin</entry>
                                <entry>
<para>tilt origin. </para>
</entry>
                            </row>
                            <row>
                                <entry>hi_res</entry>
                                <entry>
<para>high resolution limit. </para>
</entry>
                            </row>
                            <row>
                                <entry>lo_res</entry>
                                <entry>
<para>low resolution limit. </para>
</entry>
                            </row>
                            <row>
                                <entry>shift_limit</entry>
                                <entry>
<para>maximum shift from nominal origin of image. </para>
</entry>
                            </row>
                            <row>
                                <entry>edge_width</entry>
                                <entry>
<para>edge smoothing width (not done if 0). </para>
</entry>
                            </row>
                            <row>
                                <entry>gauss_width</entry>
                                <entry>
<para>edge decay width. </para>
</entry>
                            </row>
                            <row>
                                <entry>bin</entry>
                                <entry>
<para>3-value vector of integer bin factors. </para>
</entry>
                            </row>
                            <row>
                                <entry>&amp;subset</entry>
                                <entry>
<para>subset to average (all if empty) </para>
</entry>
                            </row>
                            <row>
                                <entry>flag</entry>
                                <entry>
<para>options flag. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>double root-mean-square of offsets. <literallayout><computeroutput>Each micrograph in the series is cross-correlated with the reference
micrograph and the shift determined.
Options encoded in the flag:
1   rescale image based on histogram.
2   weigh by accumulated dose.
4   write aligned frames with insert &quot;_aln&quot;.
8   write aligned frame sum with insert &quot;_avg&quot;.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 1532 of file mg_align.cpp.</para>
    </section><anchor xml:id="_mg__align_8cpp_1a652a4146eb754826c2dac44f7e9fae7d"/>    <section>
    <title>project_ssnr()</title>
<indexterm><primary>project_ssnr</primary><secondary>mg_align.cpp</secondary></indexterm>
<indexterm><primary>mg_align.cpp</primary><secondary>project_ssnr</secondary></indexterm>
<para><computeroutput>double project_ssnr (<link linkend="_struct_bproject">Bproject</link> * project)</computeroutput></para><para>
Definition at line 1939 of file mg_align.cpp.</para>
    </section><anchor xml:id="_mg__align_8cpp_1a286ff99aa89b275a1b02a048b80e05c3"/>    <section>
    <title>project_tomo_align()</title>
<indexterm><primary>project_tomo_align</primary><secondary>mg_align.cpp</secondary></indexterm>
<indexterm><primary>mg_align.cpp</primary><secondary>project_tomo_align</secondary></indexterm>
<para><computeroutput>long project_tomo_align (<link linkend="_struct_bproject">Bproject</link> * project, long thickness, long iter, double dchange, long dimg, double resolution, double shift_limit, double edge_width, double gauss_width)</computeroutput></para><para>
Definition at line 1783 of file mg_align.cpp.</para>
    </section><anchor xml:id="_mg__align_8cpp_1a3e2ec4d5f8d34b1007b30fbc51b03931"/>    <section>
    <title>project_write_aligned_averages()</title>
<indexterm><primary>project_write_aligned_averages</primary><secondary>mg_align.cpp</secondary></indexterm>
<indexterm><primary>mg_align.cpp</primary><secondary>project_write_aligned_averages</secondary></indexterm>
<para><computeroutput>double project_write_aligned_averages (<link linkend="_struct_bproject">Bproject</link> * project, <link linkend="_class_bimage">Bimage</link> * pgr, <link linkend="_class_bstring">Bstring</link> &amp; imgfile, <link linkend="_utilities_8h_1ad8ed01ff3ff33333d8e19db4d2818bb6">DataType</link> datatype, <link linkend="_class_bstring">Bstring</link> &amp; subset, <link linkend="_class_bstring">Bstring</link> &amp; label)</computeroutput></para><para>

<para>Calculates aligned micrograph images and write them to a file. </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>micrograph project. </para>
</entry>
                            </row>
                            <row>
                                <entry>*pgr</entry>
                                <entry>
<para>gain reference. </para>
</entry>
                            </row>
                            <row>
                                <entry>&amp;imgfile</entry>
                                <entry>
<para>output image file name. </para>
</entry>
                            </row>
                            <row>
                                <entry>datatype</entry>
                                <entry>
<para>output data type. </para>
</entry>
                            </row>
                            <row>
                                <entry>&amp;subset</entry>
                                <entry>
<para>subset to average (all if empty) </para>
</entry>
                            </row>
                            <row>
                                <entry>&amp;label</entry>
                                <entry>
<para>string to write into image headers. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>double average SNR. <literallayout><computeroutput>Only the origin is adjusted.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 1122 of file mg_align.cpp.</para>
    </section><anchor xml:id="_mg__align_8cpp_1a58112c76e8c506de184d17beddba225f"/>    <section>
    <title>project_write_aligned_images()</title>
<indexterm><primary>project_write_aligned_images</primary><secondary>mg_align.cpp</secondary></indexterm>
<indexterm><primary>mg_align.cpp</primary><secondary>project_write_aligned_images</secondary></indexterm>
<para><computeroutput>double project_write_aligned_images (<link linkend="_struct_bproject">Bproject</link> * project, <link linkend="_class_bimage">Bimage</link> * pgr, <link linkend="_class_bstring">Bstring</link> &amp; imgfile, <link linkend="_utilities_8h_1ad8ed01ff3ff33333d8e19db4d2818bb6">DataType</link> datatype, <link linkend="_class_bstring">Bstring</link> &amp; label)</computeroutput></para><para>

<para>Calculates aligned micrograph images and write them to a file. </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>micrograph project. </para>
</entry>
                            </row>
                            <row>
                                <entry>*pgr</entry>
                                <entry>
<para>gain reference. </para>
</entry>
                            </row>
                            <row>
                                <entry>&amp;imgfile</entry>
                                <entry>
<para>output image file name. </para>
</entry>
                            </row>
                            <row>
                                <entry>datatype</entry>
                                <entry>
<para>output data type. </para>
</entry>
                            </row>
                            <row>
                                <entry>&amp;label</entry>
                                <entry>
<para>string to write into image headers. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>double 0. <literallayout><computeroutput>Only the origin is adjusted.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 950 of file mg_align.cpp.</para>
    </section><anchor xml:id="_mg__align_8cpp_1af597091d3f2f71ae637a1fb486869626"/>    <section>
    <title>project_write_average_frames()</title>
<indexterm><primary>project_write_average_frames</primary><secondary>mg_align.cpp</secondary></indexterm>
<indexterm><primary>mg_align.cpp</primary><secondary>project_write_average_frames</secondary></indexterm>
<para><computeroutput>double project_write_average_frames (<link linkend="_struct_bproject">Bproject</link> * project, <link linkend="_class_bimage">Bimage</link> * pgr, <link linkend="_class_bstring">Bstring</link> &amp; avgfile, <link linkend="_utilities_8h_1ad8ed01ff3ff33333d8e19db4d2818bb6">DataType</link> datatype, <link linkend="_class_bstring">Bstring</link> &amp; subset, <link linkend="_class_bstring">Bstring</link> &amp; label)</computeroutput></para><para>

<para>Calculates average micrograph frame images and write them to a file. </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>micrograph project. </para>
</entry>
                            </row>
                            <row>
                                <entry>*pgr</entry>
                                <entry>
<para>gain reference. </para>
</entry>
                            </row>
                            <row>
                                <entry>&amp;avgfile</entry>
                                <entry>
<para>output path. </para>
</entry>
                            </row>
                            <row>
                                <entry>datatype</entry>
                                <entry>
<para>output data type. </para>
</entry>
                            </row>
                            <row>
                                <entry>&amp;subset</entry>
                                <entry>
<para>subset to average (all if empty) </para>
</entry>
                            </row>
                            <row>
                                <entry>&amp;label</entry>
                                <entry>
<para>string to write into image headers. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>double average SNR. </para>
</formalpara>
</para>
<para>
Definition at line 1067 of file mg_align.cpp.</para>
</section>
</section>
<section>
<title>Variable Documentation</title>
<anchor xml:id="_mg__align_8cpp_1a0b2caeb4b6f130be43e5a2f0267dd453"/>    <section>
    <title>verbose</title>
<indexterm><primary>verbose</primary><secondary>mg_align.cpp</secondary></indexterm>
<indexterm><primary>mg_align.cpp</primary><secondary>verbose</secondary></indexterm>
<para><computeroutput>int verbose</computeroutput></para></section>
</section>
</section>
