Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

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

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

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.

References dt, nx, and ny.

00053 :       filename(file), rw_mode(rw), amira_file(0),
00054         is_big_endian(true), initialized(false), dt(EMUtil::EM_UNKNOWN),
00055          nx(0), ny(0), nz(0),
00056          pixel(0), xorigin(0), yorigin(0), zorigin(0)
00057 {
00058 }

AmiraIO::~AmiraIO  ) 
 

Definition at line 60 of file amiraio.cpp.

References amira_file.

00061 {
00062         if (amira_file) {
00063                 fclose(amira_file);
00064                 amira_file = 0;
00065         }
00066 }


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(), and MAGIC.

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

00105 {
00106         ENTERFUNC;
00107         bool result = false;
00108         if (!first_block) {
00109                 result = false;
00110         }
00111         else {
00112                 result = Util::check_file_by_magic(first_block, MAGIC);
00113         }
00114         EXITFUNC;
00115         return result;
00116 }


Member Data Documentation

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

Definition at line 64 of file amiraio.h.

Referenced by ~AmiraIO().

EMAN::AmiraIO::DEFINE_IMAGEIO_FUNC
 

Definition at line 58 of file amiraio.h.

EMUtil::EMDataType EMAN::AmiraIO::dt [private]
 

Definition at line 68 of file amiraio.h.

string EMAN::AmiraIO::filename [private]
 

Definition at line 62 of file amiraio.h.

bool EMAN::AmiraIO::initialized [private]
 

Definition at line 67 of file amiraio.h.

bool EMAN::AmiraIO::is_big_endian [private]
 

Definition at line 66 of file amiraio.h.

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

Definition at line 50 of file amiraio.cpp.

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.

IOMode EMAN::AmiraIO::rw_mode [private]
 

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:
Generated on Tue Jun 11 13:47:50 2013 for EMAN2 by  doxygen 1.3.9.1