| Bsoft 2.0.0 Bernard's software package

Macros | Functions | Variables
mgconvert.cpp File Reference

Convert between micrograph parameter formats. More...

`#include "mg_processing.h"`
`#include "rwmg.h"`
`#include "rwmgSTAR.h"`
`#include "rwmgXML.h"`
`#include "mg_ctf.h"`
`#include "file_util.h"`
`#include "linked_list.h"`
`#include "utilities.h"`
`#include "options.h"`
`#include "timer.h"`

Go to the source code of this file.

## Macros
#define | DATLINELENGTH 120

## Functions
Bproject * | read_project_conv (Bstring *file_list)
int | write_project_conv (Bstring &filename, Bproject *project, int mg_select, int rec_select)
int | read_project_dat (Bstring &filename, Bproject *project)
| Reading micrograph parameters from a DAT file. More...
int | write_project_dat (Bstring &filename, Bproject *project, int mg_select, int rec_select)
| Writing micrograph parameters to a DAT file. More...
int | read_project_crd (Bstring &filename, Bproject *project)
| Reading micrograph parameters from a CRD file. More...
int | write_project_crd (Bstring &filename, Bproject *project, int mg_select, int rec_select)
| Writing micrograph parameters to a CRD file. More...
int | read_project_relion (Bstring &filename, Bproject *project)
| Reading micrograph parameters from a Relion file. More...
int | write_project_relion (Bstring &filename, Bproject *project, int mg_select, int rec_select)
| Writing micrograph parameters to a Relion file. More...
int | project_modify_parameters (Bproject *project, char flags)
| Modifies some micrograph parameters. More...
int | main (int argc, char **argv)
int | relion_to_project (Bstar *star, Bproject *project)
int | project_to_relion (Bproject *project, Bstar *star, int mg_select, int rec_select)

## Variables
int | verbose
const char * | use []

## Detailed Description

Convert between micrograph parameter formats.

Author
  Bernard Heymann
  David Belnap
  James Conway
  Juha Huiskonen

Date
  Created: 20061101
  Modified: 20141119

      Compile with:
          g++ mgconvert.cpp -o mgconvert -I$BSOFT/include -L$BSOFT/lib -lbsoft -DHAVE_FFTW3
      Compile on Mac OS X 10.7+:
          clang++ mgconvert.cpp -o mgconvert -I$BSOFT/include -L$BSOFT/lib -lbsoft -DHAVE_FFTW3

Definition in file mgconvert.cpp.

## Macro Definition Documentation

## ◆ DATLINELENGTH

#define DATLINELENGTH 120

Definition at line 28 of file mgconvert.cpp.

## Function Documentation

## ◆ main()

int main | ( | int | argc,
|  | char ** | argv
| ) |  |

Definition at line 69 of file mgconvert.cpp.

## ◆ project_modify_parameters()

int project_modify_parameters | ( | Bproject * | project,
|  | char | flags
| ) |  |

Modifies some micrograph parameters.

Parameters

  project | project structure.
  flags | bit 0 = omega 90 flag, bit 1 = mag flag.

Returns
  error code (<0 means failure).

Parameters

  *project | project structure.
  flags | bit 0 = omega 90 flag, bit 1 = mag flag.

Returns
  int error code (<0 means failure).

Definition at line 829 of file mgconvert.cpp.

## ◆ project_to_relion()

int project_to_relion | ( | Bproject * | project,
|  | Bstar * | star,
|  | int | mg_select,
|  | int | rec_select
| ) |  |

Definition at line 759 of file mgconvert.cpp.

## ◆ read_project_conv()

Bproject * read_project_conv | ( | Bstring * | file_list | ) |

Definition at line 146 of file mgconvert.cpp.

## ◆ read_project_crd()

int read_project_crd | ( | Bstring & | filename,
|  | Bproject * | project
| ) |  |

Reading micrograph parameters from a CRD file.

Parameters

  filename | file name (or comma-delimited list).
  project | initialized project structure.

Returns
  error code (<0 means failure).

Parameters

  &filename | file name (or comma-delimited list).
  *project | initialized project structure.

Returns
  int error code (<0 means failure).

Definition at line 471 of file mgconvert.cpp.

## ◆ read_project_dat()

