36#ifndef emdata__metadata_h__
37#define emdata__metadata_h__
64#ifdef EMAN2_USING_CUDA
68 rdata = (
float*)malloc(num_bytes);
71 if(cudadirtybit == 1){
73 cudaMemcpy(
rdata,cudarwdata,num_bytes,cudaMemcpyDeviceToHost);
93inline void set_data(
float* data,
const int x,
const int y,
const int z) {
95#ifdef EMAN2_USING_CUDA
100 nx =
x; ny =
y; nz = z;
102 nxyz = (size_t)nx*ny*nz;
120void write_data(
string fsp,
size_t loc,
const Region*
const area=0,
const int file_nx=0,
const int file_ny=0,
const int file_nz=0);
133void read_data(
string fsp,
size_t loc,
const Region* area=0,
const int file_nx=0,
const int file_ny=0,
const int file_nz=0);
140 flags |= EMDATA_NEEDUPD;
143 if (fftcache!=0) {
delete fftcache; fftcache=0; }
151 flags &= ~EMDATA_NEEDUPD;
202IntPoint
calc_max_location_wrap(
const int maxshiftx=-1,
const int maxshifty=-1,
const int maxshiftz=-1,
float *value = 0);
291 return all_translation;
313 all_translation =
Vec3f(dx, dy, dz);
323 rotation_dict[
"type"] =
"eman";
324 rotation_dict[
"alt"] = attr_dict[
"euler_alt"];
325 rotation_dict[
"az"] = attr_dict[
"euler_az"];
326 rotation_dict[
"phi"] = attr_dict[
"euler_phi"];
330 trans.set_rotation(rotation_dict);
344 attr_dict[
"orientation_convention"] =
"EMAN";
345 attr_dict[
"euler_alt"]=alt;
346 attr_dict[
"euler_az"]=az;
347 attr_dict[
"euler_phi"]=phi;
358 Dict d = t3d.get_rotation(
"eman");
359 attr_dict[
"orientation_convention"] =
"EMAN";
360 attr_dict[
"euler_alt"] = (float) d[
"alt"];
361 attr_dict[
"euler_az"] = (float) d[
"az"];
362 attr_dict[
"euler_phi"] = (float) d[
"phi"];;
373void set_size(
int nx,
int ny=1,
int nz=1,
bool noalloc=
false);
375#ifdef EMAN2_USING_CUDA
383void set_size_cuda(
int nx,
int ny=1,
int nz=1);
466EMObject
get_attr(
const string & attr_name)
const;
477EMObject
get_attr_default(
const string & attr_name,
const EMObject & em_obj = EMObject())
const;
499 return attr_dict.has_key(key);
510#ifdef EMAN2_USING_CUDA
516inline Dict get_attr_dict_cuda()
const {
return attr_dict;}
531 void del_attr(
const string & attr_name);
579 return (
size_t)nx*(size_t)ny*(
size_t)nz;
587 vector<float> v(size);
616 if (flags & EMDATA_SHUFFLE) {
633 if (flags & EMDATA_FH) {
650 if(attr_dict.has_key(
"is_complex")) {
651 if (
int(attr_dict[
"is_complex"])) {
715 attr_dict[
"is_complex"] = int(1);
718 attr_dict[
"is_complex"] = int(0);
729 if(attr_dict.has_key(
"is_complex_x")) {
730 if (
int(attr_dict[
"is_complex_x"])) {
750 attr_dict[
"is_complex_x"] = int(1);
753 attr_dict[
"is_complex_x"] = int(0);
763 if (flags & EMDATA_FLIP) {
767 if(attr_dict.has_key(
"is_flipped")) {
799 if(attr_dict.has_key(
"is_complex_ri")) {
800 if (
int(attr_dict[
"is_complex_ri"])) {
820 attr_dict[
"is_complex_ri"] = int(1);
823 attr_dict[
"is_complex_ri"] = int(0);
833 if (flags & EMDATA_PAD) {
866 if(flags & EMDATA_FFTODD) {
869 else if( attr_dict.has_key(
"is_fftodd") && (
int)attr_dict[
"is_fftodd"] == 1 ) {
898 attr_dict[
"nxc"] = nxc;
EMData * copy() const
This file is a part of "emdata.h", to use functions in this file, you should "#include "emdata....
boost::multi_array_ref< std::complex< float >, 3 > MCArray3D
boost::multi_array_ref< float, 3 > MArray3D
boost::multi_array_ref< float, 2 > MArray2D
boost::multi_array_ref< std::complex< float >, 2 > MCArray2D