| Bsoft 2.0.5 Bernard's software package

Functions
mg_tomo_track.h File Reference

Functions to track fiducial markers in a tomographic series of images. More...

`#include "mg_processing.h"`
`#include "rwmg.h"`
`#include "rwimg.h"`

Go to the source code of this file.

## Functions
double | project_find_tilt_axis (Bproject *project, double tilt, double axis_start, double axis_end, double axis_step, double hi_res, double lo_res, double shift_limit)
| Finds the tilt axis for a tomographic tilt series. More...
int | project_track_markers (Bproject *project, double hi_res, double lo_res, double shift_limit, double thickness, int max_cycle, double target, int cc_type, int recenter, Bstring paramfile)
| Aligns markers in a tomographic series. More...
int | project_track_markers_dual (Bproject *project, double hi_res, double lo_res, double shift_limit, double thickness, int max_cycle, double target, int cc_type, int recenter, Bstring paramfile)
| Aligns markers in a tomographic series. More...
int | project_refine_markers (Bproject *project, double hi_res, double lo_res)
| Refines marker positions in a tomographic series. More...
int | project_refine_one_marker (Bproject *project, int id, double hi_res, double lo_res)
| Refines marker positions in a tomographic series. More...
int | mg_refine_markers (Bmicrograph *mg, Bimage *pgold, double hi_res, double lo_res)
| Refines marker positions in a tomographic micrograph. More...
double | project_refine (Bproject *project, int iter, double tol, Bstring refop)
| Refines all the alignment parameters. More...
double | project_refine_z (Bproject *project)
| Refines the z coordinates of the marker model. More...
double | project_refine (Bproject *project, int do_view, int do_origin, int do_scale)
| Refines the views from the marker positions and marker model. More...
double | mg_marker_shift (Bmicrograph *mg, Bimage *pgold, double hi_res, double lo_res, double shift_limit)
double | mg_marker_shift (Bmicrograph *mg, Bimage *pgold, double hi_res, double lo_res, double shift_limit, fft_plan planf, fft_plan planb)
| Finds the shift of a micrograph wrt the reference using markers. More...
int | project_transfer_seed (Bproject *project, double rot_start, double rot_end, double rot_step, double hi_res, double lo_res, double shift_limit)
| Transfers the seed markers from the first to the second project. More...
int | project_transform_dual (Bproject *project)
| Calculates the transformation of the second tilt series to fit the first. More...
double | project_dual_zcompare (Bproject *project)
| Lists two sets of Z coordinates for comparison. More...

## Detailed Description

Functions to track fiducial markers in a tomographic series of images.

Author
  Bernard Heymann

Date
  Created: 20020416
  Modified: 20160108

Definition in file mg_tomo_track.h.

## Function Documentation

## ◆ mg_marker_shift() [1/2]

double mg_marker_shift | ( | Bmicrograph * | mg,
|  | Bimage * | pgold,
|  | double | hi_res,
|  | double | lo_res,
|  | double | shift_limit
| ) |  |

## ◆ mg_marker_shift() [2/2]

double mg_marker_shift | ( | Bmicrograph * | mg,
|  | Bimage * | pgold,
|  | double | hi_res,
|  | double | lo_res,
|  | double | shift_limit,
|  | fft_plan | planf,
|  | fft_plan | planb
| ) |  |

Finds the shift of a micrograph wrt the reference using markers.

Parameters

  *mg | micrograph.
  *pgold | marker reference image (can be NULL).
  hi_res | high resolution limit for cross-correlation.
  lo_res | low resolution limit for cross-correlation.
  shift_limit | maximum micrograph shift to search for.
  planf | FFT forward plan.
  planb | FFT backward plan.

Returns
  double correlation coefficient.

      The marker locations and marker radius must already be set.
      The correlation coefficient for the correlation between the micrograph
      and the 2D image generated from the markers is retuned.

Definition at line 1112 of file mg_tomo_track.cpp.

## ◆ mg_refine_markers()

int mg_refine_markers | ( | Bmicrograph * | mg,
|  | Bimage * | pgold,
|  | double | hi_res,
|  | double | lo_res
| ) |  |

Refines marker positions in a tomographic micrograph.

Parameters

  *mg | micrograph.
  *pgold | marker reference image (can be NULL).
  hi_res | high resolution limit for cross-correlation.
  lo_res | low resolution limit for cross-correlation.

Returns
  int 0.

      The area around a marker is extracted and cross-correlated with the
      corresponding projection from the 3D marker model.

Definition at line 831 of file mg_tomo_track.cpp.

## ◆ project_dual_zcompare()

double project_dual_zcompare | ( | Bproject * | project | ) |

