#include <situsio.h>
Inheritance diagram for EMAN::SitusIO:
Public Member Functions | |
SitusIO (const string &omapname, IOMode rw_mode=READ_ONLY) | |
~SitusIO () | |
Static Public Member Functions | |
bool | is_valid (const void *first_block) |
Public Attributes | |
DEFINE_IMAGEIO_FUNC | |
Private Attributes | |
string | filename |
IOMode | rw_mode |
FILE * | situsfile |
bool | initialized |
bool | is_new_file |
float | apix |
float | origx |
float | origy |
float | origz |
int | nx |
int | ny |
int | nz |
Static Private Attributes | |
const int | SITUS_HEADER_LINES = 2 |
const int | FLOAT_SIZE = 12 |
const int | NFLOAT_PER_LINE = 10 |
const char * | OUTFORMAT = "%12.6f" |
const int | LINE_LENGTH = 1024 |
This allows Situs programs to keep track of coordinate systems and it makes the core Situs programs independent of the ever changing map format standards. In the editable (ASCII or text) Situs format, a short header holds the voxel spacing WIDTH, the map origin as defined by the 3D coordinates of the first voxel ORIGX, ORIGY, ORIGZ, and the map dimensions (number of increments) NX, NY, NZ. This minimalist header is followed by the data fields such that x increments change fastest and z increments change slowest. http://situs.biomachina.org/fguide.html#map2map
Definition at line 52 of file situsio.h.
|
Definition at line 48 of file situsio.cpp. 00048 : 00049 filename(situsname), rw_mode(rw), situsfile(0), 00050 initialized(false), is_new_file(false), 00051 apix(0.0f), origx(0.0f), origy(0.0f), origz(0.0f), 00052 nx(0), ny(0), nz(0) 00053 { 00054 }
|
|
Definition at line 56 of file situsio.cpp. References situsfile. 00057 { 00058 if (situsfile) { 00059 fclose(situsfile); 00060 situsfile = 0; 00061 } 00062 }
|
|
Definition at line 186 of file situsio.cpp. References EMAN::Util::get_line_from_string(), nx, and ny. Referenced by EMAN::EMUtil::fast_get_image_type(), and EMAN::EMUtil::get_image_type(). 00187 { 00188 ENTERFUNC; 00189 if (!first_block) { 00190 return false; 00191 } 00192 00193 char *buf = (char *)(first_block); 00194 string line1 = Util::get_line_from_string(&buf); 00195 00196 if(line1.size()==0) return false; 00197 00198 float apix, origx, origy, origz; 00199 int nx, ny, nz; 00200 00201 if(sscanf(line1.c_str(), "%f %f %f %f %d %d %d", &apix, &origx, &origy, &origz, &nx, &ny, &nz) != 7) return false; 00202 00203 if(apix<0.01 || apix>100) return false; 00204 if(nx<=0 || ny<0 || nz<0) return false; 00205 00206 EXITFUNC; 00207 return true; 00208 }
|
|
|
|
|
|
|
|
Definition at line 43 of file situsio.cpp. |
|
|
|
|
|
Definition at line 46 of file situsio.cpp. |
|
Definition at line 44 of file situsio.cpp. |
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 45 of file situsio.cpp. |
|
|
|
Definition at line 42 of file situsio.cpp. |
|
Definition at line 65 of file situsio.h. Referenced by ~SitusIO(). |