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

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

#include "rwGRD.h"
#include "file_util.h"
#include "timer.h"
#include "utilities.h"

Functions

int grid_decompress (Bimage *p, long len, unsigned char *buf)
 
unsigned char * grid_compress (Bimage *p, long &compress)
 
int readGRD (Bimage *p, int readdata, int img_select)
 Reading a Basel GRD map image file format. More...
 
int writeGRD (Bimage *p, int flags)
 Writing a Basel GRD map image file format. More...
 

Variables

int verbose
 

Detailed Description

Functions for reading and writing GRD files.

Author
Bernard Heymann
Date
Created: 19990410
Modified: 20221103

Function Documentation

◆ grid_compress()

unsigned char * grid_compress ( Bimage p,
long &  compress 
)

◆ grid_decompress()

int grid_decompress ( Bimage p,
long  len,
unsigned char *  buf 
)

◆ readGRD()

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

Reading a Basel GRD map image file format.

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). A 3D image format used in electron microscopy. Header size: 512 bytes (fixed). File format extensions: .grd The identifier is a 4-byte magic number (not used). Machine identifier: 1 = little endian, 2 = big endian. Byte order determination: Data type and third dimension values must be less than 256*256. Old data types: 1 = byte, 2 = float, 3 = complex float 4 = 3-value vector (float), 5 = view (float) 6 = RGB byte, 7 = RGB float 8 = RGBA byte, 9 = RGBA float 10 = multi The Bsoft data type and compound type are combined to give the mode: mode = 100*compound_type + data_type

◆ writeGRD()

int writeGRD ( Bimage p,
int  flags 
)

Writing a Basel GRD map image file format.

Parameters
*pthe image structure.
flagsflags to set output properties.
Returns
int error code (<0 means failure). A 3D image format used in electron microscopy. flags: 0 no compression 1 rul-length compression (only byte data types)

Variable Documentation

◆ verbose

int verbose
extern