EMAN2
Public Member Functions | Static Public Member Functions | Public Attributes | Private Types | Private Attributes | Static Private Attributes
EMAN::SalIO Class Reference

A SAL image is an image from Perkin Elmer PDS Microdensitometer. More...

#include <salio.h>

Inheritance diagram for EMAN::SalIO:
Inheritance graph
[legend]
Collaboration diagram for EMAN::SalIO:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SalIO (const string &filename, IOMode rw_mode=READ_ONLY)
 ~SalIO ()

Static Public Member Functions

static bool is_valid (const void *first_block)

Public Attributes

 DEFINE_IMAGEIO_FUNC

Private Types

enum  ScanAxis { X_SCAN_AXIS, Y_SCAN_AXIS }
enum  ScanMode { NON_RASTER_SCAN, RASTER_SCAN }

Private Attributes

string filename
IOMode rw_mode
FILE * sal_file
bool initialized
int nx
int ny
int record_length
ScanMode scan_mode
float pixel

Static Private Attributes

static const char * HDR_EXT = "hdr"
static const char * IMG_EXT = "img"
static const char * MAGIC = " IDENTIFICATION"

Detailed Description

A SAL image is an image from Perkin Elmer PDS Microdensitometer.

A SAL image consists of 2 files: 1 header file "X.hdr" and a data file "X.img". Header file is in ASCII format. Data file is in binary format.

Each pair of hdr/img SAL files contains 1 2D image.

Definition at line 51 of file salio.h.


Member Enumeration Documentation

enum EMAN::SalIO::ScanAxis [private]
Enumerator:
X_SCAN_AXIS 
Y_SCAN_AXIS 

Definition at line 65 of file salio.h.

enum EMAN::SalIO::ScanMode [private]
Enumerator:
NON_RASTER_SCAN 
RASTER_SCAN 

Definition at line 71 of file salio.h.


Constructor & Destructor Documentation

SalIO::SalIO ( const string &  filename,
IOMode  rw_mode = READ_ONLY 
) [explicit]

Definition at line 57 of file salio.cpp.

References NON_RASTER_SCAN, nx, ny, pixel, record_length, and scan_mode.

:       filename(file), rw_mode(rw), sal_file(0), initialized(false)
{
        nx = 0;
        ny = 0;
        record_length = 512;
        scan_mode = NON_RASTER_SCAN;
        pixel = 4.6667f;
}
SalIO::~SalIO ( )

Definition at line 67 of file salio.cpp.

References sal_file.

{
        if (sal_file) {
                fclose(sal_file);
                sal_file = 0;
        }
}

Member Function Documentation

bool SalIO::is_valid ( const void *  first_block) [static]

Definition at line 145 of file salio.cpp.

References EMAN::Util::check_file_by_magic(), ENTERFUNC, EXITFUNC, and MAGIC.

Referenced by EMAN::EMUtil::fast_get_image_type(), and EMAN::EMUtil::get_image_type().

{
        ENTERFUNC;
        bool result = false;

        if (!first_block) {
                result = false;
        }
        result = Util::check_file_by_magic(first_block, MAGIC);
        EXITFUNC;
        return result;
}

Member Data Documentation

Definition at line 57 of file salio.h.

string EMAN::SalIO::filename [private]

Definition at line 78 of file salio.h.

const char * SalIO::HDR_EXT = "hdr" [static, private]

Definition at line 61 of file salio.h.

const char * SalIO::IMG_EXT = "img" [static, private]

Definition at line 62 of file salio.h.

bool EMAN::SalIO::initialized [private]

Definition at line 81 of file salio.h.

const char * SalIO::MAGIC = " IDENTIFICATION" [static, private]

Definition at line 63 of file salio.h.

Referenced by is_valid().

int EMAN::SalIO::nx [private]

Definition at line 82 of file salio.h.

Referenced by SalIO().

int EMAN::SalIO::ny [private]

Definition at line 83 of file salio.h.

Referenced by SalIO().

float EMAN::SalIO::pixel [private]

Definition at line 86 of file salio.h.

Referenced by SalIO().

Definition at line 84 of file salio.h.

Referenced by SalIO().

Definition at line 79 of file salio.h.

FILE* EMAN::SalIO::sal_file [private]

Definition at line 80 of file salio.h.

Referenced by ~SalIO().

Definition at line 85 of file salio.h.

Referenced by SalIO().


The documentation for this class was generated from the following files: