Bsoft 2.1.4
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"

Macros

#define _RWMG_
 

Functions

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=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...
 
long write_particle_list (Bstring &filename, Bproject *project, int flags=0)
 Writing particle coordinates 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: 20220311

Macro Definition Documentation

◆ _RWMG_

#define _RWMG_

Function Documentation

◆ append_project()

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

◆ field_resolve_file_access()

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

◆ ppx_check() [1/2]

int ppx_check ( Bparticle *  part)

◆ ppx_check() [2/2]

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

◆ ppx_exists()

int ppx_exists ( Bparticle *  part,
int  flag 
)

◆ ppx_filename()

Bstring ppx_filename ( Bstring &  id,
int  part_id 
)

◆ 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.

◆ 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.

◆ project_resolve_file_access()

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

◆ 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.

◆ 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.

◆ 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.

◆ read_particle()

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

◆ read_project() [1/5]

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

◆ read_project() [2/5]

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

◆ read_project() [3/5]

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

◆ read_project() [4/5]

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

◆ 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.
32  update micrograph intensities.
64  update STAR tags.

◆ reconstruction_resolve_file_access()

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

◆ write_particle()

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

◆ write_particle_list()

long write_particle_list ( Bstring &  filename,
Bproject *  project,
int  flags 
)

Writing particle coordinates to a file.

Parameters
&filenamefile name (or comma-delimited list).
*projectproject structure.
flagsbits: 1=in angstrom
Returns
int error code (<0 means failure).

◆ 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.
32. update micrograph intensities.

◆ 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).

◆ 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).