#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 | |
static 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 | |
static const int | SITUS_HEADER_LINES = 2 |
static const int | FLOAT_SIZE = 12 |
static const int | NFLOAT_PER_LINE = 10 |
static const char * | OUTFORMAT = "%12.6f" |
static 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.
SitusIO::SitusIO | ( | const string & | omapname, | |
IOMode | rw_mode = READ_ONLY | |||
) | [explicit] |
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 }
SitusIO::~SitusIO | ( | ) |
bool SitusIO::is_valid | ( | const void * | first_block | ) | [static] |
Definition at line 186 of file situsio.cpp.
References apix, ENTERFUNC, EXITFUNC, EMAN::Util::get_line_from_string(), nx, ny, nz, origx, origy, and origz.
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 }
float EMAN::SitusIO::apix [private] |
string EMAN::SitusIO::filename [private] |
const int SitusIO::FLOAT_SIZE = 12 [static, private] |
bool EMAN::SitusIO::initialized [private] |
bool EMAN::SitusIO::is_new_file [private] |
const int SitusIO::LINE_LENGTH = 1024 [static, private] |
const int SitusIO::NFLOAT_PER_LINE = 10 [static, private] |
int EMAN::SitusIO::nx [private] |
int EMAN::SitusIO::ny [private] |
int EMAN::SitusIO::nz [private] |
float EMAN::SitusIO::origx [private] |
float EMAN::SitusIO::origy [private] |
float EMAN::SitusIO::origz [private] |
const char * SitusIO::OUTFORMAT = "%12.6f" [static, private] |
IOMode EMAN::SitusIO::rw_mode [private] |
const int SitusIO::SITUS_HEADER_LINES = 2 [static, private] |
FILE* EMAN::SitusIO::situsfile [private] |