Lists two sets of Z coordinates for comparison.

Author
  Jessica Mavadia, Bernard Heymann

Parameters

  *project | project with two tilt series.

Returns
  double root-mean-square-difference.

      The root-mean-square-difference between the z coordinates is calculated.

Definition at line 1641 of file mg_tomo_track.cpp.

## ◆ project_find_tilt_axis()

double project_find_tilt_axis | ( | Bproject * | project,
|  | double | tilt,
|  | double | axis_start,
|  | double | axis_end,
|  | double | axis_step,
|  | double | hi_res,
|  | double | lo_res,
|  | double | shift_limit
| ) |  |

Finds the tilt axis for a tomographic tilt series.

Parameters

  *project | project parameter structure.
  tilt | user-chosen tilt angle to use (radians).
  axis_start | starting tilt axis angle.
  axis_end | ending tilt axis angle.
  axis_step | tilt axis angle step size (radians).
  hi_res | high resolution limit for cross-correlation.
  lo_res | low resolution limit for cross-correlation.
  shift_limit | maximum micrograph shift to search for.

Returns
  double best correlation coefficient.

      The zero-tilt reference marker set must be defined.
      The micrographs closest to the positive and negative values of the
      given tilt angle is selected to find the tilt axis.
      The tilt axis for each of these micrographs is incremented from
      -PI to PI, markers generated from the reference seed, and
      cross-correlated with the micrograph image.
      The tilt axis angle giving the best cross-correlation is chosen
      and assigned to all the micrographs.
      The markers for the chosen tilted micrographs are deleted.

Definition at line 153 of file mg_tomo_track.cpp.

## ◆ project_refine() [1/2]

double project_refine | ( | Bproject * | project,
|  | int | iter,
|  | double | tol,
|  | Bstring | refop
| ) |  |

Refines all the alignment parameters.

Parameters

  *project | micrograph project.
  iter | maximum number of iterations.
  tol | tolerance for exit condition.
  refop | string holding sequence of refinement operations.

Returns
  double marker RMSD.

Definition at line 868 of file mg_tomo_track.cpp.

## ◆ project_refine() [2/2]

double project_refine | ( | Bproject * | project,
|  | int | do_view,
|  | int | do_origin,
|  | int | do_scale
| ) |  |

Refines the views from the marker positions and marker model.

Parameters

  *project | micrograph project.
  do_view | refine micrograph views.
  do_origin | refine micrograph origins.
  do_scale | refine micrograph scales.

Returns
  double best residual.

      Requires the matrices in the micrograph structures to be defined.

Definition at line 1005 of file mg_tomo_track.cpp.

## ◆ project_refine_markers()

int project_refine_markers | ( | Bproject * | project,
|  | double | hi_res,
|  | double | lo_res
| ) |  |

Refines marker positions in a tomographic series.

Parameters

  *project | project parameter structure.
  hi_res | high resolution limit for cross-correlation.
  lo_res | low resolution limit for cross-correlation.

Returns
  int 0, <0 on error.

      The area around a marker is extracted and cross-correlated with the
      corresponding projection from the 3D marker model.

Definition at line 683 of file mg_tomo_track.cpp.

## ◆ project_refine_one_marker()

int project_refine_one_marker | ( | Bproject * | project,
|  | int | id,
|  | double | hi_res,
|  | double | lo_res
| ) |  |

Refines marker positions in a tomographic series.

Parameters

  *project | project parameter structure.
  id | marker identifier.
  hi_res | high resolution limit for cross-correlation.
  lo_res | low resolution limit for cross-correlation.

Returns
  int 0, <0 on error.

      The area around a marker is extracted and cross-correlated with the
      corresponding projection from the 3D marker model.

Definition at line 768 of file mg_tomo_track.cpp.

## ◆ project_refine_z()

double project_refine_z | ( | Bproject * | project | ) |

Refines the z coordinates of the marker model.

Parameters

  *project | micrograph project.

Returns
  double overall RMS change.

Definition at line 948 of file mg_tomo_track.cpp.

## ◆ project_track_markers()

int project_track_markers | ( | Bproject * | project,
|  | double | hi_res,
|  | double | lo_res,
|  | double | shift_limit,
|  | double | thickness,
|  | int | max_cycle,
|  | double | target,
|  | int | cc_type,
|  | int | recenter,
|  | Bstring | paramfile
| ) |  |

Aligns markers in a tomographic series.

Parameters

  *project | project parameter structure.
  hi_res | high resolution limit for cross-correlation.
  lo_res | low resolution limit for cross-correlation.
  shift_limit | maximum micrograph shift to search for.
  thickness | estimated tomogram thickness (angstrom).
  max_cycle | maximum number of iterations.
  target | target residual to terminate tracking.
  cc_type | indicates type of marker correlation: 0=real space, 1=cross correlation
  recenter | flag to recenter z coordinates.
  paramfile | output parameter file name.

