#include <dm3io.h>
Inheritance diagram for EMAN::DM3IO:
Public Member Functions | |
DM3IO (const string &filename, IOMode rw_mode=READ_ONLY) | |
~DM3IO () | |
Static Public Member Functions | |
bool | is_valid (const void *first_block) |
Public Attributes | |
DEFINE_IMAGEIO_FUNC | |
Private Types | |
enum | { NUM_ID_INT = 3 } |
Private Attributes | |
string | filename |
IOMode | rw_mode |
FILE * | dm3file |
bool | is_big_endian |
bool | initialized |
Gatan::TagTable * | tagtable |
Everything in the image is a <key, value> pair, where key may be a container-type key which contains more key/value pairs. To read its header information, the whole file has to be parsed. During parsing, we check the keys that we are interested in and get their values.
The real binary data itself is also in this key/value hierarchy.
1 Gatan DM3 file contains 1 2D image.
Definition at line 246 of file dm3io.h.
|
Definition at line 256 of file dm3io.h. 00257 { NUM_ID_INT = 3 };
|
|
Definition at line 642 of file dm3io.cpp. References is_big_endian, and tagtable. 00643 : filename(dm3_filename), rw_mode(rw), dm3file(0), initialized(false) 00644 { 00645 is_big_endian = ByteOrder::is_host_big_endian(); 00646 tagtable = new TagTable(); 00647 }
|
|
Definition at line 649 of file dm3io.cpp. References dm3file, and tagtable. 00650 { 00651 if (dm3file) { 00652 fclose(dm3file); 00653 dm3file = 0; 00654 } 00655 if (tagtable) { 00656 delete tagtable; 00657 tagtable = 0; 00658 } 00659 }
|
|
Definition at line 704 of file dm3io.cpp. References data. Referenced by EMAN::EMUtil::fast_get_image_type(), and EMAN::EMUtil::get_image_type(). 00705 { 00706 ENTERFUNC; 00707 00708 if (!first_block) { 00709 return false; 00710 } 00711 00712 const int *data = static_cast < const int *>(first_block); 00713 00714 int img_ver = data[0]; 00715 int img_size = data[1]; 00716 int byte_order = data[2]; 00717 00718 ByteOrder::become_big_endian(&img_ver); 00719 00720 if (img_ver != 3) { 00721 return false; 00722 } 00723 00724 ByteOrder::become_big_endian(&img_size); 00725 ByteOrder::become_big_endian(&byte_order); 00726 00727 if (byte_order != 0 && byte_order != 1) { 00728 return false; 00729 } 00730 00731 return true; 00732 }
|
|
|
|
Definition at line 262 of file dm3io.h. Referenced by ~DM3IO(). |
|
|
|
|
|
Definition at line 263 of file dm3io.h. Referenced by DM3IO(). |
|
|
|
|