EMAN2
emdata.h
Go to the documentation of this file.
1/*
2 * Author: Steven Ludtke, 04/10/2003 (sludtke@bcm.edu)
3 * Copyright (c) 2000-2006 Baylor College of Medicine
4 *
5 * This software is issued under a joint BSD/GNU license. You may use the
6 * source code in this file under either license. However, note that the
7 * complete EMAN2 and SPARX software packages have some GPL dependencies,
8 * so you are responsible for compliance with the licenses of these packages
9 * if you opt to use BSD licensing. The warranty disclaimer below holds
10 * in either instance.
11 *
12 * This complete copyright notice must be included in any revised version of the
13 * source code. Additional authorship citations may be added, but existing
14 * author citations must be preserved.
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 *
30 * */
31
32#ifndef eman__emdata_h__
33#define eman__emdata_h__ 1
34
35#include <cfloat>
36#include <complex>
37#include <fstream>
38
39#include "sparx/fundamentals.h"
40#include "emutil.h"
41#include "util.h"
42#include "sparx/emarray.h"
43#include "geometry.h"
44#include "transform.h"
45#include "vec3.h"
46#ifdef EMAN2_USING_CUDA
47#include <cuda_runtime_api.h>
48#include "cuda/cuda_util.h"
49#endif // EMAN2_USING_CUDA
50using std::string;
51using std::vector;
52using std::map;
53//using std::complex; //comment this out for conflict with ACML
54using std::ostream;
55
56#include <utility>
57using std::pair;
58
59namespace EMAN
60{
61 class ImageIO;
62 class Ctf;
63 class XYData;
64 class Transform;
65 class GLUtil;
66 class EMBytes: public std::string {};
67
68 typedef boost::multi_array_ref<float, 2> MArray2D;
69 typedef boost::multi_array_ref<float, 3> MArray3D;
70 typedef boost::multi_array_ref<std::complex<float>, 2> MCArray2D;
71 typedef boost::multi_array_ref<std::complex<float>, 3> MCArray3D;
72 typedef boost::multi_array<int, 2> MIArray2D;
73 typedef boost::multi_array<int, 3> MIArray3D;
74
81 class EMData
82 {
83 friend class GLUtil;
84
86 #include "emdata_io.h"
87
89 #include "emdata_metadata.h"
90
92 #include "emdata_modular.h"
93
95 #include "emdata_transform.h"
96
98 #include "emdata_core.h"
99
101 #include "sparx/emdata_sparx.h"
102
104 #include "sphire/emdata_sphire.h"
105
106#ifdef EMAN2_USING_CUDA
108 #include "emdata_cuda.h"
109#endif // EMAN2_USING_CUDA
110
111 public:
113 EMData();
114 ~ EMData();
115
119 explicit EMData(const string& filename, int image_index=0);
120
128 EMData(int nx, int ny, int nz=1, bool is_real=true);
129
139 EMData(float* data, const int nx, const int ny, const int nz, const Dict& attr_dict = Dict());
140
151 EMData(float* data, float* cudadata, const int nx, const int ny, const int nz, const Dict& attr_dict = Dict());
152 //I do not wish to use a default dict if none is provided. Copying Dicts arround is really expensive in CUDA.
153
159 EMData(const EMData& that);
160
166 EMData& operator=(const EMData& that);
167
168
176 EMData *get_clip(const Region & area, const float fill = 0) const;
177
184 void clip_inplace(const Region & area,const float& fill_value=0);
185
190 EMData *get_top_half() const;
191
192
201 EMData *get_rotated_clip(const Transform & xform, const IntSize &size, float scale=1.0);
202
213 EMData* window_center(int l);
214
215
230 float *setup4slice(bool redo = true);
231
232
236 void scale(float scale_factor);
237
238
244 void translate(float dx, float dy, float dz);
245
246
250 void translate(const Vec3f &translation);
251
252
259 void translate(int dx, int dy, int dz);
260
261
266 void translate(const Vec3i &translation);
267
268
273 void rotate(const Transform & t);
274
275 float max_3D_pixel_error(const Transform &t1, const Transform &t2, float r);
276
283 void rotate(float az, float alt, float phi);
284
285
290// void rotate_translate(const Transform3D & t);
291
295 inline void transform(const Transform& t) {
296 ENTERFUNC;
297 process_inplace("xform",Dict("transform",(Transform*)(&t)));
298 //update(); no need, process_inplace did it
299 EXITFUNC;
300 }
301
306 inline void rotate_translate(const Transform & t) {
307 cout << "Deprecation warning. Please consider using EMData::transform() instead " << endl;
308 transform(t); }
309
319 void rotate_translate(float az, float alt, float phi, float dx, float dy, float dz);
320
321
334 void rotate_translate(float az, float alt, float phi, float dx, float dy,
335 float dz, float pdx, float pdy, float pdz);
336
337
343 void rotate_x(int dx);
344
345
350 inline void rotate_180() {
351 ENTERFUNC;
352 process_inplace("math.rotate.180",Dict());
353 EXITFUNC;
354 }
355
356
370 double dot_rotate_translate(EMData * with, float dx, float dy, float da,const bool mirror=false);
371
372
383 EMData *little_big_dot(EMData * little_img, bool do_sigma = false);
384
385
398 EMData *do_radon();
399
400
416 EMData *calc_ccf(EMData * with = 0, fp_flag fpflag = CIRCULANT, bool center=false);
417
427 EMData *calc_ccf_masked(EMData *with,EMData *withsq=0,EMData *mask=0);
428
441 void zero_corner_circulant(const int radius = 0);
442
462 EMData *calc_ccfx( EMData * const with, int y0 = 0, int y1 = -1, bool nosum = false, bool flip = false,bool usez=false);
463
464
476
493 EMData *make_footprint(int type=0);
494
495
508 EMData *calc_mutual_correlation(EMData * with, bool tocorner = false, EMData * filter = 0);
509
510
526 EMData *unwrap(int r1 = -1, int r2 = -1, int xs = -1, int dx = 0,
527 int dy = 0, bool do360 = false, bool weight_radial=true) const;
528
529 EMData * unwrap_largerR(int r1,int r2,int xs, float rmax_f);
530
531 EMData *oneDfftPolar(int size, float rmax, float MAXR);
532
533
541 void apply_radial_func(float x0, float dx, vector < float >array, bool interp = true);
542
543
555 vector < float >calc_radial_dist(int n, float x0, float dx,int inten);
556
557
570 vector < float >calc_radial_dist(int n, float x0, float dx, int nwedge, float offset,bool inten);
571
572
576 void cconj();
577
578
586 void add_incoherent(EMData * obj);
587
588
600 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);
601
602
614 vector<float> calc_az_dist(int n, float a0, float da, float rmin,
615 float rmax);
616
617#if 0
618 void calc_rcf(EMData * with, vector < float >&sum_array);
619#endif
633 float calc_dist(EMData * second_img, int y_index = 0) const;
634
651 EMData *calc_flcf(EMData * with);
652
672
678 EMData *convolute(EMData * with);
679
680#if 0
681 void create_ctf_map(CtfMapType type, XYData * sf = 0);
682#endif
683
684
706 void common_lines(EMData * image1, EMData * image2, int mode = 0,
707 int steps = 180, bool horizontal = false);
708
719 void common_lines_real(EMData * image1, EMData * image2,
720 int steps = 180, bool horizontal = false);
721
735 void cut_slice(const EMData * const map, const Transform& tr, bool interpolate = true);
736
751 void uncut_slice(EMData * const map, const Transform& tr) const;
752
761 EMData *extract_box(const Transform& cs, const Region& r);
762
766 int getResolution() const {
767 int resolution = 0;
768 int num = 1;
769 while(num < get_xsize()) {
770 resolution++;
771 num = 1 << resolution;
772 }
773
774 return resolution;
775 }
776
780 {
781 std::cout << "Printing EMData params" << std::endl;
782 for ( Dict::const_iterator it = attr_dict.begin(); it != attr_dict.end(); ++it )
783 {
784 std::cout << (it->first) << " " << (it->second).to_str() << std::endl;
785 }
786 std::cout << "Done printing EMData params" << std::endl;
787 }
788
794 void set_xyz_origin(float origin_x, float origin_y, float origin_z);
795
801 EMData* compute_missingwedge(float wedgeangle, float start = 0.05, float stop = 0.5);
802
803 static int totalalloc;
804 private:
812// EMDATA_COMPLEX = 1 << 1,
813// EMDATA_RI = 1 << 2, // real/imaginary or amp/phase
814 EMDATA_BUSY = 1 << 3, // someone is modifying data, NO LONGER USED
815 EMDATA_HASCTFF = 1 << 4, // has CTF info in the image file
816 EMDATA_NEEDUPD = 1 << 5, // needs a real update
817// EMDATA_COMPLEXX = 1 << 6, // 1D fft's in X
818 EMDATA_FLIP = 1 << 7, // is the image flipped
819 EMDATA_PAD = 1 << 8, // is the image fft padded
820 EMDATA_FFTODD = 1 << 9, // is the (real-space) nx odd
821 EMDATA_SHUFFLE = 1 << 10, // fft been shuffled? (so O is centered) PRB
822 EMDATA_FH = 1 << 11, // is the complex image a FH image
823 EMDATA_CPU_NEEDS_UPDATE = 1 << 12, // CUDA related: is the CPU version of the image out out data
824 EMDATA_GPU_NEEDS_UPDATE = 1 << 13, // CUDA related: is the GPU version of the image out out data
825 EMDATA_GPU_RO_NEEDS_UPDATE = 1 << 14 // // CUDA related: is the GPU RO version of the image out out data
826 };
827
828 void update_stat() const;
829 void save_byteorder_to_dict(ImageIO * imageio);
830
831 private:
835 mutable float *rdata;
837 float *supp;
838
841 //Ctf *ctf;
842
844 mutable int flags;
845 // Incremented every time the image changes
848 int nx, ny, nz, nxy;
849 size_t nxyz;
852
855// Vec3f all_rotation; /** rotation (az, alt, phi) from the original locaton*/
856
857 string path;
859
861 mutable EMData* rot_fp;
862
863#ifdef FFT_CACHING
864 mutable EMData *fftcache;
865#endif
866
867 // Clip inplace variables is a local class used from convenience in EMData::clip_inplace
868 // Added by d.woolford
870 {
871 public:
872 ClipInplaceVariables(const int p_nx, const int p_ny, const int p_nz, const int n_nx, const int n_ny, const int n_nz,const int xtrans, const int ytrans, const int ztrans) :
873 prv_nx(p_nx), prv_ny(p_ny), prv_nz(p_nz), new_nx(n_nx), new_ny(n_ny), new_nz(n_nz), xshift(xtrans), yshift(ytrans), zshift(ztrans),
876 {
877 if ( xtrans > 0 ) x_iter -= xtrans;
878 if ( x_iter < 0 ) x_iter = 0;
879 if ( ytrans > 0 ) y_iter -= ytrans;
880 if ( y_iter < 0 ) y_iter = 0;
881 if ( ztrans > 0 ) z_iter -= ztrans;
882 if ( z_iter < 0 ) z_iter = 0;
883
884 // Get the depth in the new volume where slices are inserted
885 // if this value is zero it means that the last z-slice in the new
886 // volume contains image data
887 if ( (new_nz + ztrans) > prv_nz ) new_z_top = new_nz + ztrans - prv_nz;
888 if ( (new_ny + ytrans) > prv_ny ) new_y_back = new_ny + ytrans - prv_ny;
889 if ( (new_nx + xtrans) > prv_nx ) new_x_right = new_nx + xtrans - prv_nx;
890
891 if ( (new_nz + ztrans) < prv_nz )
892 {
893 prv_z_top = prv_nz - new_nz - ztrans;
894 z_iter -= prv_z_top;
895 }
896 if ( (new_ny + ytrans) < prv_ny )
897 {
898 prv_y_back = prv_ny - new_ny - ytrans;
900 }
901 if ( (new_nx + xtrans) < prv_nx )
902 {
903 prv_x_right = prv_nx - new_nx - xtrans;
905 }
906
907 if ( xtrans > 0 ) prv_x_left = xtrans;
908 if ( ytrans > 0 ) prv_y_front = ytrans;
909 if ( ztrans > 0 ) prv_z_bottom = ztrans;
910
911 if ( xtrans < 0 ) new_x_left = -xtrans;
912 if ( ytrans < 0 ) new_y_front = -ytrans;
913 if ( ztrans < 0 ) new_z_bottom = -ztrans;
914
915 }
917
923 };
924
925
926
927 // /** Do the Fourier Harmonic Transform PRB
928 // * Takes a real image, returns the FH
929 // * Sets the EMDATA_FH switch to indicate that it is an FH image
930 // * @exception ImageFormatException If the image is not a square real odd image.
931 // * @return the FH image.
932 // */
933 // EMData* do_FH();
934
935 // /** Do the Inverse Fourier Harmonic Transform PRB
936 // * Takes an FH image, returns a square complex image with odd sides
937 // * @exception ImageFormatException If the image is not the FH of something
938 // * @return a square complex image with odd sides
939 // */
940 // EMData* do_FH2F();
941
942
943
944 // /** Caclulates normalization and phase residual for a slice in
945 // * an already existing volume. phase residual is calculated
946 // * using only the inner 1/2 of the fourier sphere. Both the
947 // * slice image and this image must be in complex image format.
948 // *
949 // * @param slice An slice image to be normalized.
950 // * @param orient Orientation of the slice.
951 // * @exception ImageFormatException If the images are not complex.
952 // * @exception ImageDimensionException If the image is 3D.
953 // * @return A float number pair (result, phase-residual).
954 // */
955 // FloatPoint normalize_slice(EMData * slice, const Transform3D & orient);
956
957 // /** Caclulates normalization and phase residual for a slice in
958 // * an already existing volume. phase residual is calculated
959 // * using only the inner 1/2 of the fourier sphere. Both the
960 // * slice image and this image must be in complex image format.
961 // *
962 // * @param slice An slice image to be normalized.
963 // * @param alt Orientation euler angle alt (in EMAN convention).
964 // * @param az Orientation euler angle az (in EMAN convention).
965 // * @param phi Orientation euler angle phi (in EMAN convention).
966 // * @exception ImageFormatException If the images are not complex.
967 // * @exception ImageDimensionException If the image is 3D.
968 // * @return A float number pair (result, phase-residual).
969 // */
970 // FloatPoint normalize_slice(EMData * slice, float az, float alt, float phi);
971
972 // /** Get the normalization and phase residual values
973 // * Used for normalizaton and error measurement when 2D slices are inserted into a 3D volume of Fourier pixels
974 // * Originally added for use by the FourierReconstructor object
975 // * @return the normalization const (pair.first) and the phase residual (pair.second)
976 // * @param slice -the slice to be inserted into the 3D volume
977 // * @param euler - the euler angle orientation of the slice
978 // * @exception ImageDimensionException If this image is not 3D.ImageFormatException
979 // * @exception ImageFormatException If this image is not complex
980 // * @exception ImageFormatException If the slice not complex
981 // */
982 // pair<float, float> get_normalization_and_phaseres( const EMData* const slice, const Transform3D& euler );
983
984 // /** cut a 2D slice out of a this 3D image and return it
985 // * An alternative to cut_slice
986 // * @param tr orientation of the slice as encapsulated in a Transform object
987 // * @exception ImageDimensionException If this image is not 3D.
988 // * @exception ImageFormatException If this image is complex
989 // * @author David Woolford (adapted from an original version by Steve Ludtke)
990 // * @date Feb 2009
991 // */
992 // EMData* get_cut_slice(const Transform& tr);
993
994 };
995
996
997 EMData * operator+(const EMData & em, float n);
998 EMData * operator-(const EMData & em, float n);
999 EMData * operator*(const EMData & em, float n);
1000 EMData * operator/(const EMData & em, float n);
1001
1002 EMData * operator+(float n, const EMData & em);
1003 EMData * operator-(float n, const EMData & em);
1004 EMData * operator*(float n, const EMData & em);
1005 EMData * operator/(float n, const EMData & em);
1006
1007 EMData * rsub(const EMData & em, float n);
1008 EMData * rdiv(const EMData & em, float n);
1009
1010 EMData * operator+(const EMData & a, const EMData & b);
1011 EMData * operator-(const EMData & a, const EMData & b);
1012 EMData * operator*(const EMData & a, const EMData & b);
1013 EMData * operator/(const EMData & a, const EMData & b);
1014
1015
1016/* Next is Modified by PRB Transform3D::EMAN,
1017 inline Transform3D EMData::get_transform() const
1018 {
1019 return Transform3D((float)attr_dict["euler_alt"],
1020 (float)attr_dict["euler_az"],
1021 (float)attr_dict["euler_phi"]);
1022 }
1023*/
1024
1025
1026}
1027
1028
1029#endif
Const iterator support for the Dict object This is just a wrapper, everything is inherited from the m...
Definition: emobject.h:674
Dict is a dictionary to store <string, EMObject> pair.
Definition: emobject.h:385
iterator end()
Definition: emobject.cpp:1061
iterator begin()
Definition: emobject.cpp:1045
ClipInplaceVariables(const int p_nx, const int p_ny, const int p_nz, const int n_nx, const int n_ny, const int n_nz, const int xtrans, const int ytrans, const int ztrans)
Definition: emdata.h:872
EMData stores an image's data and defines core image processing routines.
Definition: emdata.h:82
EMData * get_top_half() const
Get the top half of this 3D image.
Definition: emdata.cpp:707
void scale(float scale_factor)
scale the image by a factor.
Definition: emdata.cpp:886
void rotate_180()
Fast rotation by 180 degrees.
Definition: emdata.h:350
void update_stat() const
Definition: emdata.cpp:3091
void translate(float dx, float dy, float dz)
Translate this image.
Definition: emdata.cpp:904
EMData * calc_fast_sigma_image(EMData *mask)
Calculates the local standard deviation (sigma) image using the given mask image.
Definition: emdata.cpp:3426
int pathnum
Definition: emdata.h:858
EMData * compute_missingwedge(float wedgeangle, float start=0.05, float stop=0.5)
Find the mean and variance of voxels in the missing wedge.
Definition: emdata.cpp:4369
EMData * rot_fp
This is a cached rotational footprint, can save much time.
Definition: emdata.h:861
void cconj()
Replace the image its complex conjugate.
Definition: emdata.cpp:3078
void rotate(const Transform &t)
Rotate this image.
Definition: emdata.cpp:971
EMData * calc_flcf(EMData *with)
Calculates the cross correlation with local normalization between 2 images.
Definition: emdata.cpp:3519
void save_byteorder_to_dict(ImageIO *imageio)
Definition: emdata.cpp:4349
float max_3D_pixel_error(const Transform &t1, const Transform &t2, float r)
Definition: emdata.cpp:977
int yoff
Definition: emdata.h:851
EMData()
For all image I/O.
Definition: emdata.cpp:70
void uncut_slice(EMData *const map, const Transform &tr) const
Opposite of the cut_slice().
Definition: emdata.cpp:4237
EMData * window_center(int l)
Window the center of an image.
Definition: emdata.cpp:776
static int totalalloc
Definition: emdata.h:803
float * supp
supplementary data array
Definition: emdata.h:837
EMData * make_rotational_footprint_cmc(bool unwrap=true)
Definition: emdata.cpp:1795
EMDataFlags
This EMDataFlags is deprecated.
Definition: emdata.h:811
@ EMDATA_GPU_RO_NEEDS_UPDATE
Definition: emdata.h:825
@ EMDATA_NEEDUPD
Definition: emdata.h:816
@ EMDATA_SHUFFLE
Definition: emdata.h:821
@ EMDATA_HASCTFF
Definition: emdata.h:815
@ EMDATA_PAD
Definition: emdata.h:819
@ EMDATA_GPU_NEEDS_UPDATE
Definition: emdata.h:824
@ EMDATA_CPU_NEEDS_UPDATE
Definition: emdata.h:823
@ EMDATA_BUSY
Definition: emdata.h:814
@ EMDATA_FLIP
Definition: emdata.h:818
@ EMDATA_FFTODD
Definition: emdata.h:820
EMData * calc_mutual_correlation(EMData *with, bool tocorner=false, EMData *filter=0)
Calculates mutual correlation function (MCF) between 2 images.
Definition: emdata.cpp:2209
int changecount
Definition: emdata.h:846
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,...
Definition: emdata.cpp:1462
double dot_rotate_translate(EMData *with, float dx, float dy, float da, const bool mirror=false)
dot product of 2 images.
Definition: emdata.cpp:1239
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.
Definition: emdata.cpp:1322
float * rdata
image real data
Definition: emdata.h:835
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...
Definition: emdata.cpp:1600
Dict attr_dict
to store all image header info
Definition: emdata.h:833
EMData(const string &filename, int image_index=0)
Construct from an image file.
string path
Definition: emdata.h:857
int nx
image size
Definition: emdata.h:848
void rotate_x(int dx)
This performs a translation of each line along x with wraparound.
Definition: emdata.cpp:1209
EMData * get_clip(const Region &area, const float fill=0) const
Get an inclusive clip.
Definition: emdata.cpp:592
EMData * make_rotational_footprint_e1(bool unwrap=true)
Definition: emdata.cpp:1898
int flags
CTF data All CTF data become attribute ctf(vector<float>) in attr_dict –Grant Tang.
Definition: emdata.h:844
void apply_radial_func(float x0, float dx, vector< float >array, bool interp=true)
multiplies by a radial function in fourier space.
Definition: emdata.cpp:2677
vector< float > calc_radial_dist(int n, float x0, float dx, int inten)
calculates radial distribution.
Definition: emdata.cpp:2781
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.
Definition: emdata.cpp:2365
void transform(const Transform &t)
Rotate then translate the image.
Definition: emdata.h:295
void cut_slice(const EMData *const map, const Transform &tr, bool interpolate=true)
cut a 2D slice out of a real 3D map.
Definition: emdata.cpp:4018
void add_incoherent(EMData *obj)
Adds 'obj' to 'this' incoherently.
Definition: emdata.cpp:3364
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.
Definition: emdata.cpp:733
EMData * do_radon()
Radon Transform: an algorithm that transforms an original image into a series of equiangular projecti...
Definition: emdata.cpp:1413
EMData * make_footprint(int type=0)
Makes a 'footprint' for the current image.
Definition: emdata.cpp:2035
EMData * oneDfftPolar(int size, float rmax, float MAXR)
Definition: emdata.cpp:4213
Vec3f all_translation
translation from the original location
Definition: emdata.h:854
void set_xyz_origin(float origin_x, float origin_y, float origin_z)
Set the x,y,z origin of the image.
Definition: emdata.cpp:3286
EMData * convolute(EMData *with)
Convolutes 2 data sets.
Definition: emdata.cpp:3567
vector< float > calc_az_dist(int n, float a0, float da, float rmin, float rmax)
Caculates the azimuthal distributions.
Definition: emdata.cpp:2472
float * setup4slice(bool redo=true)
Set up for fftslice operations.
Definition: emdata.cpp:822
EMData * unwrap_largerR(int r1, int r2, int xs, float rmax_f)
Definition: emdata.cpp:4136
EMData * extract_box(const Transform &cs, const Region &r)
Extract a box from EMData in an abritrary orrientation.
Definition: emdata.cpp:4301
void rotate_translate(const Transform &t)
Apply a transformation to the image.
Definition: emdata.h:306
int getResolution() const
function for MarchingCubes, for 3D image display
Definition: emdata.h:766
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...
Definition: emdata.cpp:350
void debug_print_parms()
Printing EMData params for debugging purpose.
Definition: emdata.h:779
size_t nxyz
Definition: emdata.h:849
float calc_dist(EMData *second_img, int y_index=0) const
Calculates the distance between 2 vectors.
Definition: emdata.cpp:3398
int xoff
array index offsets
Definition: emdata.h:851
int zoff
Definition: emdata.h:851
ImageIO classes are designed for reading/writing various electron micrography image formats,...
Definition: imageio.h:127
IntSize is used to describe a 1D, 2D or 3D rectangular size in integers.
Definition: geometry.h:49
Region defines a 2D or 3D rectangular region specified by its origin coordinates and all edges' sizes...
Definition: geometry.h:497
A Transform object is a somewhat specialized object designed specifically for EMAN2/Sparx storage of ...
Definition: transform.h:75
XYData defines a 1D (x,y) data set.
Definition: xydata.h:47
bool is_real() const
Is this a real image?
int get_xsize() const
Get the image x-dimensional size.
void process_inplace(const string &processorname, const Dict &params=Dict())
This file is a part of "emdata.h", to use functions in this file, you should "#include "emdata....
EMData & operator=(const EMData &that)
EMData assignment operator Performs a deep copy.
Definition: emdata.cpp:173
EMData * calc_ccf(EMData *with=0, fp_flag fpflag=CIRCULANT, bool center=false)
Calculate Cross-Correlation Function (CCF).
Definition: emdata.cpp:1499
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.
Definition: emdata.cpp:2596
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.
Definition: emdata.cpp:1628
EMData * make_rotational_footprint(bool unwrap=true)
Makes a 'rotational footprint', which is an 'unwound' autocorrelation function.
Definition: emdata.cpp:1862
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.
void common_lines(EMData *image1, EMData *image2, int mode=0, int steps=180, bool horizontal=false)
Finds common lines between 2 complex images.
Definition: emdata.cpp:3632
void common_lines_real(EMData *image1, EMData *image2, int steps=180, bool horizontal=false)
Finds common lines between 2 real images.
Definition: emdata.cpp:3898
#define ENTERFUNC
Definition: log.h:48
#define EXITFUNC
Definition: log.h:49
E2Exception class.
Definition: aligner.h:40
boost::multi_array_ref< std::complex< float >, 3 > MCArray3D
Definition: emdata.h:71
EMData * operator+(const EMData &em, float n)
Definition: emdata.cpp:3187
boost::multi_array_ref< float, 3 > MArray3D
Definition: emdata.h:69
boost::multi_array_ref< float, 2 > MArray2D
Definition: emdata.h:68
EMData * rdiv(const EMData &em, float n)
Definition: emdata.cpp:3253
EMData * rsub(const EMData &em, float n)
Definition: emdata.cpp:3248
EMData * operator-(const EMData &em, float n)
Definition: emdata.cpp:3194
EMData * operator/(const EMData &em, float n)
Definition: emdata.cpp:3208
EMData * operator*(const EMData &em, float n)
Definition: emdata.cpp:3201
boost::multi_array< int, 3 > MIArray3D
Definition: emdata.h:73
boost::multi_array_ref< std::complex< float >, 2 > MCArray2D
Definition: emdata.h:70
boost::multi_array< int, 2 > MIArray2D
Definition: emdata.h:72