| Bsoft 2.0.5 Bernard's software package

Functions | Variables
rwmg.cpp File Reference

Library routines to read and write micrograph parameters. More...

`#include "rwmg.h"`
`#include "mg_processing.h"`
`#include "mg_img_proc.h"`
`#include "mg_ctf.h"`
`#include "mg_tags.h"`
`#include "rwmgSTAR.h"`
`#include "rwmgXML.h"`
`#include "rwmgEMX.h"`
`#include "rwmgIMOD.h"`
`#include "rwmgSerialEM.h"`
`#include "file_util.h"`
`#include "utilities.h"`

Go to the source code of this file.

## Functions
int | project_check (Bproject *project, int flags=0)
int | project_display_counts (Bproject *project)
int | field_resolve_file_access (Bfield *field, Bmicrograph *mg, Bstring filename, int flags)
int | reconstruction_resolve_file_access (Breconstruction *rec, Bstring filename, int flags)
int | project_resolve_file_access (Bproject *project, Bstring filename, int flags)
Bproject * | read_project (const char *filename, int flags)
| Reading micrograph parameters from files. More...
Bproject * | read_project (Bstring &filename, int flags)
Bproject * | read_project (Bstring &filename, Bstring &xsdfile, int flags)
Bproject * | read_project (Bstring *file_list, int flags)
Bproject * | read_project (Bstring *file_list, Bstring &xsdfile, int flags)
long | append_project (Bproject *project, Bstring *file_list, Bstring &xsdfile, int flags)
Bparticle * | read_particle (Bstring &filename, Bparticle **partlist, FOMType fom_tag[NFOM])
int | write_project (const char *filename, Bproject *project)
| Writing micrograph parameters to a file. More...
int | write_project (Bstring &filename, Bproject *project, int mg_select, int rec_select)
| Writing micrograph parameters to a file. More...
int | write_project (Bstring &filename, Bproject *project, int flags)
| Writing micrograph parameters to a file. More...
int | write_particle (Bstring &filename, Bparticle *part, int euler_flag, int omega_flag, FOMType fom_tag[NFOM])
Bstring | ppx_filename (Bstring &mg_id, int part_id)
int | ppx_check (Bparticle *part, FOMType fom_tag[NFOM])
int | ppx_check (Bparticle *part)
int | project_update_comment (Bproject *project, int n, char **strings)
| Puts a set of strings and time in the main comment of a project. More...
int | project_split_write (Bstring &filename, Bproject *project)
| Splits a project into sets of particle selections and write the files. More...
int | project_split_field_write (Bproject *project)
| Splits a project into sets of particle selections and write the files. More...

## Variables
int | verbose

## Detailed Description

Library routines to read and write micrograph parameters.

Author
  Bernard Heymann

Date
  Created: 20030418
  Modified: 20190911

Definition in file rwmg.cpp.

## Function Documentation

## ◆ append_project()

long append_project | ( | Bproject * | project,
|  | Bstring * | file_list,
|  | Bstring & | xsdfile,
|  | int | flags
| ) |  |

Definition at line 282 of file rwmg.cpp.

## ◆ field_resolve_file_access()

int field_resolve_file_access | ( | Bfield * | field,
|  | Bmicrograph * | mg,
|  | Bstring | filename,
|  | int | flags
| ) |  |

Definition at line 61 of file rwmg.cpp.

## ◆ ppx_check() [1/2]

int ppx_check | ( | Bparticle * | part,
|  | FOMType | fom_tag[NFOM]
| ) |  |

Definition at line 418 of file rwmg.cpp.

## ◆ ppx_check() [2/2]

int ppx_check | ( | Bparticle * | part | ) |

Definition at line 450 of file rwmg.cpp.

## ◆ ppx_filename()

Bstring ppx_filename | ( | Bstring & | mg_id,
|  | int | part_id
| ) |  |

Definition at line 412 of file rwmg.cpp.

## ◆ project_check()

int project_check | ( | Bproject * | project,
|  | int | flags = `0`
| ) |  |

Definition at line 488 of file rwmg.cpp.

## ◆ project_display_counts()

int project_display_counts | ( | Bproject * | project | ) |

Definition at line 28 of file rwmg.cpp.

## ◆ project_resolve_file_access()

int project_resolve_file_access | ( | Bproject * | project,
|  | Bstring | filename,
|  | int | flags
| ) |  |

Definition at line 117 of file rwmg.cpp.