Returns
  int 0, <0 on error.

      From the fiducial marker seed in the zero-degree tilt image, the
      z coordinates of the markers as well as the image shift for
      each micrograph is determined. The algorithm first attempts to
      find the z-coordinate for each marker in an image by doing
      real space correlations along a line determined by the tilt direction.
      It then generates a projection image from the whole marker set at
      the nominal tilt angle and cross-correlates it with the image to
      find the shift. The process proceeds from the low-angle tilts to
      higher tilts in both directions, using the lower dependence of the
      low-tilt images on correct marker z-coordinates. This process is
      iterated (typically 2-5 times) until the change in z-coordinates drops
      below one pixel on average or up to the maximum number of iterations.
      The resolution limits are used in the cross-correlations.
      The shift limit prevents setting micrograph origin to far from the nominal origin.
      The thickness determines the extent of searching for the z coordinate of a marker.

Definition at line 313 of file mg_tomo_track.cpp.

## ◆ project_track_markers_dual()

int project_track_markers_dual | ( | Bproject * | project,
|  | double | hi_res,
|  | double | lo_res,
|  | double | shift_limit,
|  | double | thickness,
|  | int | max_cycle,
|  | double | target,
|  | int | cc_type,
|  | int | recenter,
|  | Bstring | paramfile
| ) |  |

Aligns markers in a tomographic series.

Parameters

  *project | project parameter structure.
  hi_res | high resolution limit for cross-correlation.
  lo_res | low resolution limit for cross-correlation.
  shift_limit | maximum micrograph shift to search for.
  thickness | estimated tomogram thickness (angstrom).
  max_cycle | maximum number of iterations.
  target | target residual to terminate tracking.
  cc_type | indicates type of marker correlation: 0=real space, 1=cross correlation
  recenter | flag to recenter z coordinates.
  paramfile | output parameter file name.

Returns
  int 0, <0 on error.

      From the fiducial marker seed in the zero-degree tilt image, the
      z coordinates of the markers as well as the image shift for
      each micrograph is determined. The algorithm first attempts to
      find the z-coordinate for each marker in an image by doing
      real space correlations along a line determined by the tilt direction.
      It then generates a projection image from the whole marker set at
      the nominal tilt angle and cross-correlates it with the image to
      find the shift. The process proceeds from the low-angle tilts to
      higher tilts in both directions, using the lower dependence of the
      low-tilt images on correct marker z-coordinates. This process is
      iterated (typically 2-5 times) until the change in z-coordinates drops
      below one pixel on average or up to the maximum number of iterations.
      The resolution limits are used in the cross-correlations.
      The shift limit prevents setting micrograph origin to far from the nominal origin.
      The thickness determines the extent of searching for the z coordinate of a marker.

Definition at line 489 of file mg_tomo_track.cpp.

## ◆ project_transfer_seed()

int project_transfer_seed | ( | Bproject * | project,
|  | double | rot_start,
|  | double | rot_end,
|  | double | rot_step,
|  | double | hi_res,
|  | double | lo_res,
|  | double | shift_limit
| ) |  |

Transfers the seed markers from the first to the second project.

Parameters

  *project | project with seed markers in first field.
  rot_start | starting rotation angle.
  rot_end | final rotation angle.
  rot_step | angular search step size.
  hi_res | high resolution limit for cross-correlation.
  lo_res | low resolution limit for cross-correlation.
  shift_limit | maximum micrograph shift to search for.

Returns
  int number of markers.

      The markers from the first series are rotated around the micrograph
      origin by the search angle. The markers are then used to generate
      an image with synthetic markers, and this image is cross-correlated
      with the zero-tilt micrograph of the second series. The search angle
      giving the best correlation coefficient is selected and the seed marker
      locations for the second series are calculated.

Definition at line 1418 of file mg_tomo_track.cpp.

## ◆ project_transform_dual()

int project_transform_dual | ( | Bproject * | project | ) |

Calculates the transformation of the second tilt series to fit the first.

Parameters

  *project | project with seed markers.

Returns
  int number of markers compared.

      The 3D marker coordinates from the second series are fitted to those
      of the first series to determine the rotation matrix and shifts.
      The 3D marker locations and the micrograph orientations and origins
      of the second series are then adkjusted to correspond to the first.
      Restrictions: The first two fields should contain the two tilt series
      and the first two reconstructions the corresponding 3D marker sets.

Definition at line 1541 of file mg_tomo_track.cpp.