#include <xplorio.h>
Inheritance diagram for EMAN::XplorIO:


Public Member Functions | |
| XplorIO (const string &filename, IOMode rw_mode=READ_ONLY) | |
| ~XplorIO () | |
Static Public Member Functions | |
| bool | is_valid (const void *first_block) |
Public Attributes | |
| DEFINE_IMAGEIO_FUNC | |
Private Attributes | |
| string | filename |
| IOMode | rw_mode |
| FILE * | xplor_file |
| bool | is_big_endian |
| bool | initialized |
| bool | is_new_file |
| int | nlines_in_header |
| int | nx |
| int | ny |
| int | nz |
| float | apix_x |
| float | apix_y |
| float | apix_z |
| float | cell_alpha |
| float | cell_beta |
| float | cell_gama |
Static Private Attributes | |
| const string | SECTION_MODE = "ZYX" |
| const int | NFLOAT_PER_LINE = 6 |
| const int | INTEGER_SIZE = 8 |
| const int | FLOAT_SIZE = 12 |
| const char * | OUTFORMAT = "%12.5E" |
1. header: (note: each integer takes 8 Bytes space, each float is 12.5E format.) line 1: empty line 2: int: number of lines for title (ntitle) next ntitle lines: string: titles line ntitle+3: 9 int: nx, xmin, xmax, ny, ymin, ymax, nz, zmin, zmax line ntitle+4: 6 float: cell size (x, y, z), cell angles (alpha, beta, gamma) line ntitle+5: string: ZYX (this is the section mode. always ZYX)
2. data
for zindex = 1 to nz: zindex nx*ny floats. each line has 6 floats. each float is in 12.5E format.
A XPLOR file contains one 2D or 3D image.
Definition at line 64 of file xplorio.h.
|
||||||||||||
|
Definition at line 60 of file xplorio.cpp. References apix_x, apix_y, apix_z, cell_alpha, cell_beta, cell_gama, is_big_endian, EMAN::ByteOrder::is_host_big_endian(), is_new_file, nlines_in_header, nx, ny, and nz. 00061 : filename(file), rw_mode(rw), xplor_file(0), initialized(false) 00062 { 00063 is_big_endian = ByteOrder::is_host_big_endian(); 00064 is_new_file = false; 00065 nlines_in_header = 0; 00066 00067 nx = 0; 00068 ny = 0; 00069 nz = 0; 00070 00071 apix_x = 0; 00072 apix_y = 0; 00073 apix_z = 0; 00074 00075 cell_alpha = 0; 00076 cell_beta = 0; 00077 cell_gama = 0; 00078 }
|
|
|
Definition at line 80 of file xplorio.cpp. References xplor_file. 00081 {
00082 if (xplor_file) {
00083 fclose(xplor_file);
00084 xplor_file = 0;
00085 }
00086 }
|
|
|
Definition at line 152 of file xplorio.cpp. References EMAN::Util::get_line_from_string(). Referenced by EMAN::EMUtil::fast_get_image_type(), and EMAN::EMUtil::get_image_type(). 00153 {
00154 ENTERFUNC;
00155 if (!first_block) {
00156 return false;
00157 }
00158 char *buf = (char *)(first_block);
00159 string line1 = Util::get_line_from_string(&buf);
00160 bool result = true;
00161
00162 if (line1.size() != 0) {
00163 result = false;
00164 }
00165 else {
00166 string line2 = Util::get_line_from_string(&buf);
00167 int ntitle = 0;
00168
00169 if ((int)line2.size() != INTEGER_SIZE) {
00170 result = false;
00171 }
00172 else {
00173 ntitle = atoi(line2.c_str());
00174 if (ntitle < 0 || ntitle > 50) {
00175 result = false;
00176 }
00177
00178 else {
00179 for (int i = 0; i < ntitle+2; i++) {
00180 Util::get_line_from_string(&buf);
00181 }
00182
00183 string modeline = Util::get_line_from_string(&buf);
00184 if (modeline != SECTION_MODE) {
00185 result = false;
00186 }
00187 }
00188 }
00189 }
00190
00191 EXITFUNC;
00192 return result;
00193 }
|
|
|
Definition at line 87 of file xplorio.h. Referenced by XplorIO(). |
|
|
Definition at line 88 of file xplorio.h. Referenced by XplorIO(). |
|
|
Definition at line 89 of file xplorio.h. Referenced by XplorIO(). |
|
|
Definition at line 91 of file xplorio.h. Referenced by XplorIO(). |
|
|
Definition at line 92 of file xplorio.h. Referenced by XplorIO(). |
|
|
Definition at line 93 of file xplorio.h. Referenced by XplorIO(). |
|
|
|
|
|
|
|
|
Definition at line 57 of file xplorio.cpp. |
|
|
|
|
|
Definition at line 56 of file xplorio.cpp. |
|
|
Definition at line 78 of file xplorio.h. Referenced by XplorIO(). |
|
|
Definition at line 80 of file xplorio.h. Referenced by XplorIO(). |
|
|
Definition at line 55 of file xplorio.cpp. |
|
|
Definition at line 81 of file xplorio.h. Referenced by XplorIO(). |
|
|
Definition at line 83 of file xplorio.h. Referenced by XplorIO(). |
|
|
Definition at line 84 of file xplorio.h. Referenced by XplorIO(). |
|
|
Definition at line 85 of file xplorio.h. Referenced by XplorIO(). |
|
|
Definition at line 58 of file xplorio.cpp. |
|
|
|
|
|
Definition at line 54 of file xplorio.cpp. |
|
|
Definition at line 76 of file xplorio.h. Referenced by ~XplorIO(). |
1.3.9.1