EMAN2
|
Go to the source code of this file.
Functions | |
EMData * | copy () const |
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 * | copy_head () const |
Make an image with a copy of the current image's header. More... | |
void | add (float f, int keepzero=0) |
add a number to each pixel value of the image. More... | |
void | add (const EMData &image) |
add a same-size image to this image pixel by pixel. More... | |
void | addsquare (const EMData &image) |
add the squared value of each pixel from a same-size image to this image. More... | |
void | sub (float f) |
subtract a float number to each pixel value of the image. More... | |
void | sub (const EMData &image) |
subtract a same-size image from this image pixel by pixel. More... | |
void | subsquare (const EMData &image) |
subtract the squared value of each pixel from a same-size image to this image. More... | |
void | mult (int n) |
multiply an integer number to each pixel value of the image. More... | |
void | mult (float f) |
multiply a float number to each pixel value of the image. More... | |
void | mult (const EMData &image, bool prevent_complex_multiplication=false) |
multiply each pixel of this image with each pixel of some other same-size image. More... | |
void | mult_ri (const EMData &image) |
multiply each complex RI pixel of this image with each pixel of some other same-size image. More... | |
void | mult_complex_efficient (const EMData &em, const int radius) |
void | div (float f) |
make each pixel value divided by a float number. More... | |
void | div (const EMData &image) |
make each pixel value divided by pixel value of another same-size image. More... | |
void | update_min (const EMData &image) |
Replaces the value of each pixel with the minimum of the current value and the value in the provided image. More... | |
void | to_zero () |
Set all the pixel value = 0. More... | |
void | to_one () |
set all the pixel values = 1. More... | |
void | to_value (const float &value) |
set all the pixel values to a value. More... | |
float | dot (EMData *with) |
Dot product 2 images. More... | |
EMData * | get_row (int row_index) const |
Get one row of a 1D/2D image. More... | |
void | set_row (const EMData *data, int row_index) |
Set one row of a 1D/2D image. More... | |
EMData * | get_col (int col_index) const |
Get one column of a 2D images. More... | |
void | set_col (const EMData *data, int col_index) |
Set one column of a 2D image. More... | |
float | get_value_at (int x, int y, int z) const |
Get the pixel density value at coordinates (x,y,z). More... | |
float | get_value_at_index (size_t i) const |
Get the pixel density value at index i. More... | |
float | get_value_at (int x, int y) const |
Get the pixel density value at coordinates (x,y). More... | |
float | get_value_at (size_t i) const |
Get the pixel density value given an index 'i' assuming the pixles are stored in a 1D array. More... | |
std::complex< float > | get_complex_at (const int &x, const int &y) const |
Get complex<float> value at x,y. More... | |
std::complex< float > | get_complex_at (const int &x, const int &y, const int &z) const |
Get complex<float> value at x,y,z. More... | |
size_t | get_complex_index (const int &x, const int &y, const int &z) const |
Get complex<float> index for coords x,y,z. More... | |
size_t | get_complex_index (int x, int y, int z, const int &subx0, const int &suby0, const int &subz0, const int &fullnx, const int &fullny, const int &fullnz) const |
size_t | get_complex_index_fast (const int &x, const int &y, const int &z) const |
void | set_complex_at_idx (const int &x, const int &y, const int &z, const std::complex< float > &val) |
Set complex<float> value at x,y,z without reinterpreting the coordinates. More... | |
void | set_complex_at (const int &x, const int &y, const std::complex< float > &val) |
Set complex<float> value at x,y. More... | |
void | set_complex_at (const int &x, const int &y, const int &z, const std::complex< float > &val) |
Set complex<float> value at x,y,z. More... | |
size_t | add_complex_at (const int &x, const int &y, const int &z, const std::complex< float > &val) |
Add complex<float> value at x,y,z. More... | |
size_t | add_complex_at_fast (const int &x, const int &y, const int &z, const std::complex< float > &val) |
size_t | add_complex_at (int x, int y, int z, const int &subx0, const int &suby0, const int &subz0, const int &fullnx, const int &fullny, const int &fullnz, const std::complex< float > &val) |
Add complex<float> value at x,y,z assuming that 'this' is a subvolume from a larger virtual volume. More... | |
float | get_value_at_wrap (int x, int y, int z) const |
Get the pixel density value at coordinates (x,y,z). More... | |
float | get_value_at_wrap (int x, int y) const |
Get the pixel density value at coordinates (x,y). More... | |
float | get_value_at_wrap (int x) const |
Get the pixel density value at coordinates (x). More... | |
float | sget_value_at (Vec3i v) |
Vec3i version of save routines below. More... | |
float | sget_value_at (int x, int y, int z) const |
A safer, slower way to get the pixel density value at coordinates (x,y,z). More... | |
float | sget_value_at (int x, int y) const |
A safer, slower way to get the pixel density value at coordinates (x,y). More... | |
float | sget_value_at (size_t i) const |
A safer, slower way to get the pixel density value given an index 'i' assuming the pixles are stored in a 1D array. More... | |
std::complex< float > | get_complex_at_interp (float x, float y) const |
Gets bilinear interpolated complex values. More... | |
std::complex< float > | get_complex_at_ginterp (float x, float y) const |
Gets 2x2 Gaussian interpolated complex values note that with Gaussian interpolation, there is a discontinuity in the interpolated values as you shift from one set of 2x2 samples to the next. More... | |
std::complex< float > | get_complex_at_3ginterp (float x, float y) const |
Gets 3x3 Gaussian interpolated complex values note that with Gaussian interpolation, there is a discontinuity in the interpolated values as you shift from one set of 3x3 samples to the next. More... | |
float | sget_value_at_interp (float x, float y) const |
Get pixel density value at interpolation of (x,y). More... | |
float | sget_value_at_interp (float x, float y, float z) const |
Get the pixel density value at interpolation of (x,y,z). More... | |
void | set_value_at (Vec3i loc, float val) |
set_value_at with Vec3i More... | |
void | set_value_at (int x, int y, int z, float v) |
Set the pixel density value at coordinates (x,y,z). More... | |
void | mult_value_at_fast (int x, int y, int z, float v) |
Multiplies the pixel density value at coordinates (x,y,z). More... | |
void | set_value_at_fast (int x, int y, int z, float v) |
Set the pixel density value at coordinates (x,y,z). More... | |
void | set_value_at_index (size_t i, float v) |
Set the pixel density value at index. More... | |
void | set_value_at (int x, int y, float v) |
Set the pixel density value at coordinates (x,y). More... | |
void | set_value_at_fast (int x, int y, float v) |
Set the pixel density value at coordinates (x,y). More... | |
void | set_value_at (int x, float v) |
Set the pixel density value at coordinate (x). More... | |
void | set_value_at_fast (int x, float v) |
Set the pixel density value at coordinate (x). More... | |
void | free_memory () |
Free memory associated with this EMData Called in destructor and in assignment operator. More... | |
void | free_rdata () |
Free rdata memory associated with this EMData Called in CUDA. More... | |
EMData & | operator+= (float n) |
EMData & | operator-= (float n) |
EMData & | operator*= (float n) |
EMData & | operator/= (float n) |
EMData & | operator+= (const EMData &em) |
EMData & | operator-= (const EMData &em) |
EMData & | operator*= (const EMData &em) |
EMData & | operator/= (const EMData &em) |
bool | operator== (const EMData &that) const |
bool | equal (const EMData &that) const |
compare the equality of two EMData object based on their pixel values More... | |
float & | operator() (const int ix, const int iy, const int iz) const |
Overload operator() for array indexing. More... | |
float & | operator() (const int ix, const int iy) const |
float & | operator() (const size_t ix) const |
void | set_array_offsets (const int xoff_=0, const int yoff_=0, const int zoff_=0) |
Set the array offsets. More... | |
void | set_array_offsets (vector< int > offsets) |
vector< int > | get_array_offsets () |
std::complex< float > & | cmplx (const int ix, const int iy, const int iz) |
Return reference to complex elements. More... | |
std::complex< float > & | cmplx (const int ix, const int iy) |
std::complex< float > & | cmplx (const int ix) |
EMData * | power (int n) const |
return a image to the power of n More... | |
EMData * | sqrt () const |
return square root of current image More... | |
EMData * | log () const |
return natural logarithm image for a image More... | |
EMData * | log10 () const |
return base 10 logarithm image for a image More... | |
EMData * | real () const |
return real part of a complex image as a real image format, if this image is a real image, return a copy of this image. More... | |
EMData * | imag () const |
return imaginary part of a complex image as a real image format. More... | |
EMData * | absi () const |
For a real image, it returns a same size image with abs() of each pixel. More... | |
EMData * | amplitude () const |
return amplitude part of a complex image as a real image format More... | |
EMData * | phase () const |
return phase part of a complex image as a real image format More... | |
EMData * | real2complex (float img=0.0f) const |
create a complex image from a real image, this complex image is in real/imaginary format More... | |
EMData * EMData::absi | ( | ) | const |
For a real image, it returns a same size image with abs() of each pixel.
For a complex image, it returns a image in size (nx/2,ny,nz), the pixel value output[i]=sqrt(input[i]*input[i]+input[i+1]*input[i+1])
InvalidCallException | this function call require a complex image in real/imaginary format. |
Definition at line 1268 of file emdata_core.cpp.
References copy(), EMAN::EMData::EMData(), ENTERFUNC, EXITFUNC, get_data(), get_xsize(), get_ysize(), get_zsize(), InvalidCallException, is_real(), is_ri(), EMAN::EMData::nx, EMAN::EMData::ny, EMAN::EMData::nz, and sqrt().
void add | ( | const EMData & | image | ) |
add a same-size image to this image pixel by pixel.
image | The image added to 'this' image. |
ImageFormatException | If the 2 images are not same size. |
void add | ( | float | f, |
int | keepzero = 0 |
||
) |
add a number to each pixel value of the image.
Image may be real or complex.
f | The number added to 'this' image. |
keepzero | If set will not modify pixels that are exactly zero |
size_t EMData::add_complex_at | ( | const int & | x, |
const int & | y, | ||
const int & | z, | ||
const std::complex< float > & | val | ||
) |
Add complex<float> value at x,y,z.
This assumes the image is a standard real/imaginary image with the complex origin in the first memory location. If you take the fft of a real nx x ny x nz image, a nx+2 x ny x nz image will be produced, and values using this function can go from -nx/2 to nx/2 and -ny/2 to ny/2. It will automatically deal with wraparound and complex conjugate issues for -x. It will return the index into the float array at which the complex began, or nx*ny*nz if out of range
x | x coordinate |
y | y coordinate |
z | z coordinate |
val | complex<float> value to set |
Definition at line 251 of file emdata_core.cpp.
References EMAN::EMData::nx, EMAN::EMData::nxy, EMAN::EMData::nxyz, EMAN::EMData::ny, EMAN::EMData::nz, EMAN::EMData::rdata, x, and y.
size_t EMData::add_complex_at | ( | int | x, |
int | y, | ||
int | z, | ||
const int & | subx0, | ||
const int & | suby0, | ||
const int & | subz0, | ||
const int & | fullnx, | ||
const int & | fullny, | ||
const int & | fullnz, | ||
const std::complex< float > & | val | ||
) |
Add complex<float> value at x,y,z assuming that 'this' is a subvolume from a larger virtual volume.
Requires that parameters often stored in the header as: subvolume_x0,y0,z0 and subvolume_full_nx,ny,nz be passed in as parameters. Otherwise similar to add_complex_at. It will return the index into the subvolume float array at which the complex began, or nx*ny*nz if out of range
x | x coordinate |
y | y coordinate |
z | z coordinate |
val | complex<float> value to set |
Definition at line 297 of file emdata_core.cpp.
References EMAN::EMData::nx, EMAN::EMData::nxyz, EMAN::EMData::ny, EMAN::EMData::nz, EMAN::EMData::rdata, x, and y.
|
inline |
Definition at line 368 of file emdata_core.h.
void addsquare | ( | const EMData & | image | ) |
add the squared value of each pixel from a same-size image to this image.
image | The image whose square is added to 'this' image. |
ImageFormatException | If the 2 images are not same size. |
EMData * amplitude | ( | ) | const |
return amplitude part of a complex image as a real image format
InvalidCallException | if this image is a real image or is in real/imaginary format |
std::complex< float > & cmplx | ( | const int | ix | ) |
Definition at line 803 of file emdata_core.h.
References get_data(), and OutofRangeException.
std::complex< float > & cmplx | ( | const int | ix, |
const int | iy | ||
) |
std::complex< float > & cmplx | ( | const int | ix, |
const int | iy, | ||
const int | iz | ||
) |
Return reference to complex elements.
Definition at line 781 of file emdata_core.h.
References get_data(), and OutofRangeException.
Referenced by EMAN::EMData::cconj().
EMData * copy | ( | ) | const |
This file is a part of "emdata.h", to use functions in this file, you should "#include "emdata.h", NEVER directly include this file.
Make a copy of this image including both data and header.
Referenced by absi(), EMAN::CtfWtAverager::add_image(), EMAN::CtfWtFiltAverager::add_image(), EMAN::CtfCAutoAverager::add_image(), EMAN::CtfCWautoAverager::add_image(), EMAN::EMData::calc_flcf(), EMAN::Transform::detect_problem_keys(), EMAN::Dict::Dict(), do_fft(), EMAN::EMData::do_radon(), get_attr(), get_data_as_vector(), log(), log10(), EMAN::Dict::operator=(), EMAN::FloatPoint::operator=(), power(), EMAN::RotateInFSProcessor::process(), EMAN::CircularAverageBinarizeProcessor::process(), EMAN::ObjDensityProcessor::process(), EMAN::ObjLabelProcessor::process(), EMAN::BwThinningProcessor::process(), EMAN::PruneSkeletonProcessor::process(), EMAN::GrowSkeletonProcessor::process(), EMAN::MedianShrinkProcessor::process_inplace(), EMAN::RotateInFSProcessor::process_inplace(), EMAN::BwThinningProcessor::process_inplace(), sqrt(), EMAN::MrcIO::transpose(), EMAN::SpiderIO::write_single_header(), EMAN::RT3DGridAligner::xform_align_nbest(), EMAN::RT3DSphereAligner::xform_align_nbest(), and EMAN::RT3DSymmetryAligner::xform_align_nbest().
EMData * EMData::copy_head | ( | ) | const |
Make an image with a copy of the current image's header.
Definition at line 100 of file emdata_core.cpp.
References EMAN::EMData::all_translation, EMAN::EMData::attr_dict, EMAN::EMData::EMData(), ENTERFUNC, EXITFUNC, EMAN::EMData::flags, EMAN::EMData::nx, EMAN::EMData::ny, EMAN::EMData::nz, EMAN::EMData::path, and EMAN::EMData::pathnum.
Referenced by do_fft(), do_ift(), get_fft_amplitude(), get_fft_amplitude2D(), get_fft_phase(), and EMAN::EMData::little_big_dot().
void div | ( | const EMData & | image | ) |
make each pixel value divided by pixel value of another same-size image.
image | The image 'this' image divided by. |
ImageFormatException | If the 2 images are not same size. |
void EMData::div | ( | float | f | ) |
make each pixel value divided by a float number.
f | The float number 'this' image divided by. |
Definition at line 655 of file emdata_core.cpp.
References ENTERFUNC, EXITFUNC, InvalidValueException, and mult().
Referenced by EMAN::Util::calc_least_square_fit(), EMAN::EMAN2Ctf::compute_1d(), and EMAN::AmpMultProcessor::process_inplace().
float dot | ( | EMData * | with | ) |
Dot product 2 images.
The 2 images must be of same size. If 'evenonly' is true, only calculates pixels with even positions assuming all pixels are in a single array. If 'evenonly' is false, calculates all pixels. Shortcut for cmp("dot")
with | The image to do dot product with. |
NullPointerException | if with is a NULL image. |
bool equal | ( | const EMData & | that | ) | const |
compare the equality of two EMData object based on their pixel values
void free_memory | ( | ) |
Free memory associated with this EMData Called in destructor and in assignment operator.
Referenced by EMAN::EMData::operator=(), and EMAN::EMData::~EMData().
void EMData::free_rdata | ( | ) |
Free rdata memory associated with this EMData Called in CUDA.
Definition at line 79 of file emdata_core.cpp.
References EMAN::EMUtil::em_free(), ENTERFUNC, EXITFUNC, and EMAN::EMData::rdata.
vector< int > get_array_offsets | ( | ) |
Definition at line 771 of file emdata_core.h.
EMData * EMData::get_col | ( | int | col_index | ) | const |
Get one column of a 2D images.
col_index | Index of the column. |
ImageDimensionException | If this image is not 2D. |
Definition at line 780 of file emdata_core.cpp.
References EMAN::EMData::EMData(), ENTERFUNC, EXITFUNC, get_data(), get_ndim(), ImageDimensionException, EMAN::EMData::nx, and EMAN::EMData::ny.
std::complex< float > EMData::get_complex_at | ( | const int & | x, |
const int & | y | ||
) | const |
Get complex<float> value at x,y.
This assumes the image is a standard real/imaginary image with the complex origin in the first memory location. If you take the fft of a real nx x ny image, a nx+2 x ny image will be produced, and values using this function can go from -nx/2-1 to nx/2+1 and -ny/2 to ny/2. It will automatically deal with wraparound and complex conjugate issues for -x. This function differs from cmplx() which will interpret x,y directly as pixel coordinates
x | x coordinate |
y | y coordinate |
Definition at line 126 of file emdata_core.cpp.
References EMAN::EMData::nx, EMAN::EMData::ny, EMAN::EMData::rdata, x, and y.
Referenced by EMAN::CtfWtFiltAverager::finish(), get_complex_at_3ginterp(), get_complex_at_ginterp(), and get_complex_at_interp().
std::complex< float > EMData::get_complex_at | ( | const int & | x, |
const int & | y, | ||
const int & | z | ||
) | const |
Get complex<float> value at x,y,z.
This assumes the image is a standard real/imaginary image with the complex origin in the first memory location. If you take the fft of a real nx x ny x nz image, a nx+2 x ny x nz image will be produced, and values using this function can go from -nx/2 to nx/2 and -ny/2 to ny/2. It will automatically deal with wraparound and complex conjugate issues for -x. This function differs from cmplx() which will interpret x,y directly as pixel coordinates
x | x coordinate |
y | y coordinate |
z | z coordinate |
Definition at line 134 of file emdata_core.cpp.
References EMAN::EMData::nx, EMAN::EMData::nxy, EMAN::EMData::ny, EMAN::EMData::nz, EMAN::EMData::rdata, x, and y.
std::complex< float > EMData::get_complex_at_3ginterp | ( | float | x, |
float | y | ||
) | const |
Gets 3x3 Gaussian interpolated complex values note that with Gaussian interpolation, there is a discontinuity in the interpolated values as you shift from one set of 3x3 samples to the next.
x | The x coordinate (float). |
y | The y coordinate (float). |
Definition at line 954 of file emdata_core.cpp.
References EMAN::Util::fast_floor(), EMAN::Util::gauss3_interpolate_cmplx(), get_complex_at(), x, and y.
std::complex< float > EMData::get_complex_at_ginterp | ( | float | x, |
float | y | ||
) | const |
Gets 2x2 Gaussian interpolated complex values note that with Gaussian interpolation, there is a discontinuity in the interpolated values as you shift from one set of 2x2 samples to the next.
This is at the ~5% level
x | The x coordinate (float). |
y | The y coordinate (float). |
Definition at line 941 of file emdata_core.cpp.
References EMAN::Util::fast_floor(), EMAN::Util::gauss_interpolate_cmplx(), get_complex_at(), x, and y.
std::complex< float > EMData::get_complex_at_interp | ( | float | x, |
float | y | ||
) | const |
Gets bilinear interpolated complex values.
x | The x coordinate (float). |
y | The y coordinate (float). |
Definition at line 928 of file emdata_core.cpp.
References EMAN::Util::bilinear_interpolate_cmplx(), EMAN::Util::fast_floor(), get_complex_at(), x, and y.
size_t EMData::get_complex_index | ( | const int & | x, |
const int & | y, | ||
const int & | z | ||
) | const |
Get complex<float> index for coords x,y,z.
This assumes the image is a standard real/imaginary image with the complex origin in the first memory location. If you take the fft of a real nx x ny x nz image, a nx+2 x ny x nz image will be produced, and values using this function can go from -nx/2 to nx/2 and -ny/2 to ny/2. It will automatically deal with wraparound and complex conjugate issues for -x. Note that if a pixel is accessed at this location, a complex conjugate may be required if x<0, and this fact is not returned.
x | x coordinate |
y | y coordinate |
z | z coordinate |
Definition at line 146 of file emdata_core.cpp.
References EMAN::EMData::nx, EMAN::EMData::nxy, EMAN::EMData::nxyz, EMAN::EMData::ny, EMAN::EMData::nz, x, and y.
size_t EMData::get_complex_index | ( | int | x, |
int | y, | ||
int | z, | ||
const int & | subx0, | ||
const int & | suby0, | ||
const int & | subz0, | ||
const int & | fullnx, | ||
const int & | fullny, | ||
const int & | fullnz | ||
) | const |
Definition at line 154 of file emdata_core.cpp.
References EMAN::EMData::nx, EMAN::EMData::nxyz, EMAN::EMData::ny, EMAN::EMData::nz, x, and y.
|
inline |
Definition at line 302 of file emdata_core.h.
EMData * EMData::get_row | ( | int | row_index | ) | const |
Get one row of a 1D/2D image.
row_index | Index of the row. |
ImageDimensionException | If this image is 3D. |
Definition at line 745 of file emdata_core.cpp.
References EMAN::EMData::EMData(), ENTERFUNC, EXITFUNC, get_data(), get_ndim(), ImageDimensionException, and EMAN::EMData::nx.
|
inline |
Get the pixel density value at coordinates (x,y).
2D only. The validity of x, y is not checked.
x | The x coordinate. |
y | The y coordinate. |
Definition at line 241 of file emdata_core.h.
References get_data(), x, and y.
|
inline |
Get the pixel density value at coordinates (x,y,z).
The validity of x, y, and z is not checked.
x | The x coordinate. |
y | The y coordinate. |
z | The z coordinate. |
Definition at line 221 of file emdata_core.h.
References get_data(), x, and y.
Referenced by bispecRotTransInvDirect(), bispecRotTransInvN(), EMAN::EMData::common_lines(), find_pixels_with_value(), get_attr(), EMAN::RotateInFSProcessor::process_inplace(), EMAN::ObjLabelProcessor::process_inplace(), and EMAN::Util::svdcmp().
|
inline |
Get the pixel density value given an index 'i' assuming the pixles are stored in a 1D array.
The validity of i is not checked.
i | 1D data array index. |
Definition at line 254 of file emdata_core.h.
References get_data().
|
inline |
Get the pixel density value at index i.
a | The index. |
Definition at line 229 of file emdata_core.h.
References rdata.
float & get_value_at_wrap | ( | int | x | ) | const |
Get the pixel density value at coordinates (x).
Should only be called on 1D images - no errors are thrown Wraps pixel values if they are negative - i.e. is circulant For example, if x = -1, then the pixel at nx-1 is returned
x | The x coordinate. |
Definition at line 825 of file emdata_core.cpp.
References get_data(), EMAN::EMData::nx, and x.
float & get_value_at_wrap | ( | int | x, |
int | y | ||
) | const |
Get the pixel density value at coordinates (x,y).
Should only be called on 2D images - no errors are thrown Wraps pixel values if they are negative - i.e. is circulant For example, if x = -1, then the pixel at nx-1 is returned
x | The x coordinate. |
y | The y coordinate. |
Definition at line 831 of file emdata_core.cpp.
References get_data(), EMAN::EMData::nx, EMAN::EMData::ny, x, and y.
float & get_value_at_wrap | ( | int | x, |
int | y, | ||
int | z | ||
) | const |
Get the pixel density value at coordinates (x,y,z).
Should only be called on 3D images - no errors are thrown Wraps pixel values if they are negative - i.e. is circulant For example, if x = -1, then the pixel at nx-1 is returned
x | The x coordinate. |
y | The y coordinate. |
z | The z coordinate. |
Definition at line 839 of file emdata_core.cpp.
References get_data(), get_value_at_wrap_cuda(), EMAN::EMData::nx, EMAN::EMData::nxy, EMAN::EMData::ny, EMAN::EMData::nz, x, and y.
Referenced by calc_max_location_wrap(), calc_max_location_wrap_intp(), EMAN::EMData::compute_missingwedge(), and EMAN::EMData::zero_corner_circulant().
EMData * imag | ( | ) | const |
return imaginary part of a complex image as a real image format.
InvalidCallException | if this image is a real image |
InvalidCallException | if this image is a complex image in amplitude/phase format |
EMData * EMData::log | ( | ) | const |
return natural logarithm image for a image
InvalidValueException | pixel value must be >= 0 |
ImageFormatException | real image only |
Definition at line 1114 of file emdata_core.cpp.
References copy(), ENTERFUNC, EXITFUNC, get_data(), ImageFormatException, InvalidValueException, is_complex(), log(), and EMAN::EMData::nxyz.
Referenced by EMAN::LowpassAutoBProcessor::create_radial_func(), EMAN::LocalWeightAverager::finish(), EMAN::Randnum::get_gauss_rand(), EMAN::EMUtil::getRenderMinMax(), log(), EMAN::Util::log_2(), EMAN::PointArray::pdb2mrc_by_summation(), EMAN::PointArray::projection_by_summation(), EMAN::PointArray::replace_by_summation(), and EMAN::PointArray::set_from_density_map().
EMData * EMData::log10 | ( | ) | const |
return base 10 logarithm image for a image
InvalidValueException | pixel value must be >= 0 |
ImageFormatException | real image only |
Definition at line 1144 of file emdata_core.cpp.
References copy(), ENTERFUNC, EXITFUNC, get_data(), ImageFormatException, InvalidValueException, is_complex(), log10(), and EMAN::EMData::nxyz.
Referenced by log10(), EMAN::SNRProcessor::process_inplace(), and EMAN::LogProcessor::process_pixel().
void mult | ( | const EMData & | image, |
bool | prevent_complex_multiplication = false |
||
) |
multiply each pixel of this image with each pixel of some other same-size image.
image | The image multiplied to 'this' image. |
prevent_complex_multiplication | if the image is complex, this flag will override complex multiplication and just multiply each pixel by the other |
ImageFormatException | If the 2 images are not same size. |
void mult | ( | float | f | ) |
multiply a float number to each pixel value of the image.
f | The float multiplied to 'this' image. |
void mult | ( | int | n | ) |
multiply an integer number to each pixel value of the image.
n | The integer multiplied to 'this' image. |
Definition at line 97 of file emdata_core.h.
References mult().
Referenced by div(), do_ift_inplace(), mult(), and EMAN::AmpMultProcessor::process_inplace().
void mult_complex_efficient | ( | const EMData & | em, |
const int | radius | ||
) |
void mult_ri | ( | const EMData & | image | ) |
multiply each complex RI pixel of this image with each pixel of some other same-size image.
No type checking. Images must both known to be complex RI checking for complex/ri is expensive!
image | The image multiplied to 'this' image. |
prevent_complex_multiplication | if the image is complex, this flag will override complex multiplication and just multiply each pixel by the other |
ImageFormatException | If the 2 images are not same size. |
|
inline |
Multiplies the pixel density value at coordinates (x,y,z).
The validity of x, y, and z is not checked. This implementation has no bounds checking.
x | The x coordinate. |
y | The y coordinate. |
z | The z coordinate. |
v | The pixel density value at coordinates (x,y,z). |
Definition at line 594 of file emdata_core.h.
References get_data(), update(), x, and y.
|
inline |
|
inline |
Overload operator() for array indexing.
Definition at line 727 of file emdata_core.h.
References get_data(), and OutofRangeException.
|
inline |
EMData & operator*= | ( | const EMData & | em | ) |
EMData & operator*= | ( | float | n | ) |
EMData & operator+= | ( | const EMData & | em | ) |
EMData & operator+= | ( | float | n | ) |
EMData & operator-= | ( | const EMData & | em | ) |
EMData & operator-= | ( | float | n | ) |
EMData & operator/= | ( | const EMData & | em | ) |
EMData & operator/= | ( | float | n | ) |
bool operator== | ( | const EMData & | that | ) | const |
EMData * EMData::phase | ( | ) | const |
return phase part of a complex image as a real image format
InvalidCallException | if this image is a real image or is in real/imaginary format |
Definition at line 1384 of file emdata_core.cpp.
References EMAN::EMData::EMData(), ENTERFUNC, EXITFUNC, get_data(), get_xsize(), get_ysize(), get_zsize(), InvalidCallException, is_real(), is_ri(), EMAN::EMData::nx, EMAN::EMData::ny, and EMAN::EMData::nz.
Referenced by EMAN::TestImageFourierNoiseGaussian::process_inplace(), EMAN::TestImageFourierNoiseProfile::process_inplace(), EMAN::TestImageSphericalWave::process_inplace(), EMAN::TestImageSinewave::process_inplace(), EMAN::TestImageSinewaveCircular::process_inplace(), EMAN::EMAN2Ctf::set_phase(), and EMAN::TransformProcessor::transform().
EMData * EMData::power | ( | int | n | ) | const |
return a image to the power of n
n | the power of this image |
InvalidValueException | n must be >= 0 |
Definition at line 1059 of file emdata_core.cpp.
References copy(), ENTERFUNC, EXITFUNC, and InvalidValueException.
Referenced by EMAN::FourierReconstructor::do_compare_slice_work(), and EMAN::WienerFourierReconstructor::do_compare_slice_work().
EMData * real | ( | ) | const |
return real part of a complex image as a real image format, if this image is a real image, return a copy of this image.
Referenced by EMAN::BispecSliceProcessor::process(), and EMAN::GridKernelFixProcessor::process_inplace().
EMData * EMData::real2complex | ( | float | img = 0.0f | ) | const |
create a complex image from a real image, this complex image is in real/imaginary format
img | give an artificial imaginary part |
InvalidCallException | this function can not be called by complex image |
Definition at line 1431 of file emdata_core.cpp.
References EMAN::EMData::EMData(), ENTERFUNC, EXITFUNC, get_xsize(), get_ysize(), get_zsize(), InvalidCallException, is_complex(), EMAN::EMData::nx, EMAN::EMData::ny, and EMAN::EMData::nz.
void set_array_offsets | ( | const int | xoff_ = 0 , |
const int | yoff_ = 0 , |
||
const int | zoff_ = 0 |
||
) |
Set the array offsets.
Definition at line 760 of file emdata_core.h.
Referenced by set_array_offsets().
void set_array_offsets | ( | vector< int > | offsets | ) |
Definition at line 766 of file emdata_core.h.
References set_array_offsets().
void set_col | ( | const EMData * | data, |
int | col_index | ||
) |
Set one column of a 2D image.
data | The column image data. |
col_index | Index of the column. |
ImageDimensionException | If this image is not 2D. |
void EMData::set_complex_at | ( | const int & | x, |
const int & | y, | ||
const int & | z, | ||
const std::complex< float > & | val | ||
) |
Set complex<float> value at x,y,z.
This assumes the image is a standard real/imaginary image with the complex origin in the first memory location. If you take the fft of a real nx x ny x nz image, a nx+2 x ny x nz image will be produced, and values using this function can go from -nx/2 to nx/2 and -ny/2 to ny/2. It will automatically deal with wraparound and complex conjugate issues for -x. This function differs from cmplx() which will interpret x,y directly as pixel coordinates
x | x coordinate |
y | y coordinate |
z | z coordinate |
val | complex<float> value to set |
Definition at line 208 of file emdata_core.cpp.
References EMAN::EMData::nx, EMAN::EMData::nxy, EMAN::EMData::ny, EMAN::EMData::nz, EMAN::EMData::rdata, x, and y.
void EMData::set_complex_at | ( | const int & | x, |
const int & | y, | ||
const std::complex< float > & | val | ||
) |
Set complex<float> value at x,y.
This assumes the image is a standard real/imaginary image with the complex origin in the first memory location. If you take the fft of a real nx x ny image, a nx+2 x ny image will be produced, and values using this function can go from -nx/2-1 to nx/2+1 and -ny/2 to ny/2. It will automatically deal with wraparound and complex conjugate issues for -x. This function differs from cmplx() which will interpret x,y directly as pixel coordinates
x | x coordinate |
y | y coordinate |
val | complex<float> value to set |
Definition at line 171 of file emdata_core.cpp.
References EMAN::EMData::nx, EMAN::EMData::ny, EMAN::EMData::rdata, x, and y.
|
inline |
Set complex<float> value at x,y,z without reinterpreting the coordinates.
That is, x=y=z=0 will be inserted in the first data element. The x coordinate is still multiplied by 2 to compensate for the complex being 2 floats.
x | x coordinate |
y | y coordinate |
z | z coordinate |
val | complex<float> value to set |
Definition at line 318 of file emdata_core.h.
void set_row | ( | const EMData * | data, |
int | row_index | ||
) |
Set one row of a 1D/2D image.
data | The row image data. |
row_index | Index of the row. |
ImageDimensionException | If this image is 3D. |
|
inline |
Set the pixel density value at coordinate (x).
1D image only.
x | The x coordinate. |
v | The pixel density value at coordinate (x). |
OutofRangeException | wehn index out of image data's range. |
Definition at line 674 of file emdata_core.h.
References get_data(), OutofRangeException, update(), and x.
|
inline |
Set the pixel density value at coordinates (x,y).
2D image only.
x | The x coordinate. |
y | The y coordinate. |
v | The pixel density value at coordinates (x,y). |
OutofRangeException | wehn index out of image data's range. |
Definition at line 634 of file emdata_core.h.
References get_data(), OutofRangeException, update(), x, and y.
|
inline |
Set the pixel density value at coordinates (x,y,z).
This implementation does bounds checking.
x | The x coordinate. |
y | The y coordinate. |
z | The z coordinate. |
v | The pixel density value at coordinates (x,y,z). |
OutofRangeException | wehn index out of image data's range. |
Definition at line 563 of file emdata_core.h.
References get_data(), OutofRangeException, update(), x, and y.
|
inline |
set_value_at with Vec3i
loc | location |
v | value |
Definition at line 552 of file emdata_core.h.
References set_value_at().
Referenced by bispecRotTransInvDirect(), bispecRotTransInvN(), EMAN::EMData::common_lines(), EMAN::RotateInFSProcessor::process_inplace(), and set_value_at().
|
inline |
Set the pixel density value at coordinate (x).
1D image only.
x | The x coordinate. |
v | The pixel density value at coordinate (x). |
Definition at line 694 of file emdata_core.h.
References get_data(), update(), and x.
|
inline |
Set the pixel density value at coordinates (x,y).
2D image only. The validity of x, y, is not checked.
x | The x coordinate. |
y | The y coordinate. |
v | The pixel density value at coordinates (x,y). |
Definition at line 660 of file emdata_core.h.
References get_data(), update(), x, and y.
|
inline |
Set the pixel density value at coordinates (x,y,z).
The validity of x, y, and z is not checked. This implementation has no bounds checking.
x | The x coordinate. |
y | The y coordinate. |
z | The z coordinate. |
v | The pixel density value at coordinates (x,y,z). |
Definition at line 609 of file emdata_core.h.
References get_data(), update(), x, and y.
|
inline |
Set the pixel density value at index.
i | The index. |
v | The value. |
Definition at line 621 of file emdata_core.h.
References rdata.
float EMData::sget_value_at | ( | int | x, |
int | y | ||
) | const |
A safer, slower way to get the pixel density value at coordinates (x,y).
2D only. The validity of x, y is checked. If the coordinates are out of range, return 0;
x | The x coordinate. |
y | The y coordinate. |
Definition at line 894 of file emdata_core.cpp.
References get_data(), EMAN::EMData::nx, EMAN::EMData::ny, x, and y.
float EMData::sget_value_at | ( | int | x, |
int | y, | ||
int | z | ||
) | const |
A safer, slower way to get the pixel density value at coordinates (x,y,z).
The validity of x, y, and z is checked. If the coordinates are out of range, return 0;
x | The x coordinate. |
y | The y coordinate. |
z | The z coordinate. |
Definition at line 885 of file emdata_core.cpp.
References get_data(), EMAN::EMData::nx, EMAN::EMData::nxy, EMAN::EMData::ny, EMAN::EMData::nz, x, and y.
float EMData::sget_value_at | ( | size_t | i | ) | const |
A safer, slower way to get the pixel density value given an index 'i' assuming the pixles are stored in a 1D array.
The validity of i is checked. If i is out of range, return 0;
i | 1D data array index. |
Definition at line 903 of file emdata_core.cpp.
References get_data(), EMAN::EMData::nx, EMAN::EMData::ny, and EMAN::EMData::nz.
|
inline |
Vec3i version of save routines below.
coord |
Definition at line 465 of file emdata_core.h.
References sget_value_at().
Referenced by sget_value_at(), and sget_value_at_interp().
float EMData::sget_value_at_interp | ( | float | x, |
float | y | ||
) | const |
Get pixel density value at interpolation of (x,y).
The validity of x, y is checked.2D image only.
x | The x coordinate. |
y | The y coordinate. |
Definition at line 914 of file emdata_core.cpp.
References EMAN::Util::bilinear_interpolate(), EMAN::Util::fast_floor(), sget_value_at(), x, and y.
Referenced by EMAN::EMData::get_rotated_clip().
float EMData::sget_value_at_interp | ( | float | x, |
float | y, | ||
float | z | ||
) | const |
Get the pixel density value at interpolation of (x,y,z).
The validity of x, y, and z is checked.
x | The x coordinate. |
y | The y coordinate. |
z | The z coordinate. |
Definition at line 970 of file emdata_core.cpp.
References EMAN::Util::fast_floor(), sget_value_at(), EMAN::Util::trilinear_interpolate(), x, and y.
EMData * EMData::sqrt | ( | ) | const |
return square root of current image
ImageFormatException | real image only |
Definition at line 1084 of file emdata_core.cpp.
References copy(), ENTERFUNC, EXITFUNC, get_data(), ImageFormatException, InvalidValueException, is_complex(), EMAN::EMData::nxyz, and sqrt().
Referenced by EMAN::Quaternion::abs(), absi(), EMAN::newfile_store::add_image(), EMAN::ShapeAnalyzer::analyze(), EMAN::EMData::apply_radial_func(), bispecRotTransInvDirect(), bispecRotTransInvN(), EMAN::EMAN1Ctf::calc_amp1(), EMAN::EMAN1Ctf::calc_amplitude(), EMAN::EMData::calc_ccfx(), EMAN::XYData::calc_correlation(), EMAN::EMData::calc_dist(), EMAN::EMAN1Ctf::calc_lambda(), EMAN::MaskEdgeMeanProcessor::calc_locals(), EMAN::EMData::calc_mutual_correlation(), EMAN::EMAN1Ctf::calc_noise(), EMAN::EMData::calc_radial_dist(), EMAN::NormalizeUnitProcessor::calc_sigma(), calc_sigma_diff(), EMAN::PointArray::calc_total_length(), EMAN::CccCmp::cmp(), EMAN::DotCmp::cmp(), EMAN::TomoCccCmp::cmp(), EMAN::TomoWedgeCccCmp::cmp(), EMAN::TomoWedgeFscCmp::cmp(), EMAN::TomoFscCmp::cmp(), EMAN::QuadMinDotCmp::cmp(), EMAN::EMData::common_lines(), EMAN::EMData::common_lines_real(), EMAN::EMAN1Ctf::compute_1d(), EMAN::EMData::compute_missingwedge(), EMAN::DoGFourierProcessor::create_radial_func(), EMAN::MatchSFProcessor::create_radial_func(), EMAN::SetSFProcessor::create_radial_func(), EMAN::Point3::distanceFromOrigin(), EMAN::Point3::distanceTo(), DistToLine(), EMAN::FourierReconstructor::do_compare_slice_work(), EMAN::WienerFourierReconstructor::do_compare_slice_work(), EMAN::ImageAverager::finish(), EMAN::LocalWeightAverager::finish(), EMAN::SigmaAverager::finish(), EMAN::nn4_ctfwReconstructor::finish(), EMAN::nn4_ctfwsReconstructor::finish(), EMAN::RealMedianReconstructor::finish(), EMAN::nnSSNR_Reconstructor::finish(), EMAN::nn4_ctfReconstructor::finish(), EMAN::nn4_ctf_rectReconstructor::finish(), EMAN::nnSSNR_ctfReconstructor::finish(), EMAN::PointArray::fit_helix(), EMAN::SaffOrientationGenerator::gen_orientations(), get_attr(), get_fft_amplitude2D(), EMAN::Randnum::get_gauss_rand(), EMAN::SaffOrientationGenerator::get_orientations_tally(), EMAN::Transform::get_rotation(), EMAN::Util::get_stats(), EMAN::Util::get_stats_cstyle(), EMAN::EMUtil::getRenderMinMax(), EMAN::Util::hypot3(), EMAN::FourierInserter3DMode9::insert_pixel(), EMAN::FourierInserter3DMode10::insert_pixel(), EMAN::nn4_rectReconstructor::insert_slice(), EMAN::GaussFFTProjector::interp_ft_3d(), EMAN::EMAN2Ctf::lambda(), EMAN::Vec4< Type >::length(), EMAN::Vec3< Type >::length(), EMAN::Vec2< Type >::length(), EMAN::ScreenVector::length(), EMAN::Vector3::length(), EMAN::Vector4::length(), EMAN::EMData::little_big_dot(), EMAN::PointArray::mask_asymmetric_unit(), EMAN::EMData::max_3D_pixel_error(), EMAN::Quaternion::normalize(), EMAN::Vector3::normalize(), EMAN::ReconstructorVolumeData::normalize_threed(), EMAN::PointArray::pdb2mrc_by_summation(), EMAN::FourierReconstructor::preprocess_slice(), EMAN::FourierIterReconstructor::preprocess_slice(), EMAN::BispecSliceProcessor::process(), EMAN::SubtractOptProcessor::process(), EMAN::ConvolutionKernelProcessor::process(), EMAN::MaskSoftProcessor::process_dist_pixel(), EMAN::MaskGaussProcessor::process_dist_pixel(), EMAN::MakeRadiusProcessor::process_dist_pixel(), EMAN::RadialProcessor::process_dist_pixel(), EMAN::FourierAnlProcessor::process_inplace(), EMAN::Axis0FourierProcessor::process_inplace(), EMAN::FFTPeakProcessor::process_inplace(), EMAN::BeamstopProcessor::process_inplace(), EMAN::NormalizeMaskProcessor::process_inplace(), EMAN::NormalizeRowProcessor::process_inplace(), EMAN::NormalizeToLeastSquareProcessor::process_inplace(), EMAN::AddRandomNoiseProcessor::process_inplace(), EMAN::PaintProcessor::process_inplace(), EMAN::SetIsoPowProcessor::process_inplace(), EMAN::SmartMaskProcessor::process_inplace(), EMAN::TestImagePureGaussian::process_inplace(), EMAN::TestImageFourierNoiseGaussian::process_inplace(), EMAN::TestImageFourierGaussianBand::process_inplace(), EMAN::TestImageFourierNoiseProfile::process_inplace(), EMAN::CTFSNRWeightProcessor::process_inplace(), EMAN::TestImageGaussian::process_inplace(), EMAN::TestImageSinewaveCircular::process_inplace(), EMAN::RotateInFSProcessor::process_inplace(), EMAN::BoxSigmaProcessor::process_pixel(), EMAN::MaskGaussNonuniformProcessor::process_pixel(), EMAN::PolyMaskProcessor::process_pixel(), EMAN::ValueSqrtProcessor::process_pixel(), EMAN::PointArray::projection_by_summation(), EMAN::Quaternion::Quaternion(), refalin3d_perturbquat(), EMAN::PointArray::replace_by_summation(), EMAN::PointArray::set_from_density_map(), sqrt(), EMAN::EMAN2Ctf::stos2(), EMAN::TransformProcessor::transform(), EMAN::EMData::unwrap_largerR(), EMAN::KMeansAnalyzer::update_centers(), EMAN::EMData::update_stat(), EMAN::MrcIO::update_stats(), EMAN::Util::windowdot(), EMAN::RT3DGridAligner::xform_align_nbest(), EMAN::RT3DSphereAligner::xform_align_nbest(), and EMAN::EMAN2Ctf::zero().
void sub | ( | const EMData & | image | ) |
subtract a same-size image from this image pixel by pixel.
image | The image subtracted from 'this' image. |
ImageFormatException | If the 2 images are not same size. |
void sub | ( | float | f | ) |
subtract a float number to each pixel value of the image.
f | The float number subtracted from 'this' image. |
Referenced by EMAN::FourierReconstructor::determine_slice_agreement(), EMAN::WienerFourierReconstructor::determine_slice_agreement(), EMAN::WienerFourierReconstructor::do_insert_slice_work(), EMAN::FourierReconstructor::setup(), EMAN::FourierReconstructor::setup_seed(), and EMAN::FourierReconstructor::setup_seedandweights().
void subsquare | ( | const EMData & | image | ) |
subtract the squared value of each pixel from a same-size image to this image.
image | The image whose square is subtracted from 'this' image. |
ImageFormatException | If the 2 images are not same size. |
void EMData::to_one | ( | ) |
set all the pixel values = 1.
Definition at line 1482 of file emdata_core.cpp.
References ENTERFUNC, EXITFUNC, is_complex(), set_ri(), to_value(), and update().
void EMData::to_value | ( | const float & | value | ) |
set all the pixel values to a value.
Definition at line 1498 of file emdata_core.cpp.
References ENTERFUNC, EXITFUNC, get_data(), get_size(), EMAN::EMData::nx, EMAN::EMData::ny, EMAN::EMData::nz, to_value_cuda(), and update().
void EMData::to_zero | ( | ) |
Set all the pixel value = 0.
Definition at line 1465 of file emdata_core.cpp.
References ENTERFUNC, EXITFUNC, is_complex(), set_ri(), to_value(), and update().
Referenced by EMAN::EMData::EMData(), and EMAN::IterAverager::finish().
void update_min | ( | const EMData & | image | ) |
Replaces the value of each pixel with the minimum of the current value and the value in the provided image.
An Averager can be used to do this across many images. This permits a strategy where the intermediate values are needed, not just the final minimum.
image | The image 'this' image divided by. |
ImageFormatException | If the 2 images are not same size. |