#include <icosio.h>
Inheritance diagram for EMAN::IcosIO:
Public Member Functions | |
IcosIO (const string &filename, IOMode rw_mode=READ_ONLY) | |
~IcosIO () | |
Static Public Member Functions | |
bool | is_valid (const void *first_block) |
Public Attributes | |
DEFINE_IMAGEIO_FUNC | |
Private Types | |
enum | { STAMP = 72, STAMP1 = 72, STAMP2 = 20, STAMP3 = 20 } |
Private Attributes | |
string | filename |
IOMode | rw_mode |
IcosHeader | icosh |
FILE * | icos_file |
bool | is_big_endian |
bool | initialized |
bool | is_new_file |
1. header, defined in IcosHeader. 2. data: ny*nz of rows. Each row = n1 + row-data + n2 where n1: an integer. n1 = nx*sizeof(float). n2: an integer. n2 = n1. row-data: nx numbers of float points.
An Icos file stores 1 2D or 3D image.
Definition at line 54 of file icosio.h.
|
Definition at line 64 of file icosio.h.
|
|
Definition at line 44 of file icosio.cpp. References icosh, is_big_endian, EMAN::ByteOrder::is_host_big_endian(), and is_new_file. 00045 : filename(file), rw_mode(rw), icos_file(0), initialized(false) 00046 { 00047 is_big_endian = ByteOrder::is_host_big_endian(); 00048 is_new_file = false; 00049 memset(&icosh, 0, sizeof(IcosHeader)); 00050 }
|
|
Definition at line 52 of file icosio.cpp. References icos_file. 00053 { 00054 if (icos_file) { 00055 fclose(icos_file); 00056 icos_file = 0; 00057 } 00058 }
|
|
Definition at line 84 of file icosio.cpp. References data, EMAN::ByteOrder::is_data_big_endian(), EMAN::ByteOrder::is_host_big_endian(), STAMP, STAMP1, STAMP2, and EMAN::ByteOrder::swap_bytes(). Referenced by EMAN::EMUtil::fast_get_image_type(), and EMAN::EMUtil::get_image_type(). 00085 { 00086 ENTERFUNC; 00087 bool result = false; 00088 if (!first_block) { 00089 result = false; 00090 } 00091 else { 00092 const int *data = static_cast < const int *>(first_block); 00093 int stamp = data[0]; 00094 int stamp1 = data[19]; 00095 int stamp2 = data[20]; 00096 int stamp3 = data[26]; 00097 00098 bool data_big_endian = ByteOrder::is_data_big_endian(&stamp); 00099 00100 if (data_big_endian != ByteOrder::is_host_big_endian()) { 00101 ByteOrder::swap_bytes(&stamp); 00102 ByteOrder::swap_bytes(&stamp1); 00103 ByteOrder::swap_bytes(&stamp2); 00104 ByteOrder::swap_bytes(&stamp3); 00105 } 00106 00107 if (stamp == STAMP && stamp1 == STAMP1 && stamp2 == STAMP2 && stamp3 == STAMP3) { 00108 result = true; 00109 } 00110 } 00111 EXITFUNC; 00112 return result; 00113 }
|
|
|
|
|
|
Definition at line 85 of file icosio.h. Referenced by ~IcosIO(). |
|
Definition at line 84 of file icosio.h. Referenced by IcosIO(). |
|
|
|
Definition at line 86 of file icosio.h. Referenced by IcosIO(). |
|
Definition at line 88 of file icosio.h. Referenced by IcosIO(). |
|
|