This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Functions | ||||
EMData * | get_fft_amplitude () | |||
return the amplitudes of the FFT including the left half | ||||
EMData * | get_fft_amplitude2D () | |||
return the amplitudes of the 2D FFT including the left half PRB
| ||||
EMData * | get_fft_phase () | |||
return the phases of the FFT including the left half | ||||
float * | get_data () const | |||
Get the image pixel density data in a 1D float array. | ||||
const float * | get_const_data () const | |||
Get the image pixel density data in a 1D float array - const version of get_data. | ||||
void | set_data (float *data, const int x, const int y, const int z) | |||
Set the data explicitly data pointer must be allocated using malloc! | ||||
void | 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) | |||
Dump the image pixel data in native byte order to a disk file. | ||||
void | 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) | |||
Read the image pixel data in native byte order from a disk file. | ||||
void | update () | |||
Mark EMData as changed, statistics, etc will be updated at need. | ||||
void | clearupdate () | |||
turn off updates. | ||||
bool | has_ctff () const | |||
check whether the image physical file has the CTF info or not. | ||||
float | calc_center_density () | |||
Calculates the density value at the peak of the image histogram, sort of like the mode of the density. | ||||
float | calc_sigma_diff () | |||
Calculates sigma above and below the mean and returns the difference between them. | ||||
IntPoint | calc_min_location () const | |||
Calculates the coordinates of the minimum-value pixel. | ||||
IntPoint | calc_max_location () const | |||
Calculates the coordinates of the maximum-value pixel. | ||||
IntPoint | calc_max_location_wrap (const int maxshiftx=-1, const int maxshifty=-1, const int maxshiftz=-1) | |||
Calculates the wrapped coordinates of the maximum value This function is useful in the context of Fourier correlation you can call this function to find the correct translational shift when using calc_ccf etc. | ||||
vector< float > | calc_max_location_wrap_intp (const int maxshiftx=-1, const int maxshifty=-1, const int maxshiftz=-1) | |||
Calculates the wrapped coordinates of the maximum value, and uses quadration intp to subpixel prec This function is useful in the context of Fourier correlation you can call this function to find the correct translational shift when using calc_ccf etc. | ||||
FloatPoint | calc_center_of_mass (const float threshold=0) | |||
Calculate the center of mass with a threshold (Default 0, so only positive values are considered). | ||||
size_t | calc_min_index () const | |||
Calculates the index of minimum-value pixel when assuming all pixels are in a 1D array. | ||||
size_t | calc_max_index () const | |||
Calculates the index of maximum-value pixel when assuming all pixels are in a 1D array. | ||||
vector< Pixel > | calc_highest_locations (float threshold) const | |||
Calculate and return a sorted list of pixels whose values are above a specified threshold. | ||||
vector< Pixel > | calc_n_highest_locations (int n) | |||
Calculate and return a sorted list of N highest pixels in the map. | ||||
vector< Pixel > | find_pixels_with_value (float val) | |||
Find pixels in the image with exactly the specified values. | ||||
float | get_edge_mean () const | |||
Calculates the mean pixel values around the (1 pixel) edge of the image. | ||||
float | get_circle_mean () | |||
Calculates the circular edge mean by applying a circular mask on 'this' image. | ||||
Ctf * | get_ctf () const | |||
Get ctf parameter of this image. | ||||
void | set_ctf (Ctf *ctf) | |||
Set the CTF parameter of this image. | ||||
Vec3f | get_translation () const | |||
Get 'this' image's translation vector from the original location. | ||||
void | set_translation (const Vec3f &t) | |||
Set 'this' images' translation vector from the original location. | ||||
void | set_translation (float dx, float dy, float dz) | |||
Set 'this' images' translation vector from the original location. | ||||
Transform | get_transform () const | |||
Get the 3D orientation of 'this' image. | ||||
void | set_rotation (float az, float alt, float phi) | |||
Define the 3D orientation of this particle, also used to indicate relative rotations for reconstructions. | ||||
void | set_rotation (const Transform &t3d) | |||
Define the 3D orientation of this particle Orientation information is extracted from a Transform object and stored internally in EMAN (az,alt,phi) format. | ||||
void | set_size (int nx, int ny=1, int nz=1) | |||
Resize this EMData's main board memory pointer. | ||||
void | set_complex_size (int nx, int ny=1, int nz=1) | |||
Resize 'this' complex image. | ||||
void | set_path (const string &new_path) | |||
Set the path. | ||||
void | set_pathnum (int n) | |||
Set the number of paths. | ||||
MArray2D | get_2dview () const | |||
Get image raw pixel data in a 2D multi-array format. | ||||
MArray3D | get_3dview () const | |||
Get image raw pixel data in a 3D multi-array format. | ||||
MCArray2D | get_2dcview () const | |||
Get complex image raw pixel data in a 2D multi-array format. | ||||
MCArray3D | get_3dcview () const | |||
Get complex image raw pixel data in a 3D multi-array format. | ||||
MCArray3D * | get_3dcviewptr () const | |||
Get pointer to a complex image raw pixel data in a 3D multi-array format. | ||||
MArray2D | get_2dview (int x0, int y0) const | |||
Get image raw pixel data in a 2D multi-array format. | ||||
MArray3D | get_3dview (int x0, int y0, int z0) const | |||
Get image raw pixel data in a 3D multi-array format. | ||||
MCArray2D | get_2dcview (int x0, int y0) const | |||
Get complex image raw pixel data in a 2D multi-array format. | ||||
MCArray3D | get_3dcview (int x0, int y0, int z0) const | |||
Get complex image raw pixel data in a 3D multi-array format. | ||||
EMObject | get_attr (const string &attr_name) const | |||
The generic way to get any image header information given a header attribute name. | ||||
EMObject | get_attr_default (const string &attr_name, const EMObject &em_obj=EMObject()) const | |||
The generic way to get any image header information given a header attribute name. | ||||
void | set_attr (const string &key, EMObject val) | |||
Set a header attribute's value. | ||||
void | set_attr_python (const string &key, EMObject val) | |||
Set a header attribute's value from Python. | ||||
bool | has_attr (const string &key) const | |||
Ask if the header has a particular attribute. | ||||
Dict | get_attr_dict () const | |||
Get the image attribute dictionary containing all the image attribute names and attribute values. | ||||
void | set_attr_dict (const Dict &new_dict) | |||
Merge the new values with the existing dictionary. | ||||
void | del_attr (const string &attr_name) | |||
Delete the attribute from dictionary. | ||||
void | del_attr_dict (const vector< string > &del_keys) | |||
Delete the attributes from the dictionary. | ||||
int | get_xsize () const | |||
Get the image x-dimensional size. | ||||
int | get_ysize () const | |||
Get the image y-dimensional size. | ||||
int | get_zsize () const | |||
Get the image z-dimensional size. | ||||
size_t | get_size () const | |||
Get the number of allocated floats in the image (nx*ny*nz). | ||||
vector< float > | get_data_as_vector () const | |||
Get the pixel data as a vector. | ||||
int | get_ndim () const | |||
Get image dimension. | ||||
bool | is_shuffled () const | |||
Has this image been shuffled? | ||||
bool | is_FH () const | |||
Is this a FH image? | ||||
bool | is_complex () const | |||
Is this a complex image? | ||||
bool | is_real () const | |||
Is this a real image? | ||||
void | set_shuffled (bool is_shuffled) | |||
Mark this image as a shuffled image. | ||||
void | set_FH (bool is_FH) | |||
Mark this complex image as a FH image. | ||||
void | set_complex (bool is_complex) | |||
Mark this image as a complex image. | ||||
bool | is_complex_x () const | |||
Is this image a 1D FFT image in X direction? | ||||
void | set_complex_x (bool is_complex_x) | |||
Marks this image a 1D FFT image in X direction. | ||||
bool | is_flipped () const | |||
Is this image flipped? | ||||
void | set_flipped (bool is_flipped) | |||
Mark this image as flipped. | ||||
bool | is_ri () const | |||
Is this image a real/imaginary format complex image? | ||||
void | set_ri (bool is_ri) | |||
Mark this image as a real/imaginary format complex image. | ||||
bool | is_fftpadded () const | |||
Is this image already extended along x for ffts? | ||||
void | set_fftpad (bool is_fftpadded) | |||
Mark this image as already extended along x for ffts. | ||||
bool | is_fftodd () const | |||
Does this image correspond to a (real-space) odd nx? | ||||
void | set_fftodd (bool is_fftodd) | |||
Mark this image as having (real-space) odd nx. | ||||
void | set_nxc (int nxc) | |||
Set the number of complex elements along x. | ||||
int | get_flags () const | |||
void | set_flags (int f) | |||
int | get_changecount () const | |||
void | set_changecount (int c) | |||
int | get_xoff () const | |||
int | get_yoff () const | |||
int | get_zoff () const | |||
void | set_xyzoff (int x, int y, int z) | |||
void | scale_pixel (float scale_factor) const | |||
Scale the angstrom per pixel of this image by a uniform amount Alters the EMData metadata I had to make this function public for access from the Processors (David Woolford). | ||||
string | get_path () const | |||
int | get_pathnum () const | |||
std::string | get_data_pickle () const | |||
void | set_data_pickle (std::string vf) | |||
int | get_supp_pickle () const | |||
void | set_supp_pickle (int i) | |||
vector< Vec3i > | mask_contig_region (const float &val, const Vec3i &seed) | |||
float | get_amplitude_thres (float thres) | |||
return the FFT amplitude which is greater than thres % | ||||
void | set_attr_dict_explicit (const Dict &new_dict) | |||
Make the attributes of this EMData exactly equal to the argument dictionary Originally introduced because set_attr_dict does automatic resizing, which is undersirable in some circumstances. |
float calc_center_density | ( | ) |
Calculates the density value at the peak of the image histogram, sort of like the mode of the density.
FloatPoint calc_center_of_mass | ( | const float | threshold = 0 |
) |
Calculate the center of mass with a threshold (Default 0, so only positive values are considered).
vector<Pixel> calc_highest_locations | ( | float | threshold | ) | const |
Calculate and return a sorted list of pixels whose values are above a specified threshold.
The pixels are sorted from high to low.
threshold | The specified pixel value. Returned pixels should have higher values than it. |
size_t calc_max_index | ( | ) | const |
Calculates the index of maximum-value pixel when assuming all pixels are in a 1D array.
IntPoint calc_max_location | ( | ) | const |
Calculates the coordinates of the maximum-value pixel.
IntPoint calc_max_location_wrap | ( | const int | maxshiftx = -1 , |
|
const int | maxshifty = -1 , |
|||
const int | maxshiftz = -1 | |||
) |
Calculates the wrapped coordinates of the maximum value This function is useful in the context of Fourier correlation you can call this function to find the correct translational shift when using calc_ccf etc.
vector<float> calc_max_location_wrap_intp | ( | const int | maxshiftx = -1 , |
|
const int | maxshifty = -1 , |
|||
const int | maxshiftz = -1 | |||
) |
Calculates the wrapped coordinates of the maximum value, and uses quadration intp to subpixel prec This function is useful in the context of Fourier correlation you can call this function to find the correct translational shift when using calc_ccf etc.
size_t calc_min_index | ( | ) | const |
Calculates the index of minimum-value pixel when assuming all pixels are in a 1D array.
IntPoint calc_min_location | ( | ) | const |
Calculates the coordinates of the minimum-value pixel.
vector<Pixel> calc_n_highest_locations | ( | int | n | ) |
Calculate and return a sorted list of N highest pixels in the map.
n | The number of highest value pixels should be returned. |
float calc_sigma_diff | ( | ) |
Calculates sigma above and below the mean and returns the difference between them.
void clearupdate | ( | ) | [inline] |
turn off updates.
Useful to avoid wasteful recacling stats
Definition at line 143 of file emdata_metadata.h.
void del_attr | ( | const string & | attr_name | ) |
Delete the attribute from dictionary.
attr_name | the attribute name to be removed |
void del_attr_dict | ( | const vector< string > & | del_keys | ) |
Delete the attributes from the dictionary.
del_keys | the attrutes' names to be removed |
vector<Pixel> find_pixels_with_value | ( | float | val | ) |
Find pixels in the image with exactly the specified values.
val | The value to look for |
MCArray2D get_2dcview | ( | int | x0, | |
int | y0 | |||
) | const |
Get complex image raw pixel data in a 2D multi-array format.
The data coordinates is translated by (x0,y0) such that array[y0][x0] points to the pixel at the origin location. the data coordiates translated by (x0,y0). The array shares the memory space with the image data.
It should be used on 2D image only.
x0 | X-axis translation amount. | |
y0 | Y-axis translation amount. |
MCArray2D get_2dcview | ( | ) | const |
Get complex image raw pixel data in a 2D multi-array format.
The array shares the memory space with the image data.
It should be used on 2D image only.
MArray2D get_2dview | ( | int | x0, | |
int | y0 | |||
) | const |
Get image raw pixel data in a 2D multi-array format.
The data coordinates is translated by (x0,y0) such that array[y0][x0] points to the pixel at the origin location. the data coordiates translated by (x0,y0). The array shares the memory space with the image data.
It should be used on 2D image only.
x0 | X-axis translation amount. | |
y0 | Y-axis translation amount. |
MArray2D get_2dview | ( | ) | const |
Get image raw pixel data in a 2D multi-array format.
The array shares the memory space with the image data. Notice: the subscription order is d[y][x] in Python, it's d[x][y] in C++
It should be used on 2D image only.
MCArray3D get_3dcview | ( | int | x0, | |
int | y0, | |||
int | z0 | |||
) | const |
Get complex image raw pixel data in a 3D multi-array format.
The data coordinates is translated by (x0,y0,z0) such that array[z0][y0][x0] points to the pixel at the origin location. the data coordiates translated by (x0,y0,z0). The array shares the memory space with the image data.
It should be used on 3D image only.
x0 | X-axis translation amount. | |
y0 | Y-axis translation amount. | |
z0 | Z-axis translation amount. |
MCArray3D get_3dcview | ( | ) | const |
Get complex image raw pixel data in a 3D multi-array format.
The array shares the memory space with the image data.
It should be used on 3D image only.
MCArray3D* get_3dcviewptr | ( | ) | const |
Get pointer to a complex image raw pixel data in a 3D multi-array format.
The array shares the memory space with the image data.
It should be used on 3D image only.
MArray3D get_3dview | ( | int | x0, | |
int | y0, | |||
int | z0 | |||
) | const |
Get image raw pixel data in a 3D multi-array format.
The data coordinates is translated by (x0,y0,z0) such that array[z0][y0][x0] points to the pixel at the origin location. the data coordiates translated by (x0,y0,z0). The array shares the memory space with the image data.
It should be used on 3D image only.
x0 | X-axis translation amount. | |
y0 | Y-axis translation amount. | |
z0 | Z-axis translation amount. |
MArray3D get_3dview | ( | ) | const |
Get image raw pixel data in a 3D multi-array format.
The array shares the memory space with the image data. Notice: the subscription order is d[z][y][x] in Python, it's d[x][y][z] in C++ --grant Tang
It should be used on 3D image only.
float get_amplitude_thres | ( | float | thres | ) |
return the FFT amplitude which is greater than thres %
ImageFormatException | If the image is not a complex image. |
EMObject get_attr | ( | const string & | attr_name | ) | const |
The generic way to get any image header information given a header attribute name.
If the attribute does not exist, it will raise an exception.
attr_name | The header attribute name. |
NotExistingObjectException | when attribute not exist |
Referenced by ali3d_d(), is_fftpadded(), is_FH(), is_flipped(), is_shuffled(), EMAN::Util::multiref_polar_ali_2d_local(), EMAN::Util::multiref_polar_ali_2d_local_psi(), EMAN::Util::multiref_polar_ali_helical_90_local(), EMAN::Util::multiref_polar_ali_helical_local(), EMAN::KMeansAnalyzer::reseed(), and EMAN::KMeansAnalyzer::update_centers().
EMObject get_attr_default | ( | const string & | attr_name, | |
const EMObject & | em_obj = EMObject() | |||
) | const |
The generic way to get any image header information given a header attribute name.
If the attribute does not exist, it will return a default EMObject() object, which will be converted to None in Python. Or return any object user submit.
attr_name | The header attribute name. | |
em_obj | the default attribute to return when this attr_name not exist in attr_dict |
Dict get_attr_dict | ( | ) | const |
Get the image attribute dictionary containing all the image attribute names and attribute values.
int get_changecount | ( | ) | const [inline] |
float get_circle_mean | ( | ) |
Calculates the circular edge mean by applying a circular mask on 'this' image.
const float* get_const_data | ( | ) | const [inline] |
Get the image pixel density data in a 1D float array - const version of get_data.
Definition at line 85 of file emdata_metadata.h.
References get_data().
00085 { return get_data(); }
Ctf* get_ctf | ( | ) | const |
Get ctf parameter of this image.
float* get_data | ( | ) | const [inline] |
Get the image pixel density data in a 1D float array.
Definition at line 79 of file emdata_metadata.h.
References rdata.
Referenced by CleanStack(), CleanStack_Cart(), cmplx(), EMAN::Util::ener_tot(), get_const_data(), get_data_as_vector(), get_value_at(), EMAN::PCA::Lanczos(), EMAN::EMUtil::make_image_median(), operator()(), ReadStackandDist_Cart(), set_value_at(), set_value_at_fast(), and unified().
00079 { return rdata; }
vector<float> get_data_as_vector | ( | ) | const [inline] |
Get the pixel data as a vector.
Definition at line 644 of file emdata_metadata.h.
References copy(), data, get_data(), get_size(), and v.
00644 { 00645 int size = get_size(); 00646 vector<float> v(size); 00647 float* data = get_data(); 00648 std::copy(data,data+size,v.begin()); 00649 return v; 00650 }
std::string get_data_pickle | ( | ) | const |
float get_edge_mean | ( | ) | const |
Calculates the mean pixel values around the (1 pixel) edge of the image.
EMData* get_fft_amplitude | ( | ) |
return the amplitudes of the FFT including the left half
ImageFormatException | If the image is not a complex image. |
EMData* get_fft_amplitude2D | ( | ) |
return the amplitudes of the 2D FFT including the left half PRB
ImageFormatException | If the image is not a complex image. |
EMData* get_fft_phase | ( | ) |
return the phases of the FFT including the left half
ImageFormatException | If the image is not a complex image. |
int get_flags | ( | ) | const [inline] |
int get_ndim | ( | ) | const [inline] |
Get image dimension.
Definition at line 655 of file emdata_metadata.h.
References ny.
00656 { 00657 if (nz <= 1) { 00658 if (ny <= 1) { 00659 return 1; 00660 } 00661 else { 00662 return 2; 00663 } 00664 } 00665 00666 return 3; 00667 }
string get_path | ( | ) | const [inline] |
int get_pathnum | ( | ) | const [inline] |
size_t get_size | ( | ) | const [inline] |
Get the number of allocated floats in the image (nx*ny*nz).
Definition at line 636 of file emdata_metadata.h.
Referenced by get_data_as_vector().
int get_supp_pickle | ( | ) | const |
Transform get_transform | ( | ) | const [inline] |
Get the 3D orientation of 'this' image.
Definition at line 313 of file emdata_metadata.h.
00314 { 00315 Dict rotation_dict; 00316 rotation_dict["type"] = "eman"; 00317 rotation_dict["alt"] = attr_dict["euler_alt"]; 00318 rotation_dict["az"] = attr_dict["euler_az"]; 00319 rotation_dict["phi"] = attr_dict["euler_phi"]; 00320 00321 Transform trans; 00322 trans.to_identity(); 00323 trans.set_rotation(rotation_dict); 00324 00325 return trans; 00326 }
Vec3f get_translation | ( | ) | const [inline] |
Get 'this' image's translation vector from the original location.
Definition at line 282 of file emdata_metadata.h.
int get_xoff | ( | ) | const [inline] |
int get_xsize | ( | ) | const [inline] |
Get the image x-dimensional size.
Definition at line 609 of file emdata_metadata.h.
References nx.
Referenced by EMAN::KMeansAnalyzer::analyze(), EMAN::MarchingCubes::draw_cube(), main(), and median().
00610 { 00611 return nx; 00612 }
int get_yoff | ( | ) | const [inline] |
int get_ysize | ( | ) | const [inline] |
Get the image y-dimensional size.
Definition at line 618 of file emdata_metadata.h.
References ny.
Referenced by EMAN::KMeansAnalyzer::analyze(), EMAN::MarchingCubes::draw_cube(), and median().
00619 { 00620 return ny; 00621 }
int get_zoff | ( | ) | const [inline] |
int get_zsize | ( | ) | const [inline] |
Get the image z-dimensional size.
Definition at line 627 of file emdata_metadata.h.
Referenced by EMAN::KMeansAnalyzer::analyze(), EMAN::MarchingCubes::draw_cube(), and median().
bool has_attr | ( | const string & | key | ) | const [inline] |
Ask if the header has a particular attribute.
key | the header attribute name |
Definition at line 563 of file emdata_metadata.h.
Referenced by is_fftpadded(), is_FH(), and is_shuffled().
00563 { 00564 return attr_dict.has_key(key); 00565 }
bool has_ctff | ( | ) | const [inline] |
check whether the image physical file has the CTF info or not.
Definition at line 152 of file emdata_metadata.h.
00153 { 00154 if (this->has_attr("ctf")) { 00155 return true; 00156 } 00157 else { 00158 return false; 00159 } 00160 }
bool is_complex | ( | ) | const [inline] |
Is this a complex image?
Definition at line 707 of file emdata_metadata.h.
Referenced by is_real(), EMAN::TestUtil::make_image_file_by_mode(), and EMAN::TestUtil::verify_image_file_by_mode().
00708 { 00709 if(attr_dict.has_key("is_complex")) { 00710 if (int(attr_dict["is_complex"])) { 00711 return true; 00712 } 00713 else { 00714 return false; 00715 } 00716 } 00717 else { 00718 return false; 00719 } 00720 }
bool is_complex_x | ( | ) | const [inline] |
Is this image a 1D FFT image in X direction?
Definition at line 786 of file emdata_metadata.h.
00787 { 00788 if(attr_dict.has_key("is_complex_x")) { 00789 if (int(attr_dict["is_complex_x"])) { 00790 return true; 00791 } 00792 else { 00793 return false; 00794 } 00795 } 00796 else { 00797 return false; 00798 } 00799 }
bool is_fftodd | ( | ) | const [inline] |
Does this image correspond to a (real-space) odd nx?
Definition at line 923 of file emdata_metadata.h.
Referenced by EMAN::FourierReconstructor::setup(), EMAN::FourierReconstructorSimple2D::setup(), and EMAN::FourierReconstructor::setup_seed().
00924 { 00925 if(flags & EMDATA_FFTODD) { 00926 return true; 00927 } 00928 else if( attr_dict.has_key("is_fftodd") && (int)attr_dict["is_fftodd"] == 1 ) { 00929 return true; 00930 } 00931 else { 00932 return false; 00933 } 00934 }
bool is_fftpadded | ( | ) | const [inline] |
Is this image already extended along x for ffts?
Definition at line 890 of file emdata_metadata.h.
References get_attr(), and has_attr().
00891 { 00892 if (flags & EMDATA_PAD) { 00893 return true; 00894 } 00895 00896 if(has_attr("is_fftpad")) { 00897 return get_attr("is_fftpad"); 00898 } 00899 00900 return false; 00901 00902 }
bool is_FH | ( | ) | const [inline] |
Is this a FH image?
Definition at line 690 of file emdata_metadata.h.
References get_attr(), and has_attr().
00691 { // PRB 00692 if (flags & EMDATA_FH) { 00693 return true; 00694 } 00695 00696 if(has_attr("is_fh")) { 00697 return get_attr("is_fh"); 00698 } 00699 00700 return false; 00701 }
bool is_flipped | ( | ) | const [inline] |
Is this image flipped?
Definition at line 820 of file emdata_metadata.h.
References get_attr().
00821 { 00822 if (flags & EMDATA_FLIP) { //keep here for back compatibility 00823 return true; 00824 } 00825 00826 if(attr_dict.has_key("is_flipped")) { 00827 if(get_attr("is_flipped")) { 00828 return true; 00829 } 00830 } 00831 00832 return false; 00833 00834 }
bool is_real | ( | ) | const [inline] |
Is this a real image?
Definition at line 726 of file emdata_metadata.h.
References is_complex().
00727 { 00728 return !is_complex(); 00729 }
bool is_ri | ( | ) | const [inline] |
Is this image a real/imaginary format complex image?
Definition at line 856 of file emdata_metadata.h.
00857 { 00858 if(attr_dict.has_key("is_complex_ri")) { 00859 if (int(attr_dict["is_complex_ri"])) { 00860 return true; 00861 } 00862 else { 00863 return false; 00864 } 00865 } 00866 else { 00867 return false; 00868 } 00869 }
bool is_shuffled | ( | ) | const [inline] |
Has this image been shuffled?
Definition at line 673 of file emdata_metadata.h.
References get_attr(), and has_attr().
00674 { // PRB 00675 if (flags & EMDATA_SHUFFLE) { 00676 return true; 00677 } 00678 00679 if(has_attr("is_shuffled")) { 00680 return get_attr("is_shuffled"); 00681 } 00682 00683 return false; 00684 }
void 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 | |||
) |
Read the image pixel data in native byte order from a disk file.
The image should already have the correct dimensions.
fsp | The filename to read the image data from | |
loc | Location to seek to in the file before writing (size_t) | |
area | The image region you want to read, default 0 means read the whole image | |
file_nx | Image x size. | |
file_ny | Image y size. | |
file_nz | Image z size. |
void scale_pixel | ( | float | scale_factor | ) | const |
Scale the angstrom per pixel of this image by a uniform amount Alters the EMData metadata I had to make this function public for access from the Processors (David Woolford).
void set_attr | ( | const string & | key, | |
EMObject | val | |||
) |
Set a header attribute's value.
key | The header attribute name. | |
val | The attribute value. |
Referenced by EMAN::KMeansAnalyzer::analyze(), set_fftodd(), set_fftpad(), set_FH(), set_flipped(), set_shuffled(), and EMAN::KMeansAnalyzer::update_centers().
void set_attr_dict | ( | const Dict & | new_dict | ) |
Merge the new values with the existing dictionary.
new_dict | The new attribute dictionary. |
void set_attr_dict_explicit | ( | const Dict & | new_dict | ) | [private] |
Make the attributes of this EMData exactly equal to the argument dictionary Originally introduced because set_attr_dict does automatic resizing, which is undersirable in some circumstances.
new_dict | The attribute dictionary that will become this image's attribute dictionary. |
void set_attr_python | ( | const string & | key, | |
EMObject | val | |||
) |
Set a header attribute's value from Python.
key | The header attribute name. | |
val | The attribute value. |
void set_changecount | ( | int | c | ) | [inline] |
void set_complex | ( | bool | is_complex | ) | [inline] |
Mark this image as a complex image.
is_complex | If true, a complex image. If false, a real image. |
Definition at line 771 of file emdata_metadata.h.
Referenced by EMAN::Util::TwoDTestFunc().
00772 { 00773 if (is_complex) { 00774 attr_dict["is_complex"] = int(1); 00775 } 00776 else { 00777 attr_dict["is_complex"] = int(0); 00778 } 00779 }
void set_complex_size | ( | int | nx, | |
int | ny = 1 , |
|||
int | nz = 1 | |||
) |
Resize 'this' complex image.
nx | x size of this image. | |
ny | y size of this image. | |
nz | z size of this image. |
Definition at line 386 of file emdata_metadata.h.
References ny, and set_size().
void set_complex_x | ( | bool | is_complex_x | ) | [inline] |
Marks this image a 1D FFT image in X direction.
is_complex_x | If true, a 1D FFT image in X direction; If false, not such an image. |
Definition at line 806 of file emdata_metadata.h.
00807 { 00808 if (is_complex_x) { 00809 attr_dict["is_complex_x"] = int(1); 00810 } 00811 else { 00812 attr_dict["is_complex_x"] = int(0); 00813 } 00814 }
void set_ctf | ( | Ctf * | ctf | ) |
Set the CTF parameter of this image.
ctf | The CTF parameter object. |
void set_data | ( | float * | data, | |
const int | x, | |||
const int | y, | |||
const int | z | |||
) | [inline] |
Set the data explicitly data pointer must be allocated using malloc!
data | a pointer to the pixel data which is stored in memory. Takes possession | |
x | the number of pixels in the x direction | |
y | the number of pixels in the y direction | |
z | the number of pixels in the z direction |
Definition at line 94 of file emdata_metadata.h.
References nx, ny, rdata, and update().
00094 { 00095 if (rdata) { EMUtil::em_free(rdata); rdata = 0; } 00096 #ifdef EMAN2_USING_CUDA 00097 //cout << "set data" << endl; 00098 // free_cuda_memory(); 00099 #endif 00100 rdata = data; 00101 nx = x; ny = y; nz = z; 00102 nxy = nx*ny; 00103 nxyz = (size_t)nx*ny*nz; 00104 update(); 00105 }
void set_data_pickle | ( | std::string | vf | ) |
void set_fftodd | ( | bool | is_fftodd | ) | [inline] |
Mark this image as having (real-space) odd nx.
is_fftodd | If true, mark as nx odd; If false, mark as nx not odd. |
Definition at line 941 of file emdata_metadata.h.
References set_attr().
00942 { 00943 if (is_fftodd) { 00944 set_attr("is_fftodd", int(1)); 00945 } 00946 else { 00947 set_attr("is_fftodd", int(0)); 00948 } 00949 }
void set_fftpad | ( | bool | is_fftpadded | ) | [inline] |
Mark this image as already extended along x for ffts.
is_fftpadded | If true, mark as padded along x; If false, mark as not padded along x. |
Definition at line 909 of file emdata_metadata.h.
References set_attr().
00910 { 00911 if (is_fftpadded) { 00912 set_attr("is_fftpad", int(1)); 00913 } 00914 else { 00915 set_attr("is_fftpad", int(0)); 00916 } 00917 }
void set_FH | ( | bool | is_FH | ) | [inline] |
Mark this complex image as a FH image.
is_FH | If true, a FH image. If false, not a FH image. |
Definition at line 754 of file emdata_metadata.h.
References set_attr().
00755 { // PRB 00756 if (is_FH) { 00757 // flags |= EMDATA_FH; 00758 set_attr("is_fh", (int)1); 00759 } 00760 else { 00761 // flags &= ~EMDATA_FH; 00762 set_attr("is_fh", (int)0); 00763 } 00764 }
void set_flags | ( | int | f | ) | [inline] |
void set_flipped | ( | bool | is_flipped | ) | [inline] |
Mark this image as flipped.
is_flipped | If true, mark this image as flipped; If false, mark this image as not flipped. |
Definition at line 841 of file emdata_metadata.h.
References set_attr().
00842 { 00843 if (is_flipped) { 00844 set_attr("is_flipped", (int)1); 00845 } 00846 else { 00847 set_attr("is_flipped", (int)0); 00848 } 00849 }
void set_nxc | ( | int | nxc | ) | [inline] |
Set the number of complex elements along x.
nxc | is the number of complex elements along x. |
Definition at line 955 of file emdata_metadata.h.
void set_path | ( | const string & | new_path | ) | [inline] |
void set_pathnum | ( | int | n | ) | [inline] |
Set the number of paths.
n | The number of paths. |
Definition at line 403 of file emdata_metadata.h.
void set_ri | ( | bool | is_ri | ) | [inline] |
Mark this image as a real/imaginary format complex image.
is_ri | If true, mark as real/imaginary format; If false, mark as amp/phase format. |
Definition at line 876 of file emdata_metadata.h.
Referenced by EMAN::Util::TwoDTestFunc().
00877 { 00878 if (is_ri) { 00879 attr_dict["is_complex_ri"] = int(1); 00880 } 00881 else { 00882 attr_dict["is_complex_ri"] = int(0); 00883 } 00884 }
void set_rotation | ( | const Transform & | t3d | ) | [inline] |
Define the 3D orientation of this particle Orientation information is extracted from a Transform object and stored internally in EMAN (az,alt,phi) format.
t3d | a Transform object containing the particle orientation |
Definition at line 349 of file emdata_metadata.h.
00350 { 00351 Dict d = t3d.get_rotation("eman"); 00352 attr_dict["orientation_convention"] = "EMAN"; 00353 attr_dict["euler_alt"] = (float) d["alt"]; 00354 attr_dict["euler_az"] = (float) d["az"]; 00355 attr_dict["euler_phi"] = (float) d["phi"];; 00356 }
void set_rotation | ( | float | az, | |
float | alt, | |||
float | phi | |||
) | [inline] |
Define the 3D orientation of this particle, also used to indicate relative rotations for reconstructions.
az | 'az' Euler angle in EMAN convention. | |
alt | 'alt' Euler angle in EMAN convention. | |
phi | 'phi' Euler angle in EMAN convention. |
Definition at line 335 of file emdata_metadata.h.
00336 { 00337 attr_dict["orientation_convention"] = "EMAN"; 00338 attr_dict["euler_alt"]=alt; 00339 attr_dict["euler_az"]=az; 00340 attr_dict["euler_phi"]=phi; 00341 }
void set_shuffled | ( | bool | is_shuffled | ) | [inline] |
Mark this image as a shuffled image.
is_shuffled | If true, a shuffled image. If false, not a shuffled image. |
Definition at line 736 of file emdata_metadata.h.
References set_attr().
00737 { // PRB 00738 if (is_shuffled) { 00739 // printf("entered correct part of set_shuffled \n"); 00740 // flags |= EMDATA_SHUFFLE; 00741 set_attr("is_shuffled", (int)1); 00742 } 00743 else { 00744 // flags &= ~EMDATA_SHUFFLE; 00745 set_attr("is_shuffled", (int)0); 00746 } 00747 }
void set_size | ( | int | nx, | |
int | ny = 1 , |
|||
int | nz = 1 | |||
) |
Resize this EMData's main board memory pointer.
nx | x size of this image. | |
ny | y size of this image. | |
nz | z size of this image. |
BadAllocException | if memory allocation returns a null pointer |
Referenced by set_complex_size().
void set_supp_pickle | ( | int | i | ) |
void set_translation | ( | float | dx, | |
float | dy, | |||
float | dz | |||
) | [inline] |
Set 'this' images' translation vector from the original location.
dx | The translation distance in x direction. | |
dy | The translation distance in y direction. | |
dz | The translation distance in z direction. |
Definition at line 304 of file emdata_metadata.h.
00305 { 00306 all_translation = Vec3f(dx, dy, dz); 00307 }
void set_translation | ( | const Vec3f & | t | ) | [inline] |
Set 'this' images' translation vector from the original location.
t | The new translation vector. |
Definition at line 292 of file emdata_metadata.h.
00293 { 00294 all_translation = t; 00295 }
void set_xyzoff | ( | int | x, | |
int | y, | |||
int | z | |||
) | [inline] |
void update | ( | ) | [inline] |
Mark EMData as changed, statistics, etc will be updated at need.
Definition at line 136 of file emdata_metadata.h.
Referenced by set_data(), and EMAN::Util::TwoDTestFunc().
void 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 | |||
) |
Dump the image pixel data in native byte order to a disk file.
fsp | The filename to write the image data to | |
loc | Location to seek to in the file before writing (size_t) | |
area | The image region you want to read, default 0 means read the whole image | |
file_nx | Image x size. | |
file_ny | Image y size. | |
file_nz | Image z size. |