|
static int | get_debug_int (int i) |
|
static float | get_debug_float (int i) |
|
static string | get_debug_string (int i) |
|
static Transform | get_debug_transform (int i) |
|
static string | get_debug_image (const string &imagename) |
|
static string | get_golden_image (const string &imagename) |
|
static void | to_emobject (const Dict &d) |
|
static EMObject | emobject_to_py (bool b) |
|
static EMObject | emobject_to_py (unsigned int n) |
|
static EMObject | emobject_to_py (int n) |
|
static EMObject | emobject_to_py (float f) |
|
static EMObject | emobject_to_py (double f) |
|
static EMObject | emobject_to_py (const string &str) |
|
static EMObject | emobject_to_py (EMData *emdata) |
|
static EMObject | emobject_to_py (XYData *xydata) |
|
static EMObject | emobject_farray_to_py () |
|
static EMObject | emobject_strarray_to_py () |
|
static EMObject | emobject_transformarray_to_py () |
|
static EMObject | emobject_to_py (Transform *t) |
|
static EMObject | emobject_to_py (Ctf *ctf_) |
|
static IntPoint | test_IntPoint (const IntPoint &p) |
|
static FloatPoint | test_FloatPoint (const FloatPoint &p) |
|
static IntSize | test_IntSize (const IntSize &p) |
|
static FloatSize | test_FloatSize (const FloatSize &p) |
|
static Vec3i | test_Vec3i (const Vec3i &p) |
|
static Vec3f | test_Vec3f (const Vec3f &p) |
|
static vector< int > | test_vector_int (const vector< int > &v) |
|
static vector< float > | test_vector_float (const vector< float > &v) |
|
static vector< long > | test_vector_long (const vector< long > &v) |
|
static vector< string > | test_vector_string (const vector< string > &v) |
|
static vector< EMData * > | test_vector_emdata (const vector< EMData * > &v) |
|
static vector< Pixel > | test_vector_pixel (const vector< Pixel > &v) |
|
static map< string, int > | test_map_int (const map< string, int > &d) |
|
static map< string, long > | test_map_long (const map< string, long > &d) |
|
static map< string, float > | test_map_float (const map< string, float > &d) |
|
static map< string, string > | test_map_string (const map< string, string > &d) |
|
static map< string, EMObject > | test_map_emobject (const map< string, EMObject > &d) |
|
static map< string, vector< string > > | test_map_vecstring (const map< string, vector< string > > &d) |
|
static Dict | test_dict (const Dict &d) |
|
static void | dump_image_from_file (const string &filename) |
|
static void | dump_emdata (EMData *image, const string &filename) |
|
static int | check_image (const string &imagefile, EMData *image=0) |
|
static void | set_progname (const string &cur_progname) |
|
static void | make_image_file (const string &filename, EMUtil::ImageType image_type, EMUtil::EMDataType datatype=EMUtil::EM_FLOAT, int nx=16, int ny=16, int nz=1) |
|
static int | verify_image_file (const string &filename, EMUtil::ImageType image_type, EMUtil::EMDataType datatype=EMUtil::EM_FLOAT, int nx=16, int ny=16, int nz=1) |
|
static void | make_image_file2 (const string &filename, EMUtil::ImageType image_type, EMUtil::EMDataType datatype=EMUtil::EM_FLOAT, int nx=16, int ny=16, int nz=1) |
|
static int | verify_image_file2 (const string &filename, EMUtil::ImageType image_type, EMUtil::EMDataType datatype=EMUtil::EM_FLOAT, int nx=16, int ny=16, int nz=1) |
|
|
static void | make_image_file_by_mode (const string &filename, EMUtil::ImageType image_type, int mode, EMUtil::EMDataType datatype=EMUtil::EM_FLOAT, int nx=16, int ny=16, int nz=1) |
|
static int | verify_image_file_by_mode (const string &filename, EMUtil::ImageType image_type, int mode, EMUtil::EMDataType datatype=EMUtil::EM_FLOAT, int nx=16, int ny=16, int nz=1) |
|
static float | get_pixel_value_by_dist1 (int nx, int ny, int nz, int x, int y, int z) |
|
static float | get_pixel_value_by_dist2 (int nx, int ny, int nz, int x, int y, int z) |
|
|
static float | tf [10] = {1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5} |
|
static int | ti [10] = {10, 20, 30, 40, 50, 60, 70, 80, 90, 100} |
|
static string | progname = "" |
|
Definition at line 48 of file testutil.h.
void TestUtil::dump_emdata |
( |
EMData * |
image, |
|
|
const string & |
filename |
|
) |
| |
|
static |
Definition at line 468 of file testutil.cpp.
474 FILE *hfile = fopen(headerfile.c_str(),
"wb");
479 vector<string> excl_keys;
480 excl_keys.push_back(
"MRC.label");
481 excl_keys.push_back(
"IMAGIC.minute");
482 excl_keys.push_back(
"IMAGIC.sec");
484 Dict attr_dict = image->get_attr_dict();
485 vector < string > keys = attr_dict.
keys();
489 for (
size_t i = 0; i < keys.size(); i++) {
491 bool is_exclude =
false;
492 for (
size_t j = 0; j < excl_keys.size(); j++) {
499 fprintf(hfile,
"%s = %s\n", keys[i].c_str(),
500 attr_dict[keys[i]].
to_str().c_str());
505 fprintf(hfile,
"nx = %d\n", image->get_xsize());
506 fprintf(hfile,
"ny = %d\n", image->get_ysize());
507 fprintf(hfile,
"nz = %d\n", image->get_zsize());
512 FILE *dfile = fopen(datafile.c_str(),
"wb");
517 int nx = image->get_xsize();
518 int ny = image->get_ysize();
519 int nz = image->get_zsize();
521 size_t row_size = nx *
sizeof(float);
522 size_t nxy = nx * ny;
523 float *
rdata = image->get_data();
525 for (
int i = 0; i < nz; i++) {
526 for (
int j = 0; j < ny; j++) {
527 fwrite(&
rdata[i * nxy + j * nx], row_size, 1, dfile);
Dict is a dictionary to store <string, EMObject> pair.
vector< string > keys() const
Get a vector containing all of the (string) keys in this dictionary.
static bool sstrncmp(const char *s1, const char *s2)
Safe string compare.
#define FileAccessException(filename)
const char * to_str(Gatan::TagData::Type type)
References EMDATA_DATA_EXT, EMDATA_HEADER_EXT, FileAccessException, EMAN::Dict::keys(), rdata, EMAN::Util::sbasename(), EMAN::Util::sstrncmp(), and EMAN::Gatan::to_str().
Referenced by check_image(), and dump_image_from_file().