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

Amira file = ASCII header + binary data. More...

#include <amiraio.h>

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

List of all members.

Public Member Functions

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

Static Public Member Functions

static bool is_valid (const void *first_block)

Public Attributes

 DEFINE_IMAGEIO_FUNC

Private Attributes

string filename
IOMode rw_mode
FILE * amira_file
bool is_big_endian
bool initialized
EMUtil::EMDataType dt
int nx
int ny
int nz
float pixel
float xorigin
float yorigin
float zorigin

Static Private Attributes

static const char * MAGIC = "# AmiraMesh"

Detailed Description

Amira file = ASCII header + binary data.

Its first line has some magic name to label it as an Amira image. The first few lines of the file is the ASCII header. Followed the header is the data in binary format. The data has nx x ny x nz pixels.

An Amira file has only 1 2D or 3D image.

Definition at line 52 of file amiraio.h.


Constructor & Destructor Documentation

AmiraIO::AmiraIO ( const string &  filename,
IOMode  rw_mode = READ_ONLY 
)

Definition at line 52 of file amiraio.cpp.

:       filename(file), rw_mode(rw), amira_file(0),
        is_big_endian(true), initialized(false), dt(EMUtil::EM_UNKNOWN),
         nx(0), ny(0), nz(0),
         pixel(0), xorigin(0), yorigin(0), zorigin(0)
{
}
AmiraIO::~AmiraIO ( )

Definition at line 60 of file amiraio.cpp.

References amira_file.

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

Member Function Documentation

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

Definition at line 104 of file amiraio.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;
        }
        else {
                result = Util::check_file_by_magic(first_block, MAGIC);
        }
        EXITFUNC;
        return result;
}

Member Data Documentation

FILE* EMAN::AmiraIO::amira_file [private]

Definition at line 64 of file amiraio.h.

Referenced by ~AmiraIO().

Definition at line 58 of file amiraio.h.

Definition at line 68 of file amiraio.h.

string EMAN::AmiraIO::filename [private]

Definition at line 62 of file amiraio.h.

Definition at line 67 of file amiraio.h.

Definition at line 66 of file amiraio.h.

const char * AmiraIO::MAGIC = "# AmiraMesh" [static, private]

Definition at line 75 of file amiraio.h.

Referenced by is_valid().

int EMAN::AmiraIO::nx [private]

Definition at line 69 of file amiraio.h.

int EMAN::AmiraIO::ny [private]

Definition at line 70 of file amiraio.h.

int EMAN::AmiraIO::nz [private]

Definition at line 71 of file amiraio.h.

float EMAN::AmiraIO::pixel [private]

Definition at line 72 of file amiraio.h.

Definition at line 63 of file amiraio.h.

float EMAN::AmiraIO::xorigin [private]

Definition at line 73 of file amiraio.h.

float EMAN::AmiraIO::yorigin [private]

Definition at line 73 of file amiraio.h.

float EMAN::AmiraIO::zorigin [private]

Definition at line 73 of file amiraio.h.


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