Bsoft  2.1.0
Bernard's software package
rwmg.h File Reference

Header file for reading and writing micrograph parameters. More...

#include "mg_processing.h"
#include "mg_select.h"

Go to the source code of this file.

Macros

#define _RWMG_
 

Functions

Bproject * read_project (const char *filename, int flags=0)
 Reading micrograph parameters from files. More...
 
Bproject * read_project (Bstring &filename, int flags=0)
 
Bproject * read_project (Bstring &filename, Bstring &xsdfile, int flags=0)
 
Bproject * read_project (Bstring *file_list, int flags=0)
 
Bproject * read_project (Bstring *file_list, Bstring &xsdfile, int flags=0)
 
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=0)
 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 &id, int part_id)
 
int ppx_exists (Bparticle *part, int flag)
 
int ppx_check (Bparticle *part, FOMType fom_tag[NFOM])
 
int ppx_check (Bparticle *part)
 
Bparticle * project_find_particle (Bproject *project, Bstring &fn)
 Finds a particle associated with a file name. More...
 
long project_update_from_ppx (Bproject *project)
 Updates a project with ppx files. More...
 
long project_list_ppx (Bproject *project, int flag)
 Lists existing ppx files for 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...
 

Detailed Description

Header file for reading and writing micrograph parameters.

Author
Bernard Heymann
Date
Created: 20000426
Modified: 20200521

Definition in file rwmg.h.

Macro Definition Documentation

◆ _RWMG_

#define _RWMG_

Definition at line 35 of file rwmg.h.

Function Documentation

◆ append_project()

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

Definition at line 283 of file rwmg.cpp.

◆ ppx_check() [1/2]

int ppx_check ( Bparticle *  part)

Definition at line 466 of file rwmg.cpp.

◆ ppx_check() [2/2]

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

Definition at line 441 of file rwmg.cpp.

◆ ppx_exists()

int ppx_exists ( Bparticle *  part,
int  flag 
)

Definition at line 421 of file rwmg.cpp.

◆ ppx_filename()

Bstring ppx_filename ( Bstring &  id,
int  part_id 
)

Definition at line 415 of file rwmg.cpp.

◆ project_find_particle()

Bparticle* project_find_particle ( Bproject *  project,
Bstring &  fn 
)

Finds a particle associated with a file name.

Parameters
*projectmicrograph processing parameter structure.
fnfilename to search for.
Returns
Bparticle* particle structure if found, otherwise NULL.
The file name to search for is altered to represent an accurate path.

Definition at line 610 of file rwmg.cpp.

◆ project_list_ppx()

long project_list_ppx ( Bproject *  project,
int  flag 
)

Lists existing ppx files for a project.

Parameters
*projectproject parameter structure.
flagselect: 0 = all, 1 = existing, 2 = absent.
Returns
long number of particles updated.

Definition at line 696 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
*projectthe 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 810 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
&filenamebase filename modified to include the particle selection number.
*projectthe 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 742 of file rwmg.cpp.

◆ project_update_from_ppx()

long project_update_from_ppx ( Bproject *  project)

Updates a project with ppx files.

Parameters
*projectproject parameter structure.
Returns
long number of particles updated.

Definition at line 655 of file rwmg.cpp.

◆ read_particle()

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

Definition at line 305 of file rwmg.cpp.

◆ read_project() [1/5]

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

Definition at line 153 of file rwmg.cpp.

◆ read_project() [2/5]

Bproject* read_project ( Bstring &  filename,
int  flags = 0 
)

Definition at line 147 of file rwmg.cpp.

◆ read_project() [3/5]

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

Definition at line 209 of file rwmg.cpp.

◆ read_project() [4/5]

Bproject* read_project ( Bstring *  file_list,
int  flags = 0 
)

Definition at line 203 of file rwmg.cpp.

◆ read_project() [5/5]

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

Reading micrograph parameters from files.

Parameters
&filenamefile name (or comma-delimited list).
flagsflags 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 141 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 406 of file rwmg.cpp.

◆ write_project() [1/3]

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

Writing micrograph parameters to a file.

Parameters
*filenamefile name (or comma-delimited list).
*projectproject structure.
flagsflags 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 359 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
*filenamefile name (or comma-delimited list).
*projectproject structure.
mg_selectflag to only write selected micrographs.
rec_selectflag to only write selected reconstructions.
Returns
int error code (<0 means failure).

Definition at line 336 of file rwmg.cpp.

◆ write_project() [3/3]

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

Writing micrograph parameters to a file.

Parameters
*filenamefile name (or comma-delimited list).
*projectproject structure.
Returns
int error code (<0 means failure).

Definition at line 321 of file rwmg.cpp.