Bsoft 2.1.4
Bernard's software package
rwmgIMOD.h File Reference

Converts between IMOD files and a micrograph parameter file. More...

#include "mg_processing.h"

Classes

struct  IMOD
 
struct  OBJT
 
struct  CONT
 

Macros

#define IMODSIZE   232
 
#define OBJTSIZE   176
 
#define CONTSIZE   16
 

Functions

int read_imod_tlt (Bstring &filename, Bproject *project)
 
int read_project_imod (Bstring *file_list, Bproject *project, int flag)
 Creates a project structure using IMOD parameters. More...
 
int write_project_imod (Bstring &imodfile, Bproject *project)
 Creates IMOD parameter files from a project structure. More...
 

Detailed Description

Converts between IMOD files and a micrograph parameter file.

Author
Bernard Heymann
Date
Created: 20070501
Modified: 20170120

Macro Definition Documentation

◆ CONTSIZE

#define CONTSIZE   16

◆ IMODSIZE

#define IMODSIZE   232

◆ OBJTSIZE

#define OBJTSIZE   176

Function Documentation

◆ read_imod_tlt()

int read_imod_tlt ( Bstring filename,
Bproject project 
)

◆ read_project_imod()

int read_project_imod ( Bstring file_list,
Bproject project,
int  flag 
)

Creates a project structure using IMOD parameters.

Parameters
*file_listlist of IMOD parameter file names.
*projectinitialized project structure.
flagflag to indicate conversion of the image file.
Returns
int error code (<0 means failure).
Requirements:
    Tilt series micrograph image (if 3D then converted to multi-2D)
    2D transform file (.xf)
    Tilt angle file (.tlt)
Calculations:
    Tilt angle: from tilt angle file
    Tilt axis: ta = (atan2(-A11, A12) + atan2(-A22, -A21))/2
    Mg origin: o = on - Ad
where
    A:  2x2 transformation matrix
    ta: tilt axis angle
    on: nominal micrograph origin (center of mg)
    o:  aligned micrograph origin
    d:  shift for micrograph

◆ write_project_imod()

int write_project_imod ( Bstring imodfile,
Bproject project 
)

Creates IMOD parameter files from a project structure.

Parameters
imodfileIMOD parameter file name.
projectproject structure.
Returns
int 0.
Writes both .xf, .tlt and .xyz files.
Calculations:
    Tilt angle: from micrograph tilt angle
    Matrix: A = {cos(ta), -sin(ta), sin(ta), cos(ta)}
    Shift:  d = o - on
where
    A:  2x2 transformation matrix
    ta: tilt axis angle
    on: nominal micrograph origin (center of mg)
    o:  aligned micrograph origin
    d:  shift for micrograph