## ◆ project_split_field_write()

int project_split_field_write | ( | Bproject * | project | ) |

Splits a project into sets of particle selections and write the files.

Parameters

  *project | the project.

Returns
  int number of field files generated.

      The relevant micrographs are selected for each particle selection number
      and written into a file.

Definition at line 678 of file rwmg.cpp.

## ◆ project_split_write()

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

Splits a project into sets of particle selections and write the files.

Parameters

  &filename | base filename modified to include the particle selection number.
  *project | the project.

Returns
  int number of sets generated.

      The relevant micrographs are selected for each particle selection number
      and written into a file.

Definition at line 610 of file rwmg.cpp.

## ◆ project_update_comment()

int project_update_comment | ( | Bproject * | project,
|  | int | n,
|  | char ** | strings
| ) |  |

Puts a set of strings and time in the main comment of a project.

Parameters

  *project | the project.
  n | the number of strings.
  **strings | an array of strings.

Returns
  int string length of the new comment.

      This is designed to pack the command line into a string followed by
      a second string for the time.

Definition at line 468 of file rwmg.cpp.

## ◆ read_particle()

Bparticle* read_particle | ( | Bstring & | filename,
|  | Bparticle ** | partlist,
|  | FOMType | fom_tag[NFOM]
| ) |  |

Definition at line 304 of file rwmg.cpp.

## ◆ read_project() [1/5]

Bproject* read_project | ( | const char * | filename,
|  | int | flags
| ) |  |

Reading micrograph parameters from files.

Parameters

  &filename | file name (or comma-delimited list).
  flags | flags to modify behavior.

Returns
  Bproject* project structure, NULL if reading failed.

      Flags (bits):
      1.  check particle images against images.
      8.  warn if files not found.
      16. delete file names of files not found.

Definition at line 140 of file rwmg.cpp.

## ◆ read_project() [2/5]

Bproject* read_project | ( | Bstring & | filename,
|  | int | flags
| ) |  |

Definition at line 146 of file rwmg.cpp.

## ◆ read_project() [3/5]

Bproject* read_project | ( | Bstring & | filename,
|  | Bstring & | xsdfile,
|  | int | flags
| ) |  |

Definition at line 152 of file rwmg.cpp.

## ◆ read_project() [4/5]

Bproject* read_project | ( | Bstring * | file_list,
|  | int | flags
| ) |  |

Definition at line 202 of file rwmg.cpp.

## ◆ read_project() [5/5]

Bproject* read_project | ( | Bstring * | file_list,
|  | Bstring & | xsdfile,
|  | int | flags
| ) |  |

Definition at line 208 of file rwmg.cpp.

## ◆ reconstruction_resolve_file_access()

int reconstruction_resolve_file_access | ( | Breconstruction * | rec,
|  | Bstring | filename,
|  | int | flags
| ) |  |

Definition at line 92 of file rwmg.cpp.

## ◆ write_particle()

int write_particle | ( | Bstring & | filename,
|  | Bparticle * | part,
|  | int | euler_flag,
|  | int | omega_flag,
|  | FOMType | fom_tag[NFOM]
| ) |  |

Definition at line 403 of file rwmg.cpp.

## ◆ write_project() [1/3]

int write_project | ( | const char * | filename,
|  | Bproject * | project
| ) |  |

Writing micrograph parameters to a file.

Parameters

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

Returns
  int error code (<0 means failure).

Definition at line 320 of file rwmg.cpp.

## ◆ write_project() [2/3]

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

Writing micrograph parameters to a file.

Parameters

  *filename | file name (or comma-delimited list).
  *project | project structure.
  mg_select | flag to only write selected micrographs.
  rec_select | flag to only write selected reconstructions.

Returns
  int error code (<0 means failure).

Definition at line 335 of file rwmg.cpp.

## ◆ write_project() [3/3]

int write_project | ( | Bstring & | filename,
|  | Bproject * | project,
|  | int | flags
| ) |  |

Writing micrograph parameters to a file.

Parameters

  *filename | file name (or comma-delimited list).
  *project | project structure.
  flags | flags to modify behavior.

Returns
  int error code (<0 means failure).

      Flags (bits):
      1.  check particle images.
      2.  write only selected micrographs.
      4.  write only selected reconstructions.
      8.  warn if files not found.
      16. delete file names of files not found.

Definition at line 358 of file rwmg.cpp.

## Variable Documentation

## ◆ verbose

int verbose