Bsoft 2.1.4
Bernard's software package
rwPIF.cpp File Reference

Functions for reading and writing PIF files. More...

#include "rwPIF.h"
#include "file_util.h"
#include "utilities.h"

Macros

#define PIF_SCALE   1e-5
 

Functions

char * read_sf (ifstream *fimg, Bimage *p, int mode, int sb)
 
int readPIF (Bimage *p, int readdata, int img_select)
 Reading a PIF image and structure factor file format. A 2D and 3D image format used in electron microscopy. There are two types of files: More...
 
int writePIF (Bimage *p)
 Writing a PIF image file format. A 2D and 3D image format used in electron microscopy. More...
 

Variables

int verbose
 
char * month []
 
double PIFscale = PIF_SCALE
 

Detailed Description

Functions for reading and writing PIF files.

Author
Bernard Heymann
Date
Created: 19991112
Modified: 20120706

Macro Definition Documentation

◆ PIF_SCALE

#define PIF_SCALE   1e-5

Function Documentation

◆ read_sf()

char * read_sf ( ifstream *  fimg,
Bimage p,
int  mode,
int  sb 
)

◆ readPIF()

int readPIF ( Bimage p,
int  readdata,
int  img_select 
)

Reading a PIF image and structure factor file format. A 2D and 3D image format used in electron microscopy. There are two types of files:

  1. A typical binary image format with a file header and a header for each sub-image.
  2. A binary structure factor format with the same file header as for the image format File header size: 512 bytes followed by optional 768 byte colour table Image header size: 512 bytes for each image File format extensions: .pif Identifier: supposed to be the first 8 bytes Byte order determination: Data type and third dimension values must be less than 256*256. Data types: 0 = byte, 1 = short, 2 = float, 3 = complex short, 4 = complex float. Transform type: List of structure factors. Note: To avoid endianness problems associated with different floating point formats (particularly those under VMS), this format was intended to store only integers. A 16 byte string following the 8th byte encodes a floating point conversion scale to convert an integer map and some of the fields in the header back to floating point. However, this format was designed in the CCP4/MRC style format, and the floating point data type was retained, as well as complex types used for transforms.
    Parameters
    *pthe image structure.
    readdataflag to activate reading of image data.
    img_selectimage selection in multi-image file (-1 = all images).
    Returns
    int error code (<0 means failure).

◆ writePIF()

int writePIF ( Bimage p)

Writing a PIF image file format. A 2D and 3D image format used in electron microscopy.

Parameters
*pthe image structure.
Returns
int error code (<0 means failure).

Variable Documentation

◆ month

char* month[]
extern

◆ PIFscale

double PIFscale = PIF_SCALE

◆ verbose

int verbose
extern