EMAN2
|
EMData stores an image's data and defines core image processing routines. More...
#include <emdata.h>
Classes | |
class | ClipInplaceVariables |
Public Member Functions | |
EMData () | |
For all image I/O. More... | |
~EMData () | |
EMData (const string &filename, int image_index=0) | |
Construct from an image file. More... | |
EMData (int nx, int ny, int nz=1, bool is_real=true) | |
EMData (float *data, const int nx, const int ny, const int nz, const Dict &attr_dict=Dict()) | |
Construction from a data pointer, dimensions must be supplied. More... | |
EMData (float *data, float *cudadata, const int nx, const int ny, const int nz, const Dict &attr_dict=Dict()) | |
Construction from a data pointer for usage in cuda, dimensions must be supplied. More... | |
EMData (const EMData &that) | |
Construct from an EMData (copy constructor). More... | |
EMData & | operator= (const EMData &that) |
EMData assignment operator Performs a deep copy. More... | |
EMData * | get_clip (const Region &area, const float fill=0) const |
Get an inclusive clip. More... | |
void | clip_inplace (const Region &area, const float &fill_value=0) |
Clip the image inplace - clipping region must be smaller than the current region internally memory is reallocated. More... | |
EMData * | get_top_half () const |
Get the top half of this 3D image. More... | |
EMData * | get_rotated_clip (const Transform &xform, const IntSize &size, float scale=1.0) |
This will extract an arbitrarily oriented and sized region from the image. More... | |
EMData * | window_center (int l) |
Window the center of an image. More... | |
float * | setup4slice (bool redo=true) |
Set up for fftslice operations. More... | |
void | scale (float scale_factor) |
scale the image by a factor. More... | |
void | translate (float dx, float dy, float dz) |
Translate this image. More... | |
void | translate (const Vec3f &translation) |
Translate this image. More... | |
void | translate (int dx, int dy, int dz) |
Translate this image. More... | |
void | translate (const Vec3i &translation) |
Translate this image. More... | |
void | rotate (const Transform &t) |
Rotate this image. More... | |
float | max_3D_pixel_error (const Transform &t1, const Transform &t2, float r) |
void | rotate (float az, float alt, float phi) |
Rotate this image. More... | |
void | transform (const Transform &t) |
Rotate then translate the image. More... | |
void | rotate_translate (const Transform &t) |
Apply a transformation to the image. More... | |
void | rotate_translate (float az, float alt, float phi, float dx, float dy, float dz) |
Rotate then translate the image. More... | |
void | rotate_translate (float az, float alt, float phi, float dx, float dy, float dz, float pdx, float pdy, float pdz) |
Rotate then translate the image. More... | |
void | rotate_x (int dx) |
This performs a translation of each line along x with wraparound. More... | |
void | rotate_180 () |
Fast rotation by 180 degrees. More... | |
double | dot_rotate_translate (EMData *with, float dx, float dy, float da, const bool mirror=false) |
dot product of 2 images. More... | |
EMData * | little_big_dot (EMData *little_img, bool do_sigma=false) |
This does a normalized dot product of a little image with a big image using real-space methods. More... | |
EMData * | do_radon () |
Radon Transform: an algorithm that transforms an original image into a series of equiangular projections. More... | |
EMData * | calc_ccf (EMData *with=0, fp_flag fpflag=CIRCULANT, bool center=false) |
Calculate Cross-Correlation Function (CCF). More... | |
EMData * | calc_ccf_masked (EMData *with, EMData *withsq=0, EMData *mask=0) |
Calculate cross correlation between this and with where this is assumed to have had a mask applied to it (zero value in masked-out regions). More... | |
void | zero_corner_circulant (const int radius=0) |
Zero the pixels in the bottom left corner of the image If radius is greater than 1, than circulant zeroing occurs assuming that the center of operation starts in the bottom left corner and proceed outwards to the NE and backwards in a circulant fashion towards the SW. More... | |
EMData * | calc_ccfx (EMData *const with, int y0=0, int y1=-1, bool nosum=false, bool flip=false, bool usez=false) |
Calculate Cross-Correlation Function (CCF) in the x-direction and adds them up, result in 1D. More... | |
EMData * | make_rotational_footprint (bool unwrap=true) |
Makes a 'rotational footprint', which is an 'unwound' autocorrelation function. More... | |
EMData * | make_rotational_footprint_e1 (bool unwrap=true) |
EMData * | make_rotational_footprint_cmc (bool unwrap=true) |
EMData * | make_footprint (int type=0) |
Makes a 'footprint' for the current image. More... | |
EMData * | calc_mutual_correlation (EMData *with, bool tocorner=false, EMData *filter=0) |
Calculates mutual correlation function (MCF) between 2 images. More... | |
EMData * | unwrap (int r1=-1, int r2=-1, int xs=-1, int dx=0, int dy=0, bool do360=false, bool weight_radial=true) const |
Maps to polar coordinates from Cartesian coordinates. More... | |
EMData * | unwrap_largerR (int r1, int r2, int xs, float rmax_f) |
EMData * | oneDfftPolar (int size, float rmax, float MAXR) |
void | apply_radial_func (float x0, float dx, vector< float >array, bool interp=true) |
multiplies by a radial function in fourier space. More... | |
vector< float > | calc_radial_dist (int n, float x0, float dx, int inten) |
calculates radial distribution. More... | |
vector< float > | calc_radial_dist (int n, float x0, float dx, int nwedge, float offset, bool inten) |
calculates radial distribution subdivided by angle. More... | |
void | cconj () |
Replace the image its complex conjugate. More... | |
void | add_incoherent (EMData *obj) |
Adds 'obj' to 'this' incoherently. More... | |
vector< float > | calc_hist (int hist_size=128, float hist_min=0, float hist_max=0, const float &brt=0.0f, const float &cont=1.0f) |
Calculates the histogram of 'this' image. More... | |
vector< float > | calc_az_dist (int n, float a0, float da, float rmin, float rmax) |
Caculates the azimuthal distributions. More... | |
float | calc_dist (EMData *second_img, int y_index=0) const |
Calculates the distance between 2 vectors. More... | |
EMData * | calc_flcf (EMData *with) |
Calculates the cross correlation with local normalization between 2 images. More... | |
EMData * | calc_fast_sigma_image (EMData *mask) |
Calculates the local standard deviation (sigma) image using the given mask image. More... | |
EMData * | convolute (EMData *with) |
Convolutes 2 data sets. More... | |
void | common_lines (EMData *image1, EMData *image2, int mode=0, int steps=180, bool horizontal=false) |
Finds common lines between 2 complex images. More... | |
void | common_lines_real (EMData *image1, EMData *image2, int steps=180, bool horizontal=false) |
Finds common lines between 2 real images. More... | |
void | cut_slice (const EMData *const map, const Transform &tr, bool interpolate=true) |
cut a 2D slice out of a real 3D map. More... | |
void | uncut_slice (EMData *const map, const Transform &tr) const |
Opposite of the cut_slice(). More... | |
EMData * | extract_box (const Transform &cs, const Region &r) |
Extract a box from EMData in an abritrary orrientation. More... | |
int | getResolution () const |
function for MarchingCubes, for 3D image display More... | |
void | debug_print_parms () |
Printing EMData params for debugging purpose. More... | |
void | set_xyz_origin (float origin_x, float origin_y, float origin_z) |
Set the x,y,z origin of the image. More... | |
EMData * | compute_missingwedge (float wedgeangle, float start=0.05, float stop=0.5) |
Find the mean and variance of voxels in the missing wedge. More... | |
Static Public Attributes | |
static int | totalalloc =0 |
Private Types | |
enum | EMDataFlags { EMDATA_BUSY = 1 << 3 , EMDATA_HASCTFF = 1 << 4 , EMDATA_NEEDUPD = 1 << 5 , EMDATA_FLIP = 1 << 7 , EMDATA_PAD = 1 << 8 , EMDATA_FFTODD = 1 << 9 , EMDATA_SHUFFLE = 1 << 10 , EMDATA_FH = 1 << 11 , EMDATA_CPU_NEEDS_UPDATE = 1 << 12 , EMDATA_GPU_NEEDS_UPDATE = 1 << 13 , EMDATA_GPU_RO_NEEDS_UPDATE = 1 << 14 } |
This EMDataFlags is deprecated. More... | |
Private Member Functions | |
void | update_stat () const |
void | save_byteorder_to_dict (ImageIO *imageio) |
Private Attributes | |
Dict | attr_dict |
to store all image header info More... | |
float * | rdata |
image real data More... | |
float * | supp |
supplementary data array More... | |
int | flags |
CTF data All CTF data become attribute ctf(vector<float>) in attr_dict –Grant Tang. More... | |
int | changecount |
int | nx |
image size More... | |
int | ny |
int | nz |
int | nxy |
size_t | nxyz |
int | xoff |
array index offsets More... | |
int | yoff |
int | zoff |
Vec3f | all_translation |
translation from the original location More... | |
string | path |
int | pathnum |
EMData * | rot_fp |
This is a cached rotational footprint, can save much time. More... | |
Friends | |
class | GLUtil |
EMData stores an image's data and defines core image processing routines.
The image is 1D, 2D or 3D, in real space or fourier space (complex image).
Data are ordered with x increasing fastest, then y, then z.
|
private |
This EMDataFlags is deprecated.
For anything which is currently handled by setting a bit in 'flags', instead, set or read an appropriately named attribute in the attributes dictionary. While there is a small overhead in the string lookup, none of these things should be called in the innermost loop anywhere, so it should be fine. –Grant
Enumerator | |
---|---|
EMDATA_BUSY | |
EMDATA_HASCTFF | |
EMDATA_NEEDUPD | |
EMDATA_FLIP | |
EMDATA_PAD | |
EMDATA_FFTODD | |
EMDATA_SHUFFLE | |
EMDATA_FH | |
EMDATA_CPU_NEEDS_UPDATE | |
EMDATA_GPU_NEEDS_UPDATE | |
EMDATA_GPU_RO_NEEDS_UPDATE |
Definition at line 811 of file emdata.h.
EMData::EMData | ( | ) |
For all image I/O.
For anything read/set image's information For modular class functions, process, align, etc. For fft, wavelet, insert data For get/set values, basic math operations, operators This is the header of EMData stay in sparx directory This is the header of EMData stay in sphire directory Construct an empty EMData instance. It has no image data.
Definition at line 70 of file emdata.cpp.
References attr_dict, EMAN::EMUtil::EM_FLOAT, ENTERFUNC, EXITFUNC, and totalalloc.
Referenced by absi(), bispecRotTransInvDirect(), bispecRotTransInvN(), calc_ccfx(), calc_fast_sigma_image(), calc_flcf(), compute_missingwedge(), copy_head(), do_radon(), EMData(), extract_box(), get_circle_mean(), get_clip(), get_col(), get_rotated_clip(), get_row(), get_top_half(), make_footprint(), make_rotational_footprint(), make_rotational_footprint_cmc(), make_rotational_footprint_e1(), oneDfftPolar(), operator=(), phase(), read_binedimage(), real2complex(), unwrap(), and unwrap_largerR().
EMData::~EMData | ( | ) |
Definition at line 331 of file emdata.cpp.
References ENTERFUNC, EXITFUNC, free_memory(), and totalalloc.
|
explicit |
Construct from an image file.
filename | the image file name |
image_index | the image index for stack image file, default 0 |
EMData::EMData | ( | float * | data, |
const int | nx, | ||
const int | ny, | ||
const int | nz, | ||
const Dict & | attr_dict = Dict() |
||
) |
Construction from a data pointer, dimensions must be supplied.
Takes possession of the pointer. data pointer must be allocated using malloc!
data | a pointer to the pixel data which is stored in memory. Takes possession |
nx | the number of pixels in the x direction |
ny | the number of pixels in the y direction |
nz | the number of pixels in the z direction |
attr_dict | attribute dictionary for this image |
Definition at line 276 of file emdata.cpp.
References attr_dict, ENTERFUNC, EXITFUNC, totalalloc, and update().
void EMData::add_incoherent | ( | EMData * | obj | ) |
Adds 'obj' to 'this' incoherently.
'obj' and 'this' should be same size. Both images should be complex images.
obj | The image added to 'this' image. |
ImageFormatException | If the 2 images are not same size; or if the 2 images are not complex images. |
Definition at line 3364 of file emdata.cpp.
References ENTERFUNC, EXITFUNC, get_data(), ImageFormatException, is_complex(), EMAN::EMUtil::is_same_size(), LOGERR, NullPointerException, nx, ny, nz, ri2ap(), and update().
void EMData::apply_radial_func | ( | float | x0, |
float | dx, | ||
vector< float > | array, | ||
bool | interp = true |
||
) |
multiplies by a radial function in fourier space.
x0 | starting point x coordinate. |
dx | step of x. |
array | radial function data array. |
interp | Do the interpolation or not. |
Definition at line 2677 of file emdata.cpp.
References ap2ri(), ENTERFUNC, EXITFUNC, get_data(), get_ndim(), ImageFormatException, is_complex(), nx, ny, nz, sqrt(), and update().
Referenced by EMAN::OptVarianceCmp::cmp(), EMAN::CtfSimProcessor::process(), EMAN::FSCFourierProcessor::process(), EMAN::FourierProcessor::process_inplace(), EMAN::FourierAnlProcessor::process_inplace(), EMAN::SNRProcessor::process_inplace(), and EMAN::FileFourierProcessor::process_inplace().
vector< float > EMData::calc_az_dist | ( | int | n, |
float | a0, | ||
float | da, | ||
float | rmin, | ||
float | rmax | ||
) |
Caculates the azimuthal distributions.
works for real or complex images, 2D only.
n | Number of elements. |
a0 | Starting angle. |
da | Angle step. |
rmin | Minimum radius. |
rmax | Maximum radius. |
ImageDimensionException | If image is 3D. |
Definition at line 2472 of file emdata.cpp.
References ENTERFUNC, EXITFUNC, get_data(), get_ndim(), EMAN::Util::hypot_fast(), ImageDimensionException, is_complex(), is_ri(), nx, ny, x, and y.
Calculate cross correlation between this and with where this is assumed to have had a mask applied to it (zero value in masked-out regions).
The mask will be used to compute a local normalization to prevent regions of high brightness from being preferentially aligned to the reference. Note that this local normalization is applied only to one of the two images, so the correlation values remain on arbitrary scale. If FFT of the square of with and the fft of the mask have been precalculated, passing them in will save time. Arguments should be either all-real or all comples. If mask is not provided, it will be computed from this based on zero values
Definition at line 1600 of file emdata.cpp.
References calc_ccf(), NullPointerException, and process().
Referenced by EMAN::RT3DLocalTreeAligner::testort(), and EMAN::RT3DLocalTreeAligner::xform_align_nbest().
float EMData::calc_dist | ( | EMData * | second_img, |
int | y_index = 0 |
||
) | const |
Calculates the distance between 2 vectors.
'this' image is 1D, which contains a vector; 'second_img' may be nD. One of its row is used as the second vector. 'second_img' and 'this' must have the same x size.
second_img | The image used to caculate the distance. |
y_index | Specifies which row in 'second_img' is used to do the caculation. |
ImageDimensionException | If 'this' image is not 1D. |
ImageFormatException | If the 2 images don't have same xsize. |
Definition at line 3398 of file emdata.cpp.
References ENTERFUNC, EXITFUNC, get_data(), get_ndim(), ImageDimensionException, ImageFormatException, nx, ny, sqrt(), and EMAN::Util::square().
Calculates the local standard deviation (sigma) image using the given mask image.
The mask image is typically much smaller than this image, and consists of ones, or is a small circle consisting of ones. The extent of the non zero neighborhood explicitly defines the range over which the local standard deviation is determined. Fourier convolution is used to do the math, ala Roseman (2003, Ultramicroscopy) However, Roseman was just working on methods Van Heel had presented earlier. The normalize flag causes the mask image to be processed so that it has a unit sum. Works in 1,2 and 3D
mask | the image that will be used to define the neighborhood for determine the local standard deviation |
ImageDimensionException | if the dimensions of with do not match those of this |
ImageDimensionException | if any of the dimensions sizes of with exceed of this image's. |
Definition at line 3426 of file emdata.cpp.
References clip_inplace(), convolute(), EMData(), ENTERFUNC, EXITFUNC, get_clip(), get_edge_mean(), get_ndim(), ImageDimensionException, nx, ny, and nz.
Referenced by calc_flcf().
Calculates the cross correlation with local normalization between 2 images.
This is a faster version of local correlation that make use of Fourier convolution and correlation. With is the template - the thing that you wish to find in the this image. It should not be unecessarily padded. The function uses the size of with to determine the extent of the local neighborhood used in the local normalization (for technical details, see calc_fast_sigma_image). Note that this function circularly masks the template at its radius so the calling function need not do this beforehand. Works in 1,2 and 3D.
with | The image used to calculate cross correlation (the template) |
Definition at line 3519 of file emdata.cpp.
References calc_ccf(), calc_fast_sigma_image(), clip_inplace(), copy(), EMData(), ENTERFUNC, EXITFUNC, nx, ny, and nz.
vector< float > EMData::calc_hist | ( | int | hist_size = 128 , |
float | hist_min = 0 , |
||
float | hist_max = 0 , |
||
const float & | brt = 0.0f , |
||
const float & | cont = 1.0f |
||
) |
Calculates the histogram of 'this' image.
The result is stored in float array 'hist'. If hist_min = hist_max, use image data min as hist_min; use image data max as hist_max.
hist_size | Histogram array's size. |
hist_min | Minimum histogram value. |
hist_max | Maximum histogram value. |
brt | |
cont |
Definition at line 2365 of file emdata.cpp.
References ENTERFUNC, EXITFUNC, get_attr(), get_data(), nx, ny, nz, and EMAN::Util::round().
Referenced by EMAN::ToCenterProcessor::process_inplace().
EMData * EMData::calc_mutual_correlation | ( | EMData * | with, |
bool | tocorner = false , |
||
EMData * | filter = 0 |
||
) |
Calculates mutual correlation function (MCF) between 2 images.
If 'with' is NULL, this does mirror ACF.
with | The image used to calculate MCF. |
tocorner | Set whether to translate the result image to the corner. |
filter | The filter image used in calculating MCF. |
ImageFormatException | If 'with' is not NULL and it doesn't have the same size to 'this' image. |
NullPointerException | If FFT returns NULL image. |
Definition at line 2209 of file emdata.cpp.
References do_fft(), ENTERFUNC, EXITFUNC, ImageFormatException, EMAN::EMUtil::is_same_size(), LOGERR, mcf_cuda(), mult_complex_efficient_cuda(), NullPointerException, sqrt(), and EMAN::Util::square().
Referenced by make_rotational_footprint_cmc(), and make_rotational_footprint_e1().
vector< float > EMData::calc_radial_dist | ( | int | n, |
float | x0, | ||
float | dx, | ||
int | inten | ||
) |
calculates radial distribution.
works for real and imaginary images. Returns mean radial amplitude, or intensity if inten is set. Note that the complex origin is at (0,0), with periodic boundaries. Note that the inten option is NOT equivalent to returning amplitude and squaring the result.
n | number of points. |
x0 | starting point x coordinate. |
dx | step of x. |
inten | 0 -> amp, 1-> inten (amp^2), 2->min, 3-> max, 4-> sigma or rmsd intensity from zero if complex, 5-> for 1/2 images along x in real space, origin at x=0, mean amplitude |
Definition at line 2781 of file emdata.cpp.
References ENTERFUNC, EXITFUNC, get_attr_default(), get_data(), EMAN::Util::hypot3(), EMAN::Util::hypot_fast(), InvalidParameterException, is_complex(), is_ri(), nx, ny, nz, sqrt(), x, and y.
Referenced by EMAN::TomoAverager::add_image(), EMAN::TomoWedgeFscCmp::cmp(), EMAN::OptVarianceCmp::cmp(), EMAN::FRCCmp::cmp(), EMAN::MatchSFProcessor::create_radial_func(), EMAN::CtfCAutoAverager::finish(), EMAN::CtfCWautoAverager::finish(), EMAN::FourierAnlProcessor::process_inplace(), EMAN::NonConvexProcessor::process_inplace(), EMAN::FFTPeakProcessor::process_inplace(), EMAN::WedgeFillProcessor::process_inplace(), EMAN::RotationalAverageProcessor::process_inplace(), EMAN::RotationalSubstractProcessor::process_inplace(), EMAN::CTFSNRWeightProcessor::process_inplace(), EMAN::RT3DTreeAligner::xform_align_nbest(), and EMAN::RT3DLocalTreeAligner::xform_align_nbest().
vector< float > EMData::calc_radial_dist | ( | int | n, |
float | x0, | ||
float | dx, | ||
int | nwedge, | ||
float | offset, | ||
bool | inten | ||
) |
calculates radial distribution subdivided by angle.
works for real and imaginary images. 2-D only. The first returns a single vector of n*nwedge points, with radius varying first. That is, the first n points represent the radial profile in the first wedge.
n | number of points. |
x0 | starting x coordinate. |
dx | step of x. |
nwedge | int number of wedges to divide the circle into |
nwedge | float angular offset in radians for start of first bin |
inten | returns intensity (amp^2) rather than amplitude if set |
ImageDimensionException | If 'this' image is not 2D. |
Definition at line 3006 of file emdata.cpp.
References ENTERFUNC, EXITFUNC, get_attr_default(), get_data(), ImageDimensionException, InvalidParameterException, is_complex(), is_ri(), LOGERR, nx, ny, nz, x, and y.
void EMData::cconj | ( | ) |
Replace the image its complex conjugate.
ImageFormatException | Image must be complex (and RI) |
Definition at line 3078 of file emdata.cpp.
References cmplx(), ENTERFUNC, EXITFUNC, ImageFormatException, is_complex(), is_fftodd(), is_ri(), nx, ny, and nz.
void EMData::clip_inplace | ( | const Region & | area, |
const float & | fill_value = 0 |
||
) |
Clip the image inplace - clipping region must be smaller than the current region internally memory is reallocated.
ImageDimensionException | if any of the dimensions of the argument region are negative |
area | The clip area, can be 2D/3D. |
fill_value | the value that new region |
Definition at line 350 of file emdata.cpp.
References Assert, attr_dict, EMAN::EMUtil::em_memcpy(), EMAN::EMUtil::em_memset(), ENTERFUNC, EXITFUNC, get_data(), EMAN::Dict::has_key(), ImageDimensionException, nx, ny, nz, EMAN::Region::origin, rdata, set_size(), set_xyz_origin(), EMAN::Region::size, and update().
Referenced by calc_ccf(), calc_fast_sigma_image(), calc_flcf(), EMAN::FFTResampleProcessor::fft_resample(), EMAN::ScaleTransformProcessor::process(), EMAN::XGradientProcessor::process_inplace(), EMAN::YGradientProcessor::process_inplace(), EMAN::ZGradientProcessor::process_inplace(), EMAN::IntTranslateProcessor::process_inplace(), EMAN::ScaleTransformProcessor::process_inplace(), and EMAN::FlattenBackgroundProcessor::process_inplace().
EMData * EMData::compute_missingwedge | ( | float | wedgeangle, |
float | start = 0.05 , |
||
float | stop = 0.5 |
||
) |
Find the mean and variance of voxels in the missing wedge.
wedgeangle | the angle of the missing wedge |
influnce | the region of influnce in fourier space. This is a fudge factor between 0 and 0.5 |
wedgedirection | the direction of the wedge, so far only a wedge along Z is supported (set wedgedirection to 0) |
Definition at line 4369 of file emdata.cpp.
References EMData(), get_value_at_wrap(), nx, ny, nz, set_attr(), and sqrt().
Convolutes 2 data sets.
The 2 images must be of the same size.
with | One data set. 'this' image is the other data set. |
NullPointerException | If FFT resturns NULL image. |
Definition at line 3567 of file emdata.cpp.
References do_fft(), ENTERFUNC, EXITFUNC, ImageFormatException, is_real(), EMAN::EMUtil::is_same_size(), LOGERR, and NullPointerException.
Referenced by calc_fast_sigma_image(), and EMAN::FlattenBackgroundProcessor::process_inplace().
cut a 2D slice out of a real 3D map.
Put slice into 'this' image.
map | The real 3D map. |
tr | orientation of the slice as encapsulated in a Transform object. |
interpolate | Do interpolation or not. |
NullPointerException | If map is NULL. |
ImageDimensionException | If this image is not 2D. |
ImageDimensionException | If map image is not 3D. |
ImageFormatException | If this image is complex |
ImageFormatException | If map is complex |
Definition at line 4018 of file emdata.cpp.
References EMAN::Util::bilinear_interpolate(), ENTERFUNC, EXITFUNC, EMAN::Util::fast_floor(), get_data(), get_ndim(), ImageDimensionException, ImageFormatException, is_complex(), EMAN::Util::linear_interpolate(), NullPointerException, nx, ny, EMAN::Util::round(), transform(), EMAN::Util::trilinear_interpolate(), update(), x, and y.
|
inline |
Printing EMData params for debugging purpose.
Definition at line 779 of file emdata.h.
References attr_dict, EMAN::Dict::begin(), and EMAN::Dict::end().
EMData * EMData::do_radon | ( | ) |
Radon Transform: an algorithm that transforms an original image into a series of equiangular projections.
When applied to a 2D object, the output of the Radon transform is a series of 1D lines.
Do radon transformation on this image. This image must be 2D square.
ImageFormatException | If the image is not square. |
ImageDimensionException | If the image is not 2D. |
Definition at line 1413 of file emdata.cpp.
References copy(), EMData(), ENTERFUNC, EXITFUNC, get_ndim(), ImageDimensionException, ImageFormatException, nx, ny, EMAN::Util::square(), transform(), x, and y.
double EMData::dot_rotate_translate | ( | EMData * | with, |
float | dx, | ||
float | dy, | ||
float | da, | ||
const bool | mirror = false |
||
) |
dot product of 2 images.
Then 'this' image is rotated/translated. It is much faster than Rotate/Translate then dot product. 2D images only.
with | The image used to do the dot product. |
dx | Translation distance in x direction. |
dy | Translation distance in y direction. |
da | Rotation euler angle in degrees |
mirror |
ImageFormatException | If the 2 images are not the same size. |
ImageDimensionException | If the image is 3D. |
Definition at line 1239 of file emdata.cpp.
References ENTERFUNC, EXITFUNC, EMAN::Util::fast_floor(), get_data(), get_ndim(), ImageDimensionException, ImageFormatException, EMAN::EMUtil::is_same_size(), LOGERR, nx, ny, and y.
Referenced by refalifnfast().
Extract a box from EMData in an abritrary orrientation.
Used for extracting helix boxes from tomograms
EMData extract_box(const Transform& cs, const int ix, const int fx, const int iy, const int yf, const int zi, const int zf);
cs | Transform describing the coordinate system of the box realative to the standard coord system |
r | Region describe the volume to extract, in the local coordinate system |
Definition at line 4301 of file emdata.cpp.
References EMData(), EMAN::Util::fast_floor(), get_data(), EMAN::Region::get_depth(), EMAN::Region::get_height(), EMAN::Transform::get_matrix(), EMAN::Region::get_width(), nx, nxy, ny, nz, EMAN::Util::trilinear_interpolate(), x, EMAN::Region::x_origin(), y, EMAN::Region::y_origin(), and EMAN::Region::z_origin().
Get an inclusive clip.
Pads to fill if larger than this image.
area | The clip area, can be 2D/3D |
fill | the value to assign new pixels outside the area of the original image |
ImageDimensionException | if any of the dimensions of the argument region are negative |
Definition at line 592 of file emdata.cpp.
References attr_dict, EMData(), ENTERFUNC, EXITFUNC, EMAN::Dict::has_key(), ImageDimensionException, nx, ny, nz, EMAN::Region::origin, path, pathnum, set_xyz_origin(), and EMAN::Region::size.
Referenced by calc_fast_sigma_image(), make_footprint(), EMAN::HarmonicProcessor::process(), EMAN::CtfSimProcessor::process(), EMAN::IntTranslateProcessor::process(), EMAN::ScaleTransformProcessor::process(), EMAN::CutoffBlockProcessor::process_inplace(), EMAN::SNRProcessor::process_inplace(), window_center(), EMAN::RT2DTreeAligner::xform_align_nbest(), EMAN::RT2Dto3DTreeAligner::xform_align_nbest(), EMAN::RT3DTreeAligner::xform_align_nbest(), and EMAN::RT3DLocalTreeAligner::xform_align_nbest().
EMData * EMData::get_rotated_clip | ( | const Transform & | xform, |
const IntSize & | size, | ||
float | scale = 1.0 |
||
) |
This will extract an arbitrarily oriented and sized region from the image.
xform | The transformation of the region. |
size | Size of the clip. |
scale | Scaling put on the returned image. |
Definition at line 733 of file emdata.cpp.
References attr_dict, EMData(), nx, ny, nz, sget_value_at_interp(), EMAN::Transform::transform(), x, and y.
EMData * EMData::get_top_half | ( | ) | const |
Get the top half of this 3D image.
ImageDimensionException | If this image is not 3D. |
Definition at line 707 of file emdata.cpp.
References attr_dict, EMAN::EMUtil::em_memcpy(), EMData(), ENTERFUNC, EXITFUNC, get_data(), get_ndim(), ImageDimensionException, nx, ny, and nz.
|
inline |
function for MarchingCubes, for 3D image display
Definition at line 766 of file emdata.h.
References get_xsize().
This does a normalized dot product of a little image with a big image using real-space methods.
The result is the same size as 'this', but a border 1/2 the size of 'little_img' will be zero. This routine is only efficient when 'little_img' is fairly small.
little_img | A small image. |
do_sigma | Calculate sigma or not. |
ImageDimensionException | If the image is not 1D/2D. |
Definition at line 1322 of file emdata.cpp.
References copy_head(), EMAN::dot(), ENTERFUNC, EXITFUNC, get_data(), get_ndim(), ImageDimensionException, nx, ny, nz, sqrt(), and EMAN::Util::square().
EMData * EMData::make_footprint | ( | int | type = 0 | ) |
Makes a 'footprint' for the current image.
This is image containing a rotational & translational invariant of the parent image. The size of the resulting image depends on the selected type.
type 0- The original, default footprint derived from the rotational footprint types 1-6 - bispectrum-based types 1,3,5 - returns Fouier-like images types 2,4,6 - returns real-space-like images type 1,2 - simple r1,r2, 2-D footprints type 3,4 - r1,r2,anle 3D footprints type 5,6 - same as 1,2 but with the cube root of the final products used
type | Select one of several possible algorithms for producing the invariants |
ImageFormatException | If image size is not even. |
Definition at line 2035 of file emdata.cpp.
References calc_ccfx(), do_fft(), EMAN::dot(), EMData(), get_clip(), get_xsize(), make_rotational_footprint_e1(), and UnexpectedBehaviorException.
EMData * EMData::make_rotational_footprint_cmc | ( | bool | unwrap = true | ) |
Definition at line 1795 of file emdata.cpp.
References calc_mutual_correlation(), EMData(), ENTERFUNC, EXITFUNC, nx, ny, nz, rot_fp, unwrap(), and update_stat().
Referenced by EMAN::RotationalAligner::align_180_ambiguous().
EMData * EMData::make_rotational_footprint_e1 | ( | bool | unwrap = true | ) |
Definition at line 1898 of file emdata.cpp.
References calc_mutual_correlation(), EMData(), ENTERFUNC, EXITFUNC, get_edge_mean(), nx, ny, nz, rot_fp, UnexpectedBehaviorException, unwrap(), and update_stat().
Referenced by EMAN::RotationalAligner::align_180_ambiguous(), and make_footprint().
Definition at line 977 of file emdata.cpp.
References EMAN::Util::get_max(), EMAN::Transform::inverse(), and sqrt().
EMData * EMData::oneDfftPolar | ( | int | size, |
float | rmax, | ||
float | MAXR | ||
) |
void EMData::rotate | ( | const Transform & | t | ) |
Rotate this image.
DEPRECATED USE EMData::transform()
t | Transformation rotation. |
Definition at line 971 of file emdata.cpp.
References transform().
void EMData::rotate | ( | float | az, |
float | alt, | ||
float | phi | ||
) |
Rotate this image.
DEPRECATED USE EMData::Transform
az | Rotation euler angle az in EMAN convention. |
alt | Rotation euler angle alt in EMAN convention. |
phi | Rotation euler angle phi in EMAN convention. |
Definition at line 959 of file emdata.cpp.
References transform().
|
inline |
Fast rotation by 180 degrees.
Square 2D image only.
ImageFormatException | If the image is not square. |
ImageDimensionException | If the image is not 2D. |
Definition at line 350 of file emdata.h.
References ENTERFUNC, EXITFUNC, and process_inplace().
|
inline |
Apply a transformation to the image.
DEPRECATED USE EMData::Transform
t | transform object that describes the transformation to be applied to the image. |
Definition at line 306 of file emdata.h.
References transform().
Referenced by rotate_translate().
void EMData::rotate_translate | ( | float | az, |
float | alt, | ||
float | phi, | ||
float | dx, | ||
float | dy, | ||
float | dz | ||
) |
Rotate then translate the image.
DEPRECATED USE EMData::Transform
az | Rotation euler angle az in EMAN convention. |
alt | Rotation euler angle alt in EMAN convention. |
phi | Rotation euler angle phi in EMAN convention. |
dx | Translation distance in x direction. |
dy | Translation distance in y direction. |
dz | Translation distance in z direction. |
Definition at line 995 of file emdata.cpp.
References rotate_translate(), EMAN::Transform::set_rotation(), and EMAN::Transform::set_trans().
void EMData::rotate_translate | ( | float | az, |
float | alt, | ||
float | phi, | ||
float | dx, | ||
float | dy, | ||
float | dz, | ||
float | pdx, | ||
float | pdy, | ||
float | pdz | ||
) |
Rotate then translate the image.
DEPRECATED USE EMData::Transform
az | Rotation euler angle az in EMAN convention. |
alt | Rotation euler angle alt in EMAN convention. |
phi | Rotation euler angle phi in EMAN convention. |
dx | Translation distance in x direction. |
dy | Translation distance in y direction. |
dz | Translation distance in z direction. |
pdx | Pretranslation distance in x direction. |
pdy | Pretranslation distance in y direction. |
pdz | Pretranslation distance in z direction. |
Definition at line 1006 of file emdata.cpp.
References rotate_translate(), EMAN::Transform::set_pre_trans(), EMAN::Transform::set_rotation(), and EMAN::Transform::set_trans().
void EMData::rotate_x | ( | int | dx | ) |
This performs a translation of each line along x with wraparound.
This is equivalent to a rotation when performed on 'unwrapped' maps.
dx | Translation distance align x direction. |
ImageDimensionException | If the image is 3D. |
Definition at line 1209 of file emdata.cpp.
References EMAN::EMUtil::em_malloc(), EMAN::EMUtil::em_memcpy(), ENTERFUNC, EXITFUNC, get_data(), get_ndim(), ImageDimensionException, nx, ny, update(), x, and y.
|
private |
Definition at line 4349 of file emdata.cpp.
References attr_dict, EMAN::ByteOrder::is_host_big_endian(), and EMAN::ImageIO::is_image_big_endian().
Referenced by read_binedimage().
void EMData::scale | ( | float | scale_factor | ) |
scale the image by a factor.
scale_factor | scale factor. |
Definition at line 886 of file emdata.cpp.
References ENTERFUNC, EXITFUNC, EMAN::Transform::set_scale(), and transform().
Referenced by do_ift(), do_ift_inplace(), render_amp24(), render_ap24(), and scale_pixel().
void EMData::set_xyz_origin | ( | float | origin_x, |
float | origin_y, | ||
float | origin_z | ||
) |
Set the x,y,z origin of the image.
origin_x | the x origin |
origin_y | the y origin |
origin_z | the z origin |
Definition at line 3286 of file emdata.cpp.
References attr_dict.
Referenced by clip_inplace(), and get_clip().
float * EMData::setup4slice | ( | bool | redo = true | ) |
Set up for fftslice operations.
When interpolating in fourier space there is a little problem when we get close to x=0, since f(-x,-y,-z) = f(x,y,z)* . So this makes a supplementary array that allows for up to +-2 point interpolation all the way to the origin in x.
3D only; complex image only
redo | If true, recalculate the supplementary array. |
ImageFormatException | If the image is not a complex image. |
ImageDimensionException | If the image is not 3D. |
Definition at line 822 of file emdata.cpp.
References EMAN::EMUtil::em_calloc(), EMAN::EMUtil::em_free(), ENTERFUNC, EXITFUNC, get_data(), get_ndim(), ImageDimensionException, ImageFormatException, is_complex(), nx, nxy, ny, nz, supp, x, and y.
Referenced by EMAN::GaussFFTProjector::interp_ft_3d().
|
inline |
Rotate then translate the image.
DEPRECATED USE EMData::Transform
t | The rotation and translation transformation to be done. Transform the image |
t | the transform object that describes the transformation to be applied to the image. |
Definition at line 295 of file emdata.h.
References ENTERFUNC, EXITFUNC, and process_inplace().
Referenced by cut_slice(), do_radon(), EMAN::BackProjectionReconstructor::insert_slice(), EMAN::TestImageSinewave::process_inplace(), rotate(), rotate_translate(), scale(), and uncut_slice().
void EMData::translate | ( | const Vec3f & | translation | ) |
Translate this image.
translation | The translation distance vector. |
Definition at line 940 of file emdata.cpp.
References all_translation, ENTERFUNC, EXITFUNC, process_inplace(), and EMAN::Transform::set_trans().
void EMData::translate | ( | const Vec3i & | translation | ) |
Translate this image.
integer only translation could be done faster, without interpolation.
translation | The translation distance vector. |
Definition at line 920 of file emdata.cpp.
References all_translation, ENTERFUNC, EXITFUNC, and process_inplace().
void EMData::translate | ( | float | dx, |
float | dy, | ||
float | dz | ||
) |
Translate this image.
dx | Translation distance in x direction. |
dy | Translation distance in y direction. |
dz | Translation distance in z direction. |
Definition at line 904 of file emdata.cpp.
References ENTERFUNC, EXITFUNC, EMAN::Util::round(), and translate().
Referenced by EMAN::PhaseToMassCenterProcessor::process_inplace(), EMAN::ToCenterProcessor::process_inplace(), EMAN::ToMassCenterProcessor::process_inplace(), EMAN::ACFCenterProcessor::process_inplace(), EMAN::GaussFFTProjector::project3d(), EMAN::RT2Dto3DTreeAligner::testort(), and translate().
void EMData::translate | ( | int | dx, |
int | dy, | ||
int | dz | ||
) |
Translate this image.
integer only translation could be done faster, without interpolation.
dx | Translation distance in x direction. |
dy | Translation distance in y direction. |
dz | Translation distance in z direction. |
Definition at line 896 of file emdata.cpp.
References ENTERFUNC, EXITFUNC, and translate().
Opposite of the cut_slice().
It will take a slice and insert the data into a real 3D map. It does not interpolate, it uses the nearest neighbor.
map | The real 3D map. |
tr | Orientation of the slice. |
NullPointerException | If map is NULL. |
ImageDimensionException | If this image is not 2D. |
ImageDimensionException | If map image is not 3D. |
ImageFormatException | If this image is complex |
ImageFormatException | If map is complex |
Definition at line 4237 of file emdata.cpp.
References ENTERFUNC, EXITFUNC, get_data(), get_ndim(), ImageDimensionException, ImageFormatException, is_complex(), NullPointerException, nx, ny, EMAN::Util::round(), transform(), x, and y.
EMData * EMData::unwrap_largerR | ( | int | r1, |
int | r2, | ||
int | xs, | ||
float | rmax_f | ||
) |
Definition at line 4136 of file emdata.cpp.
References EMAN::Util::calc_best_fft_size(), EMData(), get_data(), get_xsize(), get_ysize(), sqrt(), update(), x, and y.
|
private |
Definition at line 3091 of file emdata.cpp.
References attr_dict, EMDATA_NEEDUPD, ENTERFUNC, EXITFUNC, flags, get_data(), EMAN::Util::get_max(), EMAN::Util::get_min(), is_complex(), is_ri(), nx, ny, nz, rdata, rot_fp, and sqrt().
Referenced by get_attr(), get_attr_dict(), make_rotational_footprint(), make_rotational_footprint_cmc(), and make_rotational_footprint_e1().
EMData * EMData::window_center | ( | int | l | ) |
Window the center of an image.
Often an image is padded with zeros for fourier interpolation. In that case the desired lxlxl volume (or lxl area) lies in the center of a larger volume (or area). This routine creates a new object that contains only the desired window. (This routine is a thin wrapper around get_clip.)
l | Length of the window. |
Definition at line 776 of file emdata.cpp.
References ENTERFUNC, EXITFUNC, get_clip(), get_ndim(), ImageDimensionException, ImageFormatException, is_complex(), is_fftodd(), is_fftpadded(), LOGERR, nx, ny, and nz.
Referenced by EMAN::FourierGriddingProjector::project3d().
void EMData::zero_corner_circulant | ( | const int | radius = 0 | ) |
Zero the pixels in the bottom left corner of the image If radius is greater than 1, than circulant zeroing occurs assuming that the center of operation starts in the bottom left corner and proceed outwards to the NE and backwards in a circulant fashion towards the SW.
Intended to zero the area corresponding to the middle of the image, as generated by calc_ccf
radius | the radius to the zeroing operation |
ImageDimensionException | if nx > 1 and nx < 2*radius + 1 |
ImageDimensionException | if ny > 1 and ny < 2*radius + 1 |
ImageDimensionException | if nz > 1 and nz < 2*radius + 1 |
Definition at line 1462 of file emdata.cpp.
References get_value_at_wrap(), ImageDimensionException, nx, ny, nz, x, and y.
|
private |
translation from the original location
Definition at line 854 of file emdata.h.
Referenced by copy_head(), operator=(), and translate().
|
mutableprivate |
to store all image header info
Definition at line 833 of file emdata.h.
Referenced by clip_inplace(), copy_head(), debug_print_parms(), del_attr(), EMData(), get_attr(), get_attr_dict(), get_clip(), get_ctf(), get_rotated_clip(), get_top_half(), operator=(), read_binedimage(), save_byteorder_to_dict(), scale_pixel(), set_xyz_origin(), update_stat(), and write_lst().
|
private |
Definition at line 846 of file emdata.h.
Referenced by get_attr(), get_attr_dict(), and operator=().
|
mutableprivate |
CTF data All CTF data become attribute ctf(vector<float>) in attr_dict –Grant Tang.
flags
Definition at line 844 of file emdata.h.
Referenced by copy_head(), get_attr(), operator=(), render_ap24(), and update_stat().
|
private |
image size
Definition at line 848 of file emdata.h.
Referenced by absi(), add_complex_at(), add_incoherent(), apply_radial_func(), calc_az_dist(), calc_ccf(), calc_ccfx(), calc_center_density(), calc_center_of_mass(), calc_dist(), calc_fast_sigma_image(), calc_flcf(), calc_highest_locations(), calc_hist(), calc_max_index(), calc_max_location(), calc_max_location_wrap(), calc_min_index(), calc_min_location(), calc_n_highest_locations(), calc_radial_dist(), calc_sigma_diff(), cconj(), clip_inplace(), common_lines(), compute_missingwedge(), copy_head(), cut_slice(), do_fft(), do_fft_inplace(), do_ift(), do_ift_inplace(), do_radon(), dot_rotate_translate(), EMData(), extract_box(), find_pixels_with_value(), get_2dcview(), get_2dview(), get_3dcview(), get_3dview(), get_attr(), get_attr_dict(), get_circle_mean(), get_clip(), get_col(), get_complex_at(), get_complex_index(), get_data_pickle(), get_edge_mean(), get_fft_amplitude(), get_fft_amplitude2D(), get_fft_phase(), get_rotated_clip(), get_row(), get_top_half(), get_value_at_wrap(), little_big_dot(), make_rotational_footprint_cmc(), make_rotational_footprint_e1(), operator=(), phase(), read_binedimage(), real2complex(), render_amp24(), render_ap24(), ri2ap(), ri2inten(), rotate_x(), set_complex_at(), set_data_pickle(), setup4slice(), sget_value_at(), to_value(), uncut_slice(), unwrap(), update_stat(), window_center(), and zero_corner_circulant().
|
private |
Definition at line 848 of file emdata.h.
Referenced by add_complex_at(), calc_center_of_mass(), calc_highest_locations(), calc_max_location(), calc_min_location(), calc_n_highest_locations(), extract_box(), get_complex_at(), get_complex_index(), get_edge_mean(), get_value_at_wrap(), set_complex_at(), setup4slice(), and sget_value_at().
|
private |
Definition at line 849 of file emdata.h.
Referenced by add_complex_at(), do_fft(), get_complex_index(), log(), log10(), and sqrt().
|
private |
Definition at line 848 of file emdata.h.
Referenced by absi(), add_complex_at(), add_incoherent(), apply_radial_func(), calc_az_dist(), calc_ccf(), calc_ccfx(), calc_center_density(), calc_center_of_mass(), calc_dist(), calc_fast_sigma_image(), calc_flcf(), calc_highest_locations(), calc_hist(), calc_max_index(), calc_max_location(), calc_max_location_wrap(), calc_min_index(), calc_min_location(), calc_n_highest_locations(), calc_radial_dist(), calc_sigma_diff(), cconj(), clip_inplace(), common_lines(), compute_missingwedge(), copy_head(), cut_slice(), do_fft(), do_fft_inplace(), do_ift(), do_ift_inplace(), do_radon(), dot_rotate_translate(), EMData(), extract_box(), find_pixels_with_value(), get_2dcview(), get_2dview(), get_3dcview(), get_3dview(), get_attr(), get_attr_dict(), get_circle_mean(), get_clip(), get_col(), get_complex_at(), get_complex_index(), get_data_pickle(), get_edge_mean(), get_fft_amplitude(), get_fft_amplitude2D(), get_fft_phase(), get_rotated_clip(), get_top_half(), get_value_at_wrap(), little_big_dot(), make_rotational_footprint_cmc(), make_rotational_footprint_e1(), operator=(), phase(), read_binedimage(), real2complex(), render_amp24(), render_ap24(), ri2ap(), ri2inten(), rotate_x(), set_complex_at(), set_data_pickle(), setup4slice(), sget_value_at(), to_value(), uncut_slice(), unwrap(), update_stat(), window_center(), and zero_corner_circulant().
|
private |
Definition at line 848 of file emdata.h.
Referenced by absi(), add_complex_at(), add_incoherent(), apply_radial_func(), calc_ccf(), calc_ccfx(), calc_center_density(), calc_center_of_mass(), calc_fast_sigma_image(), calc_flcf(), calc_highest_locations(), calc_hist(), calc_max_location(), calc_max_location_wrap(), calc_min_location(), calc_n_highest_locations(), calc_radial_dist(), calc_sigma_diff(), cconj(), clip_inplace(), compute_missingwedge(), copy_head(), do_fft(), do_fft_inplace(), do_ift(), do_ift_inplace(), EMData(), extract_box(), find_pixels_with_value(), get_3dcview(), get_3dview(), get_attr(), get_attr_dict(), get_circle_mean(), get_clip(), get_complex_at(), get_complex_index(), get_data_pickle(), get_edge_mean(), get_fft_amplitude(), get_fft_amplitude2D(), get_fft_phase(), get_rotated_clip(), get_top_half(), get_value_at_wrap(), little_big_dot(), make_rotational_footprint_cmc(), make_rotational_footprint_e1(), operator=(), phase(), read_binedimage(), real2complex(), ri2ap(), ri2inten(), set_complex_at(), set_data_pickle(), setup4slice(), sget_value_at(), to_value(), update_stat(), window_center(), and zero_corner_circulant().
|
private |
Definition at line 857 of file emdata.h.
Referenced by copy_head(), get_clip(), and operator=().
|
private |
Definition at line 858 of file emdata.h.
Referenced by copy_head(), get_clip(), and operator=().
|
mutableprivate |
image real data
Definition at line 835 of file emdata.h.
Referenced by add_complex_at(), clip_inplace(), do_fft_inplace(), do_ift(), EMData(), free_rdata(), get_attr_dict(), get_complex_at(), operator=(), set_complex_at(), and update_stat().
|
mutableprivate |
This is a cached rotational footprint, can save much time.
Definition at line 861 of file emdata.h.
Referenced by EMData(), make_rotational_footprint(), make_rotational_footprint_cmc(), make_rotational_footprint_e1(), operator=(), and update_stat().
|
private |
supplementary data array
Definition at line 837 of file emdata.h.
Referenced by set_supp_pickle(), and setup4slice().
|
static |
|
private |
|
private |
Definition at line 851 of file emdata.h.
Referenced by operator=().
|
private |
Definition at line 851 of file emdata.h.
Referenced by operator=().