EMAN2
|
Go to the source code of this file.
Functions | |
EMData * | get_fft_amplitude () |
This file is a part of "emdata.h", to use functions in this file, you should "#include "emdata.h", NEVER directly include this file. More... | |
EMData * | get_fft_amplitude2D () |
return the amplitudes of the 2D FFT including the left half PRB More... | |
EMData * | get_fft_phase () |
return the phases of the FFT including the left half More... | |
float * | get_data () const |
Get the image pixel density data in a 1D float array. More... | |
const float * | get_const_data () const |
Get the image pixel density data in a 1D float array - const version of get_data. More... | |
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! More... | |
void | set_data (float *data) |
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. More... | |
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. More... | |
void | update () |
Mark EMData as changed, statistics, etc will be updated at need. More... | |
void | clearupdate () |
turn off updates. More... | |
bool | has_ctff () const |
check whether the image physical file has the CTF info or not. More... | |
float | calc_center_density () |
Calculates the density value at the peak of the image histogram, sort of like the mode of the density. More... | |
float | calc_sigma_diff () |
Calculates sigma above and below the mean and returns the difference between them. More... | |
IntPoint | calc_min_location () const |
Calculates the coordinates of the minimum-value pixel. More... | |
IntPoint | calc_max_location () const |
Calculates the coordinates of the maximum-value pixel. More... | |
IntPoint | calc_max_location_wrap (const int maxshiftx=-1, const int maxshifty=-1, const int maxshiftz=-1, float *value=0) |
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 If *value is provided, it will be set to the value at the max location. More... | |
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. More... | |
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) More... | |
size_t | calc_min_index () const |
Calculates the index of minimum-value pixel when assuming all pixels are in a 1D array. More... | |
size_t | calc_max_index () const |
Calculates the index of maximum-value pixel when assuming all pixels are in a 1D array. More... | |
vector< Pixel > | calc_highest_locations (float threshold) const |
Calculate and return a sorted list of pixels whose values are above a specified threshold. More... | |
vector< Pixel > | calc_n_highest_locations (int n) |
Calculate and return a sorted list of N highest pixels in the map. More... | |
vector< Pixel > | find_pixels_with_value (float val) |
Find pixels in the image with exactly the specified values. More... | |
float | get_edge_mean () const |
Calculates the mean pixel values around the (1 pixel) edge of the image. More... | |
float | get_circle_mean () |
Calculates the circular edge mean by applying a circular mask on 'this' image. More... | |
Ctf * | get_ctf () const |
Get ctf parameter of this image. More... | |
void | set_ctf (Ctf *ctf) |
Set the CTF parameter of this image. More... | |
Vec3f | get_translation () const |
Get 'this' image's translation vector from the original location. More... | |
void | set_translation (const Vec3f &t) |
Set 'this' images' translation vector from the original location. More... | |
void | set_translation (float dx, float dy, float dz) |
Set 'this' images' translation vector from the original location. More... | |
Transform | get_transform () const |
Get the 3D orientation of 'this' image. More... | |
void | set_rotation (float az, float alt, float phi) |
Define the 3D orientation of this particle, also used to indicate relative rotations for reconstructions. More... | |
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. More... | |
void | set_size (int nx, int ny=1, int nz=1, bool noalloc=false) |
Resize this EMData's main board memory pointer. More... | |
void | set_complex_size (int nx, int ny=1, int nz=1) |
Resize 'this' complex image. More... | |
void | set_path (const string &new_path) |
Set the path. More... | |
void | set_pathnum (int n) |
Set the number of paths. More... | |
MArray2D | get_2dview () const |
Get image raw pixel data in a 2D multi-array format. More... | |
MArray3D | get_3dview () const |
Get image raw pixel data in a 3D multi-array format. More... | |
MCArray2D | get_2dcview () const |
Get complex image raw pixel data in a 2D multi-array format. More... | |
MCArray3D | get_3dcview () const |
Get complex image raw pixel data in a 3D multi-array format. More... | |
EMObject | get_attr (const string &attr_name) const |
The generic way to get any image header information given a header attribute name. More... | |
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. More... | |
void | set_attr (const string &key, EMObject val) |
Set a header attribute's value. More... | |
void | set_attr_python (const string &key, EMObject val) |
Set a header attribute's value from Python. More... | |
bool | has_attr (const string &key) const |
Ask if the header has a particular attribute. More... | |
Dict | get_attr_dict () const |
Get the image attribute dictionary containing all the image attribute names and attribute values. More... | |
void | set_attr_dict (const Dict &new_dict) |
Merge the new values with the existing dictionary. More... | |
void | del_attr (const string &attr_name) |
Delete the attribute from dictionary. More... | |
void | del_attr_dict (const vector< string > &del_keys) |
Delete the attributes from the dictionary. More... | |
int | get_xsize () const |
Get the image x-dimensional size. More... | |
int | get_ysize () const |
Get the image y-dimensional size. More... | |
int | get_zsize () const |
Get the image z-dimensional size. More... | |
IntSize | get_sizes () const |
size_t | get_size () const |
Get the number of allocated floats in the image (nx*ny*nz) More... | |
vector< float > | get_data_as_vector () const |
Get the pixel data as a vector. More... | |
int | get_ndim () const |
Get image dimension. More... | |
bool | is_shuffled () const |
Has this image been shuffled? More... | |
bool | is_FH () const |
Is this a FH image? More... | |
bool | is_complex () const |
Is this a complex image? More... | |
bool | is_real () const |
Is this a real image? More... | |
void | set_shuffled (bool is_shuffled) |
Mark this image as a shuffled image. More... | |
void | set_FH (bool is_FH) |
Mark this complex image as a FH image. More... | |
void | set_complex (bool is_complex) |
Mark this image as a complex image. More... | |
bool | is_complex_x () const |
Is this image a 1D FFT image in X direction? More... | |
void | set_complex_x (bool is_complex_x) |
Marks this image a 1D FFT image in X direction. More... | |
bool | is_flipped () const |
Is this image flipped? More... | |
void | set_flipped (bool is_flipped) |
Mark this image as flipped. More... | |
bool | is_ri () const |
Is this image a real/imaginary format complex image? More... | |
void | set_ri (bool is_ri) |
Mark this image as a real/imaginary format complex image. More... | |
bool | is_fftpadded () const |
Is this image already extended along x for ffts? More... | |
void | set_fftpad (bool is_fftpadded) |
Mark this image as already extended along x for ffts. More... | |
bool | is_fftodd () const |
Does this image correspond to a (real-space) odd nx? More... | |
void | set_fftodd (bool is_fftodd) |
Mark this image as having (real-space) odd nx. More... | |
void | set_nxc (int nxc) |
Set the number of complex elements along x. More... | |
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) More... | |
string | get_path () const |
int | get_pathnum () const |
EMBytes | 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 % More... | |
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. More... | |
float EMData::calc_center_density | ( | ) |
Calculates the density value at the peak of the image histogram, sort of like the mode of the density.
Definition at line 251 of file emdata_metadata.cpp.
References ENTERFUNC, EXITFUNC, get_attr(), get_data(), EMAN::EMData::nx, EMAN::EMData::ny, and EMAN::EMData::nz.
FloatPoint EMData::calc_center_of_mass | ( | const float | threshold = 0 | ) |
Calculate the center of mass with a threshold (Default 0, so only positive values are considered)
Definition at line 572 of file emdata_metadata.cpp.
References get_data(), EMAN::EMData::nx, EMAN::EMData::nxy, EMAN::EMData::ny, and EMAN::EMData::nz.
vector< Pixel > EMData::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. |
Definition at line 620 of file emdata_metadata.cpp.
References ENTERFUNC, EXITFUNC, get_data(), is_complex(), is_ri(), EMAN::EMData::nx, EMAN::EMData::nxy, EMAN::EMData::ny, and EMAN::EMData::nz.
size_t EMData::calc_max_index | ( | ) | const |
Calculates the index of maximum-value pixel when assuming all pixels are in a 1D array.
Definition at line 612 of file emdata_metadata.cpp.
References calc_max_location(), EMAN::EMData::nx, and EMAN::EMData::ny.
IntPoint EMData::calc_max_location | ( | ) | const |
Calculates the coordinates of the maximum-value pixel.
Definition at line 363 of file emdata_metadata.cpp.
References ENTERFUNC, EXITFUNC, get_data(), is_complex(), is_ri(), EMAN::EMData::nx, EMAN::EMData::nxy, EMAN::EMData::ny, and EMAN::EMData::nz.
Referenced by calc_max_index().
IntPoint EMData::calc_max_location_wrap | ( | const int | maxshiftx = -1 , |
const int | maxshifty = -1 , |
||
const int | maxshiftz = -1 , |
||
float * | value = 0 |
||
) |
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 If *value is provided, it will be set to the value at the max location.
Definition at line 402 of file emdata_metadata.cpp.
References calc_max_location_wrap_cuda(), get_value_at_wrap(), get_xsize(), get_ysize(), get_zsize(), EMAN::EMData::nx, EMAN::EMData::ny, EMAN::EMData::nz, CudaPeakInfo::px, CudaPeakInfo::py, and CudaPeakInfo::pz.
vector< float > EMData::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.
#ifdef EMAN2_USING_CUDA //CUDA if(cudarwdata){
CudaPeakInfo* soln = calc_max_location_wrap_cuda(cudarwdata, nx, ny, nz, maxdx, maxdy, maxdz); peak[0] = soln->px; peak[1] = soln->py; peak[2] = soln->pz; free(soln);
cout << "x " << peak[0] << " y " << peak[1] << " z " << peak[2] << endl; return peak; } #endif
I guess I could use GSL, but this is faster.... float x1 = float(peak[0]) - 1.0f; float x2 = float(peak[0]); float x3 = float(peak[0]) + 1.0f; float y1 = float(peak[1]) - 1.0f; float y2 = float(peak[1]); float y3 = float(peak[1]) + 1.0f; float z1 = float(peak[2]) - 1.0f; float z2 = float(peak[2]); float z3 = float(peak[2]) + 1.0f;
float yx1 = get_value_at_wrap(x1,y2,z2); float yx2 = get_value_at_wrap(x2,y2,z2); float yx3 = get_value_at_wrap(x3,y2,z2); float yy1 = get_value_at_wrap(x2,y1,z2); float yy2 = get_value_at_wrap(x2,y2,z2); float yy3 = get_value_at_wrap(x2,y3,z2); float yz1 = get_value_at_wrap(x2,y2,z1); float yz2 = get_value_at_wrap(x2,y2,z2); float yz3 = get_value_at_wrap(x2,y2,z3);
Fit peak in X to y = ax^2 + bx +c float bx = ((yx1 - yx2)*(x2*x2 - x3*x3)/(x1*x1 - x2*x2) - (yx2-yx3))/(-(x2 - x3) + (x1 - x2)*(x2*x2 - x3*x3)/(x1*x1 - x2*x2)); float ax = ((yx1 - yx2) - bx*(x1 - x2))/(x1*x1 - x2*x2); Find minima float xintp = -bx/(2*ax);
Fit peak in X to y = ax^2 + bx +c float by = ((yy1 - yy2)*(x2*x2 - x3*x3)/(x1*x1 - x2*x2) - (yy2-yy3))/(-(x2 - x3) + (x1 - x2)*(x2*x2 - x3*x3)/(x1*x1 - x2*x2)); float ay = ((yy1 - yy2) - by*(x1 - x2))/(x1*x1 - x2*x2); Find minima float yintp = -by/(2*ay);
Fit peak in X to y = ax^2 + bx +c float bz = ((yz1 - yz2)*(x2*x2 - x3*x3)/(x1*x1 - x2*x2) - (yz2-yz3))/(-(x2 - x3) + (x1 - x2)*(x2*x2 - x3*x3)/(x1*x1 - x2*x2)); float az = ((yz1 - yz2) - bz*(x1 - x2))/(x1*x1 - x2*x2); Find minima float zintp = -bz/(2*az);
vector<float> mydata; mydata.push_back(xintp); mydata.push_back(yintp); mydata.push_back(zintp); mydata.push_back(max_value);
Definition at line 447 of file emdata_metadata.cpp.
References get_value_at_wrap(), get_xsize(), get_ysize(), get_zsize(), x, and y.
size_t EMData::calc_min_index | ( | ) | const |
Calculates the index of minimum-value pixel when assuming all pixels are in a 1D array.
Definition at line 604 of file emdata_metadata.cpp.
References calc_min_location(), EMAN::EMData::nx, and EMAN::EMData::ny.
IntPoint EMData::calc_min_location | ( | ) | const |
Calculates the coordinates of the minimum-value pixel.
Definition at line 325 of file emdata_metadata.cpp.
References ENTERFUNC, get_data(), is_complex(), is_ri(), EMAN::EMData::nx, EMAN::EMData::nxy, EMAN::EMData::ny, and EMAN::EMData::nz.
Referenced by calc_min_index().
vector< Pixel > EMData::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. |
Definition at line 656 of file emdata_metadata.cpp.
References ENTERFUNC, EXITFUNC, get_data(), is_complex(), is_ri(), EMAN::EMData::nx, EMAN::EMData::nxy, EMAN::EMData::ny, and EMAN::EMData::nz.
float EMData::calc_sigma_diff | ( | ) |
Calculates sigma above and below the mean and returns the difference between them.
Definition at line 288 of file emdata_metadata.cpp.
References ENTERFUNC, EXITFUNC, get_attr(), get_data(), EMAN::EMData::nx, EMAN::EMData::ny, EMAN::EMData::nz, sqrt(), and EMAN::Util::square().
|
inline |
turn off updates.
Useful to avoid wasteful recacling stats
Definition at line 149 of file emdata_metadata.h.
void EMData::del_attr | ( | const string & | attr_name | ) |
Delete the attribute from dictionary.
attr_name | the attribute name to be removed |
Definition at line 1200 of file emdata_metadata.cpp.
References EMAN::EMData::attr_dict, and EMAN::Dict::erase().
Referenced by del_attr_dict().
void EMData::del_attr_dict | ( | const vector< string > & | del_keys | ) |
Delete the attributes from the dictionary.
del_keys | the attrutes' names to be removed |
Definition at line 1205 of file emdata_metadata.cpp.
References del_attr().
vector< Pixel > EMData::find_pixels_with_value | ( | float | val | ) |
Find pixels in the image with exactly the specified values.
val | The value to look for |
Definition at line 693 of file emdata_metadata.cpp.
References ENTERFUNC, EXITFUNC, get_value_at(), ImageFormatException, is_complex(), EMAN::EMData::nx, EMAN::EMData::ny, and EMAN::EMData::nz.
MCArray2D EMData::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.
Definition at line 973 of file emdata_metadata.cpp.
References get_data(), get_ndim(), ImageDimensionException, EMAN::EMData::nx, and EMAN::EMData::ny.
MArray2D EMData::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.
Definition at line 952 of file emdata_metadata.cpp.
References get_data(), get_ndim(), ImageDimensionException, EMAN::EMData::nx, and EMAN::EMData::ny.
MCArray3D EMData::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.
Definition at line 986 of file emdata_metadata.cpp.
References get_data(), EMAN::EMData::nx, EMAN::EMData::ny, and EMAN::EMData::nz.
MArray3D EMData::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.
Definition at line 964 of file emdata_metadata.cpp.
References get_data(), EMAN::EMData::nx, EMAN::EMData::ny, and EMAN::EMData::nz.
float EMData::get_amplitude_thres | ( | float | thres | ) |
return the FFT amplitude which is greater than thres %
ImageFormatException | If the image is not a complex image. |
Definition at line 1326 of file emdata_metadata.cpp.
References get_fft_amplitude(), InvalidValueException, and LOGERR.
EMObject EMData::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 |
Definition at line 1006 of file emdata_metadata.cpp.
References EMAN::EMData::attr_dict, BadAllocException, EMAN::EMData::changecount, copy(), EMAN::EMData::EMDATA_NEEDUPD, ENTERFUNC, EXITFUNC, EMAN::EMData::flags, get_data(), get_value_at(), greaterthan(), EMAN::Dict::has_key(), EMAN::Util::hypot2sq(), EMAN::Util::hypot3sq(), ImageFormatException, is_complex(), NotExistingObjectException, EMAN::EMData::nx, EMAN::EMData::ny, EMAN::EMData::nz, sqrt(), EMAN::EMData::update_stat(), x, and y.
Referenced by calc_center_density(), EMAN::EMData::calc_hist(), calc_sigma_diff(), is_fftpadded(), is_FH(), is_flipped(), is_shuffled(), 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 |
Referenced by EMAN::EMData::calc_radial_dist(), and EMAN::KMeansAnalyzer::reclassify().
Dict EMData::get_attr_dict | ( | ) | const |
Get the image attribute dictionary containing all the image attribute names and attribute values.
Definition at line 1162 of file emdata_metadata.cpp.
References EMAN::EMData::attr_dict, EMAN::EMData::changecount, EMAN::EMData::nx, EMAN::EMData::ny, EMAN::EMData::nz, EMAN::EMData::rdata, and EMAN::EMData::update_stat().
|
inline |
Definition at line 915 of file emdata_metadata.h.
float EMData::get_circle_mean | ( | ) |
Calculates the circular edge mean by applying a circular mask on 'this' image.
Definition at line 773 of file emdata_metadata.cpp.
References EMAN::EMData::EMData(), ENTERFUNC, EXITFUNC, get_data(), EMAN::EMUtil::is_same_size(), EMAN::EMData::nx, EMAN::EMData::ny, and EMAN::EMData::nz.
|
inline |
Get the image pixel density data in a 1D float array - const version of get_data.
Definition at line 84 of file emdata_metadata.h.
References get_data().
Referenced by EMAN::EMData::unwrap().
Ctf * EMData::get_ctf | ( | ) | const |
Get ctf parameter of this image.
Definition at line 822 of file emdata_metadata.cpp.
References EMAN::EMData::attr_dict, EMAN::EMAN1Ctf::from_vector(), and EMAN::Dict::has_key().
|
inline |
Get the image pixel density data in a 1D float array.
Definition at line 78 of file emdata_metadata.h.
References rdata.
Referenced by absi(), EMAN::EMData::add_incoherent(), EMAN::EMData::apply_radial_func(), EMAN::EMData::calc_az_dist(), EMAN::EMData::calc_ccfx(), calc_center_density(), calc_center_of_mass(), EMAN::EMData::calc_dist(), calc_highest_locations(), EMAN::EMData::calc_hist(), calc_max_location(), calc_min_location(), calc_n_highest_locations(), EMAN::EMData::calc_radial_dist(), calc_sigma_diff(), EMAN::EMData::clip_inplace(), cmplx(), EMAN::EMData::common_lines(), EMAN::EMData::common_lines_real(), EMAN::EMData::cut_slice(), do_fft(), do_fft_inplace(), do_ift(), do_ift_inplace(), EMAN::EMData::dot_rotate_translate(), EMAN::EMData::extract_box(), get_2dcview(), get_2dview(), get_3dcview(), get_3dview(), get_attr(), get_circle_mean(), get_col(), get_const_data(), get_data_as_vector(), get_data_pickle(), get_edge_mean(), get_fft_amplitude(), get_fft_phase(), get_row(), EMAN::EMData::get_top_half(), get_value_at(), get_value_at_wrap(), EMAN::EMData::little_big_dot(), log(), log10(), mult_value_at_fast(), EMAN::EMData::oneDfftPolar(), operator()(), phase(), EMAN::OutlierProcessor::process_inplace(), read_binedimage(), render_amp24(), render_ap24(), ri2ap(), ri2inten(), EMAN::EMData::rotate_x(), set_data_pickle(), set_value_at(), set_value_at_fast(), EMAN::EMData::setup4slice(), sget_value_at(), sqrt(), to_value(), EMAN::EMData::uncut_slice(), EMAN::EMData::unwrap_largerR(), and EMAN::EMData::update_stat().
|
inline |
Get the pixel data as a vector.
Definition at line 585 of file emdata_metadata.h.
References copy(), get_data(), and get_size().
EMBytes EMData::get_data_pickle | ( | ) | const |
Definition at line 1294 of file emdata_metadata.cpp.
References get_data(), EMAN::EMData::nx, EMAN::EMData::ny, and EMAN::EMData::nz.
float EMData::get_edge_mean | ( | ) | const |
Calculates the mean pixel values around the (1 pixel) edge of the image.
Definition at line 713 of file emdata_metadata.cpp.
References ENTERFUNC, EXITFUNC, get_data(), get_edgemean_cuda(), EMAN::EMData::nx, EMAN::EMData::nxy, EMAN::EMData::ny, and EMAN::EMData::nz.
Referenced by EMAN::EMData::calc_fast_sigma_image(), and EMAN::EMData::make_rotational_footprint_e1().
EMData * EMData::get_fft_amplitude | ( | ) |
This file is a part of "emdata.h", to use functions in this file, you should "#include "emdata.h", NEVER directly include this file.
return the amplitudes of the FFT including the left half
ImageFormatException | If the image is not a complex image. |
Definition at line 91 of file emdata_metadata.cpp.
References copy_head(), ENTERFUNC, EXITFUNC, get_data(), get_ndim(), ImageFormatException, is_complex(), LOGERR, EMAN::EMData::nx, EMAN::EMData::ny, EMAN::EMData::nz, and ri2ap().
Referenced by get_amplitude_thres().
EMData * 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. |
Definition at line 50 of file emdata_metadata.cpp.
References copy_head(), ENTERFUNC, EXITFUNC, ImageFormatException, is_complex(), LOGERR, EMAN::EMData::nx, EMAN::EMData::ny, EMAN::EMData::nz, and sqrt().
EMData * EMData::get_fft_phase | ( | ) |
return the phases of the FFT including the left half
ImageFormatException | If the image is not a complex image. |
Definition at line 146 of file emdata_metadata.cpp.
References copy_head(), ENTERFUNC, EXITFUNC, get_data(), get_ndim(), ImageFormatException, is_complex(), LOGERR, EMAN::EMData::nx, EMAN::EMData::ny, EMAN::EMData::nz, and ri2ap().
|
inline |
Definition at line 905 of file emdata_metadata.h.
|
inline |
Get image dimension.
Definition at line 596 of file emdata_metadata.h.
Referenced by EMAN::EMData::apply_radial_func(), EMAN::EMData::calc_az_dist(), EMAN::EMData::calc_ccfx(), EMAN::EMData::calc_dist(), EMAN::EMData::calc_fast_sigma_image(), EMAN::EMData::cut_slice(), do_ift(), EMAN::EMData::do_radon(), EMAN::EMData::dot_rotate_translate(), get_2dcview(), get_2dview(), get_col(), get_fft_amplitude(), get_fft_phase(), get_row(), EMAN::EMData::get_top_half(), EMAN::EMData::little_big_dot(), render_amp24(), render_ap24(), EMAN::EMData::rotate_x(), EMAN::EMData::setup4slice(), EMAN::EMData::uncut_slice(), EMAN::EMData::unwrap(), and EMAN::EMData::window_center().
|
inline |
Definition at line 954 of file emdata_metadata.h.
|
inline |
Definition at line 959 of file emdata_metadata.h.
|
inline |
Get the number of allocated floats in the image (nx*ny*nz)
Definition at line 577 of file emdata_metadata.h.
Referenced by get_data_as_vector(), and to_value().
|
inline |
Definition at line 568 of file emdata_metadata.h.
References get_xsize(), get_ysize(), and get_zsize().
int EMData::get_supp_pickle | ( | ) | const |
Definition at line 1316 of file emdata_metadata.cpp.
|
inline |
Get the 3D orientation of 'this' image.
Definition at line 320 of file emdata_metadata.h.
|
inline |
Get 'this' image's translation vector from the original location.
Definition at line 289 of file emdata_metadata.h.
|
inline |
Definition at line 925 of file emdata_metadata.h.
|
inline |
Get the image x-dimensional size.
Definition at line 544 of file emdata_metadata.h.
Referenced by absi(), EMAN::KMeansAnalyzer::analyze(), bispecRotTransInvDirect(), bispecRotTransInvN(), calc_max_location_wrap(), calc_max_location_wrap_intp(), get_sizes(), EMAN::EMData::getResolution(), EMAN::EMData::make_footprint(), phase(), real2complex(), and EMAN::EMData::unwrap_largerR().
|
inline |
Definition at line 930 of file emdata_metadata.h.
|
inline |
Get the image y-dimensional size.
Definition at line 553 of file emdata_metadata.h.
Referenced by absi(), EMAN::KMeansAnalyzer::analyze(), calc_max_location_wrap(), calc_max_location_wrap_intp(), get_sizes(), phase(), EMAN::BispecSliceProcessor::process(), real2complex(), and EMAN::EMData::unwrap_largerR().
|
inline |
Definition at line 935 of file emdata_metadata.h.
|
inline |
Get the image z-dimensional size.
Definition at line 562 of file emdata_metadata.h.
Referenced by absi(), EMAN::KMeansAnalyzer::analyze(), calc_max_location_wrap(), calc_max_location_wrap_intp(), get_sizes(), phase(), and real2complex().
|
inline |
Ask if the header has a particular attribute.
key | the header attribute name |
Definition at line 498 of file emdata_metadata.h.
Referenced by has_ctff(), is_fftpadded(), is_FH(), is_shuffled(), and EMAN::KMeansAnalyzer::reseed().
|
inline |
check whether the image physical file has the CTF info or not.
Definition at line 158 of file emdata_metadata.h.
References has_attr().
|
inline |
Is this a complex image?
Definition at line 648 of file emdata_metadata.h.
Referenced by EMAN::EMData::add_incoherent(), EMAN::EMData::apply_radial_func(), EMAN::EMData::calc_az_dist(), EMAN::EMData::calc_ccf(), calc_highest_locations(), calc_max_location(), calc_min_location(), calc_n_highest_locations(), EMAN::EMData::calc_radial_dist(), EMAN::EMData::cconj(), EMAN::TomoWedgeCccCmp::cmp(), EMAN::TomoWedgeFscCmp::cmp(), EMAN::EMData::cut_slice(), do_fft(), do_fft_inplace(), do_ift(), do_ift_inplace(), find_pixels_with_value(), get_attr(), get_fft_amplitude(), get_fft_amplitude2D(), get_fft_phase(), is_real(), log(), log10(), EMAN::TestUtil::make_image_file_by_mode(), real2complex(), render_amp24(), render_ap24(), ri2ap(), ri2inten(), set_complex(), EMAN::EMData::setup4slice(), sqrt(), EMAN::MrcIO::to_mrcmode(), to_one(), to_zero(), EMAN::TransformProcessor::transform(), EMAN::EMData::uncut_slice(), EMAN::EMData::update_stat(), EMAN::TestUtil::verify_image_file_by_mode(), and EMAN::EMData::window_center().
|
inline |
Is this image a 1D FFT image in X direction?
Definition at line 727 of file emdata_metadata.h.
Referenced by EMAN::EMData::calc_ccfx(), and set_complex_x().
|
inline |
Does this image correspond to a (real-space) odd nx?
Definition at line 864 of file emdata_metadata.h.
Referenced by EMAN::EMData::cconj(), do_fft(), do_fft_inplace(), do_ift(), do_ift_inplace(), set_fftodd(), EMAN::FourierReconstructorSimple2D::setup(), EMAN::FourierReconstructor::setup(), EMAN::FourierReconstructor::setup_seed(), EMAN::FourierReconstructor::setup_seedandweights(), and EMAN::EMData::window_center().
|
inline |
Is this image already extended along x for ffts?
Definition at line 831 of file emdata_metadata.h.
References get_attr(), and has_attr().
Referenced by do_fft(), do_fft_inplace(), set_fftpad(), and EMAN::EMData::window_center().
|
inline |
Is this a FH image?
Definition at line 631 of file emdata_metadata.h.
References get_attr(), and has_attr().
Referenced by set_FH().
|
inline |
Is this image flipped?
Definition at line 761 of file emdata_metadata.h.
References get_attr().
Referenced by set_flipped().
|
inline |
Is this a real image?
Definition at line 667 of file emdata_metadata.h.
References is_complex().
Referenced by absi(), EMAN::EMData::convolute(), EMAN::EMData::EMData(), phase(), and EMAN::TransformProcessor::transform().
|
inline |
Is this image a real/imaginary format complex image?
Definition at line 797 of file emdata_metadata.h.
Referenced by absi(), EMAN::EMData::calc_az_dist(), calc_highest_locations(), calc_max_location(), calc_min_location(), calc_n_highest_locations(), EMAN::EMData::calc_radial_dist(), EMAN::EMData::cconj(), do_ift(), do_ift_inplace(), phase(), ri2ap(), ri2inten(), set_ri(), and EMAN::EMData::update_stat().
|
inline |
Has this image been shuffled?
Definition at line 614 of file emdata_metadata.h.
References get_attr(), and has_attr().
Referenced by set_shuffled().
vector< Vec3i > mask_contig_region | ( | const float & | val, |
const Vec3i & | seed | ||
) |
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 EMData::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)
Definition at line 1280 of file emdata_metadata.cpp.
References EMAN::Ctf::apix, EMAN::EMData::attr_dict, EMAN::Dict::has_key(), and EMAN::EMData::scale().
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(), EMAN::EMData::compute_missingwedge(), ri2inten(), set_fftodd(), set_fftpad(), set_FH(), set_flipped(), and set_shuffled().
void set_attr_dict | ( | const Dict & | new_dict | ) |
Merge the new values with the existing dictionary.
new_dict | The new attribute dictionary. |
|
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. |
|
inline |
Definition at line 920 of file emdata_metadata.h.
|
inline |
Mark this image as a complex image.
is_complex | If true, a complex image. If false, a real image. |
Definition at line 712 of file emdata_metadata.h.
References is_complex().
Referenced by do_fft_inplace(), do_ift_inplace(), and read_binedimage().
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 393 of file emdata_metadata.h.
References set_size().
|
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 747 of file emdata_metadata.h.
References is_complex_x().
Referenced by do_fft_inplace(), and do_ift_inplace().
void set_ctf | ( | Ctf * | ctf | ) |
Set the CTF parameter of this image.
ctf | The CTF parameter object. |
|
inline |
|
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 93 of file emdata_metadata.h.
void EMData::set_data_pickle | ( | std::string | vf | ) |
Definition at line 1307 of file emdata_metadata.cpp.
References EMAN::EMUtil::em_memcpy(), get_data(), EMAN::EMData::nx, EMAN::EMData::ny, and EMAN::EMData::nz.
|
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 882 of file emdata_metadata.h.
References is_fftodd(), and set_attr().
Referenced by do_fft_inplace(), and read_binedimage().
|
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 850 of file emdata_metadata.h.
References is_fftpadded(), and set_attr().
Referenced by do_fft_inplace(), do_ift_inplace(), and read_binedimage().
|
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 695 of file emdata_metadata.h.
References is_FH(), and set_attr().
|
inline |
Definition at line 910 of file emdata_metadata.h.
|
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 782 of file emdata_metadata.h.
References is_flipped(), and set_attr().
|
inline |
Set the number of complex elements along x.
nxc | is the number of complex elements along x. |
Definition at line 896 of file emdata_metadata.h.
|
inline |
|
inline |
Set the number of paths.
n | The number of paths. |
Definition at line 410 of file emdata_metadata.h.
|
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 817 of file emdata_metadata.h.
References is_ri().
Referenced by do_fft_inplace(), do_ift_inplace(), read_binedimage(), ri2ap(), to_one(), and to_zero().
|
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 356 of file emdata_metadata.h.
|
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 342 of file emdata_metadata.h.
|
inline |
Mark this image as a shuffled image.
is_shuffled | If true, a shuffled image. If false, not a shuffled image. |
Definition at line 677 of file emdata_metadata.h.
References is_shuffled(), and set_attr().
void set_size | ( | int | nx, |
int | ny = 1 , |
||
int | nz = 1 , |
||
bool | noalloc = false |
||
) |
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 bispecRotTransInvN(), EMAN::EMData::clip_inplace(), EMAN::EMData::common_lines(), EMAN::EMData::common_lines_real(), do_fft_inplace(), EMAN::EMData::EMData(), EMAN::EMData::operator=(), read_binedimage(), and set_complex_size().
void EMData::set_supp_pickle | ( | int | i | ) |
Definition at line 1321 of file emdata_metadata.cpp.
References EMAN::EMData::supp.
|
inline |
Set 'this' images' translation vector from the original location.
t | The new translation vector. |
Definition at line 299 of file emdata_metadata.h.
|
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 311 of file emdata_metadata.h.
|
inline |
|
inline |
Mark EMData as changed, statistics, etc will be updated at need.
Definition at line 138 of file emdata_metadata.h.
Referenced by EMAN::EMData::add_incoherent(), EMAN::EMData::apply_radial_func(), EMAN::EMData::clip_inplace(), EMAN::EMData::common_lines(), EMAN::EMData::common_lines_real(), EMAN::EMData::cut_slice(), do_fft_inplace(), do_ift_inplace(), EMAN::EMData::EMData(), mult_value_at_fast(), EMAN::RotateInFSProcessor::process_inplace(), read_binedimage(), ri2ap(), ri2inten(), EMAN::EMData::rotate_x(), set_data(), set_value_at(), set_value_at_fast(), to_one(), to_value(), to_zero(), and EMAN::EMData::unwrap_largerR().
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. |