int read_project_dat | ( | Bstring & | filename,
|  | Bproject * | project
| ) |  |

Reading micrograph parameters from a DAT file.

Parameters

  filename | file name (or comma-delimited list).
  project | initialized project structure.

Returns
  error code (<0 means failure).

Parameters

  &filename | file name (or comma-delimited list).
  *project | initialized project structure.

Returns
  int error code (<0 means failure).

Definition at line 279 of file mgconvert.cpp.

## ◆ read_project_relion()

int read_project_relion | ( | Bstring & | filename,
|  | Bproject * | project
| ) |  |

Reading micrograph parameters from a Relion file.

Parameters

  filename | file name (or comma-delimited list).
  project | initialized project structure.

Returns
  error code (<0 means failure).

Parameters

  &filename | file name (or comma-delimited list).
  *project | initialized project structure.

Returns
  int error code (<0 means failure).

Definition at line 775 of file mgconvert.cpp.

## ◆ relion_to_project()

int relion_to_project | ( | Bstar * | star,
|  | Bproject * | project
| ) |  |

Definition at line 644 of file mgconvert.cpp.

## ◆ write_project_conv()

int write_project_conv | ( | Bstring & | filename,
|  | Bproject * | project,
|  | int | mg_select,
|  | int | rec_select
| ) |  |

Definition at line 226 of file mgconvert.cpp.

## ◆ write_project_crd()

int write_project_crd | ( | Bstring & | filename,
|  | Bproject * | project,
|  | int | mg_select,
|  | int | rec_select
| ) |  |

Writing micrograph parameters to a CRD file.

Parameters

  filename | file name.
  project | project structure.
  mg_select | flag to select micrograph.
  rec_select | flag to select reconstruction.

Returns
  error code (<0 means failure).

Parameters

  *filename | file name.
  *project | project structure.
  mg_select | flag to select micrograph.
  rec_select | flag to select reconstruction.

Returns
  int error code (<0 means failure).

Definition at line 571 of file mgconvert.cpp.

## ◆ write_project_dat()

int write_project_dat | ( | Bstring & | filename,
|  | Bproject * | project,
|  | int | mg_select,
|  | int | rec_select
| ) |  |

Writing micrograph parameters to a DAT file.

Parameters

  filename | file name.
  project | project structure.
  mg_select | flag to select micrograph.
  rec_select | flag to select reconstruction.

Returns
  error code (<0 means failure).

Parameters

  *filename | file name.
  *project | project structure.
  mg_select | flag to select micrograph.
  rec_select | flag to select reconstruction.

Returns
  int error code (<0 means failure).

Definition at line 402 of file mgconvert.cpp.

## ◆ write_project_relion()

int write_project_relion | ( | Bstring & | filename,
|  | Bproject * | project,
|  | int | mg_select,
|  | int | rec_select
| ) |  |

Writing micrograph parameters to a Relion file.

Parameters

  filename | file name.
  project | project structure.
  mg_select | flag to select micrograph.
  rec_select | flag to select reconstruction.

Returns
  error code (<0 means failure).

Parameters

  *filename | file name.
  *project | project structure.
  mg_select | flag to select micrograph.
  rec_select | flag to select reconstruction.

Returns
  int error code (<0 means failure).

Definition at line 803 of file mgconvert.cpp.

## Variable Documentation

## ◆ use

const char* use[]

Initial value:
= {
" ",
"Usage: mgconvert [options] input.star [input2.star]",
"---------------------------------------------------",
"Converts micrograph parameter files.",
"DAT and CRD files only hold one micrograph per file:",
" multiple micrographs are written as numbered DAT or CRD files.",
" use -mgselect to select only one micrograph.",
" ",
"Parameters:",
"-verbose 7 Verbosity of output.",
"-sampling 1.5 Sampling (A/pixel).",
"-mgselect 5 Selected micrograph (default all, first micrograph = 1).",
"-recselect 5 Selected reconstruction (default all, first reconstruction = 1).",
"-euler Convert views to Euler angles.",
"-omega Add or subtract 90 degrees to or from the OMEGA angle.",
"-magnification Invert the magnification factor: 1/mag.",
" ",
"Output:",
"-output file.star Output parameter file.",
" ",
NULL
}

Definition at line 45 of file mgconvert.cpp.

## ◆ verbose

int verbose