util_sparx.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  sincBlackman
class  KaiserBessel
 1-D Kaiser-Bessel window function class. More...
class  KaiserBessel::kbsinh_win
 Sinh window function object. More...
class  KaiserBessel::kbi0_win
 I0 window function object. More...
class  FakeKaiserBessel
class  Gaussian
 Gaussian function class. More...
struct  tmpstruct

Functions

static int coveig (int n, float *covmat, float *eigval, float *eigvec)
 This file is a part of util.h, To use this file's functions, you should include "util.h" NEVER directly include this file.
static Dict coveig_for_py (int ncov, const vector< float > &covmatpy)
 same function than Util::coveig but wrapped to use directly in python code
static void WTF (EMData *PROJ, vector< float > SS, float SNR, int K)
static void WTM (EMData *PROJ, vector< float > SS, int DIAMETER, int NUMP)
static Dict CANG (float PHI, float THETA, float PSI)
static void BPCQ (EMData *B, EMData *CUBE, const int radius)
static vector< float > infomask (EMData *Vol, EMData *mask, bool)
static void colreverse (float *beg, float *end, int nx)
static void slicereverse (float *beg, float *end, int nx, int ny)
static void cyclicshift (EMData *image, Dict params)
 Performs inplace integer cyclic shift as specified by the "dx","dy","dz" parameters on a 3d volume.
static Dict im_diff (EMData *V1, EMData *V2, EMData *mask=0)
static EMData * TwoDTestFunc (int Size, float p, float q, float a, float b, int flag=0, float alphaDeg=0)
 Creates a Two D Test Pattern.
static void spline_mat (float *x, float *y, int n, float *xq, float *yq, int m)
 Given a tabulated function y of x (n unordered points), and Given the values of the m values xq to be interpolated This routine returns the interpolated array yq, PRB This function is called by splint.
static void spline (float *x, float *y, int n, float yp1, float ypn, float *y2)
 Given a tabulated function y of x (unordered), and Given the values of the first derivatives at the end points This routine returns an array y2, that contains the second derivatives of the function at the tabulated points.
static void splint (float *xa, float *ya, float *y2a, int n, float *xq, float *yq, int m)
 Given the arrays xa(ordered, ya of length n, which tabulate a function and given the array y2a which is the output of spline and an unordered array xq, this routine returns a cubic-spline interpolated array yq.
static void Radialize (int *PermMatTr, float *kValsSorted, float *weightofkvalsSorted, int Size, int *SizeReturned)
 list the sorted lengths of the integer lattice sites of a square sided image of size Size.
static vector< float > even_angles (float delta, float t1=0, float t2=90, float p1=0, float p2=359.999)
 Compute a vector containing quasi-evenly spaced Euler angles.
static float quadri (float x, float y, int nx, int ny, float *image)
 Quadratic interpolation (2D).
static float quadri_background (float x, float y, int nx, int ny, float *image, int xnew, int ynew)
 Quadratic interpolation (2D).
static float get_pixel_conv_new (int nx, int ny, int nz, float delx, float dely, float delz, float *data, Util::KaiserBessel &kb)
static float get_pixel_conv_new_background (int nx, int ny, int nz, float delx, float dely, float delz, float *data, Util::KaiserBessel &kb, int xnew, int ynew)
static std::complex< float > extractpoint2 (int nx, int ny, float nuxnew, float nuynew, EMData *fimage, Util::KaiserBessel &kb)
static float bilinear (float xold, float yold, int nsam, int nrow, float *xim)
static float triquad (float r, float s, float t, float *fdata)
 Quadratic interpolation (3D).
static EMData * Polar2D (EMData *image, vector< int > numr, string mode)
static EMData * Polar2Dm (EMData *image, float cns2, float cnr2, vector< int > numr, string cmode)
static void alrl_ms (float *xim, int nsam, int nrow, float cns2, float cnr2, int *numr, float *circ, int lcirc, int nring, char mode)
static EMData * Polar2Dmi (EMData *image, float cns2, float cnr2, vector< int > numr, string cmode, Util::KaiserBessel &kb)
static void fftr_q (float *xcmplx, int nv)
static void fftr_d (double *xcmplx, int nv)
static void fftc_q (float *br, float *bi, int ln, int ks)
static void fftc_d (double *br, double *bi, int ln, int ks)
static void Frngs (EMData *circ, vector< int > numr)
 This function conducts the Single Precision Fourier Transform for a set of rings.
static void Normalize_ring (EMData *ring, const vector< int > &numr)
static void Frngs_inv (EMData *circ, vector< int > numr)
 This function conducts the Single Precision Inverse Fourier Transform for a set of rings.
static void Applyws (EMData *circ, vector< int > numr, vector< float > wr)
 This is a copy of Applyws routine from alignment.py.
static Dict Crosrng_e (EMData *circ1, EMData *circ2, vector< int > numr, int neg)
static Dict Crosrng_ew (EMData *circ1, EMData *circ2, vector< int > numr, vector< float > w, int neg)
static Dict Crosrng_ms (EMData *circ1, EMData *circ2, vector< int > numr)
static Dict Crosrng_ms_delta (EMData *circ1, EMData *circ2, vector< int > numr, float delta_start, float delta)
static Dict Crosrng_sm_psi (EMData *circ1, EMData *circ2, vector< int > numr, float psi, int flag, float psimax)
 checks either straight or mirrored position depending on flag input - fourier transforms of rings!! circ1 already multiplied by weights!
static Dict Crosrng_psi (EMData *circ1, EMData *circ2, vector< int > numr, float psi, float psimax)
 checks both straight & mirrored position input - fourier transforms of rings!! circ1 already multiplied by weights!
static Dict Crosrng_ns (EMData *circ1, EMData *circ2, vector< int > numr)
 checks both straight & mirrored positions Find only positions within +/-pis_max of 0 and 180 (for helcal use) input - fourier transforms of rings! circ1 already multiplied by weights!
static EMData * Crosrng_msg (EMData *circ1, EMData *circ2, vector< int > numr)
 checks both straight & mirrored positions input - fourier transforms of rings!! circ1 already multiplied by weights! returns EM object with 1D ccf
static void Crosrng_msg_vec (EMData *circ1, EMData *circ2, vector< int > numr, float *q, float *t)
 checks both straight & mirrored positions input - fourier transforms of rings!! circ1 already multiplied by weights! returns EM object with 1D ccf
static EMData * Crosrng_msg_s (EMData *circ1, EMData *circ2, vector< int > numr)
 This program is half of the Crosrng_msg.
static EMData * Crosrng_msg_m (EMData *circ1, EMData *circ2, vector< int > numr)
 This program is half of the Crosrng_msg.
static vector< float > Crosrng_msg_vec_p (EMData *circ1, EMData *circ2, vector< int > numr)
static void prb1d (double *b, int npoint, float *pos)
static void update_fav (EMData *ave, EMData *dat, float tot, int mirror, vector< int > numr)
static void sub_fav (EMData *ave, EMData *dat, float tot, int mirror, vector< int > numr)
static float ener (EMData *ave, vector< int > numr)
static float ener_tot (const vector< EMData * > &data, vector< int > numr, vector< float > tot)
static Dict min_dist_real (EMData *image, const vector< EMData * > &data)
 k-means helper
static Dict min_dist_four (EMData *image, const vector< EMData * > &data)
 helper function for k-means
static int k_means_cont_table_ (int *group1, int *group2, int *stb, long int s1, long int s2, int flag)
 helper to create the contengency table for partition matching (k-means) flag define is the list of stable obj must be store to stb, but the size st must be know before.
static void initial_prune (vector< vector< int * > > &Parts, int *dimClasses, int nParts, int K, int T)
 initial_prune removes all classes C from Parts where there does not exist ANY feasible matching containing class C which has weight gt T.
static bool explore (vector< vector< int * > > &Parts, int *dimClasses, int nParts, int K, int T, int partref, int *curintx, int size_curintx, int *next, int size_next, int depth)
 Each class in Parts has its dummy variable set to 0 or 1.
static int generatesubmax (int *argParts, int *Indices, int *dimClasses, int nParts, int K, int T, int n_guesses, int LARGEST_CLASS)
 make an intelligent "guess" at the largest weight of all possible feasible matches.
static void search2 (int *argParts, int *Indices, int *dimClasses, int nParts, int K, int T, int *matchlist, int *costlist, int J)
 return the weight of the largest weighted feasible match, along with the match in the (preallocated) argument curmax.
static void explore2 (int *argParts, int *Indices, int *dimClasses, int nParts, int K, int T, int *curintx, int size_curintx, int *next, int size_next, int depth, int J, int *matchlist, int *costlist, int *curbranch)
static bool sanitycheck (int *argParts, int *Indices, int *dimClasses, int nParts, int K, int T, int *output)
 First element of output is total cost of the matches in the output Second element of output is the total number of matches in output So output has 2+(*(output+1))nParts elements.
static vector< int > bb_enumerateMPI_ (int *argParts, int *dimClasses, int nParts, int K, int T, int n_guesses, int LARGEST_CLASS, int J, int max_branching, float stmult, int branchfunc, int LIM)
 K is the number of classes in each partition (should be the same for all partitions) the first element of each class is its original index in the partition, and second is dummy var MPI: if nTop <= 0, then initial prune is called, and the pruned partitions are returned in a 1D array.
static int * branchMPI (int *argParts, int *Indices, int *dimClasses, int nParts, int K, int T, int curlevel, int n_guesses, int LARGEST_CLASS, int J, int max_branching, float stmult, int branchfunc, int LIM)
 same as branch except the nFirst (=Levels[0]) possibilites for the first match are already chosen firstmatches stores the matches and corresponding cost, where each match is preceded by its cost.
static int branch_factor_0 (int *costlist, int *matchlist, int J, int T, int nParts, int curlevel, int max_branching, int LIM)
static int branch_factor_2 (int *costlist, int *matchlist, int J, int T, int nParts, int curlevel, int max_branching, int LIM)
static int branch_factor_3 (int *costlist, int *matchlist, int J, int T, int nParts, int curlevel, int max_branching, int K, int LIM)
static int branch_factor_4 (int *costlist, int *matchlist, int J, int T, int nParts, int curlevel, int max_branching, float stmult)
static vector< double > cml_weights (const vector< float > &cml)
static vector< int > cml_line_insino (vector< float > Rot, int i_prj, int n_prj)
 2009-03-25 15:35:53 JB.
static vector< int > cml_line_insino_all (vector< float > Rot, vector< int > seq, int n_prj, int n_lines)
 2009-03-30 15:35:07 JB.
static vector< double > cml_init_rot (vector< float > Ori)
 2009-03-25 15:35:05 JB.
static vector< float > cml_update_rot (vector< float > Rot, int iprj, float nph, float th, float nps)
 2009-03-25 15:35:37 JB.
static vector< double > cml_line_in3d (vector< float > Ori, vector< int > seq, int nprj, int nlines)
 2009-03-26 10:46:14 JB.
static vector< double > cml_spin_psi (const vector< EMData * > &data, vector< int > com, vector< float > weights, int iprj, vector< int > iw, int n_psi, int d_psi, int n_prj)
 2009-03-26 11:37:53 JB.
static vector< double > cml_spin_psi_now (const vector< EMData * > &data, vector< int > com, int iprj, vector< int > iw, int n_psi, int d_psi, int n_prj)
static double cml_disc (const vector< EMData * > &data, vector< int > com, vector< int > seq, vector< float > weights, int n_lines)
 2009-03-30 15:44:05 JB.
static void set_line (EMData *img, int posline, EMData *line, int offset, int length)
 This function drop a line (line) to an 2D image (img).
static void cml_prepare_line (EMData *sino, EMData *line, int ilf, int ihf, int pos_line, int nblines)
 This function prepare the line from sinogram by cutting off some frequencies, and creating the mirror part (complexe conjugate of the first part).
static EMData * decimate (EMData *img, int x_step, int y_step=1, int z_step=1)
static EMData * window (EMData *img, int new_nx, int new_ny=1, int new_nz=1, int x_offset=0, int y_offset=0, int z_offset=0)
static EMData * pad (EMData *img, int new_nx, int new_ny=1, int new_nz=1, int x_offset=0, int y_offset=0, int z_offset=0, const char *params="average")
static vector< float > histogram (EMData *image, EMData *mask, int nbins=128, float hmin=0.0f, float hmax=0.0f)
static Dict histc (EMData *ref, EMData *img, EMData *mask)
static float hist_comp_freq (float PA, float PB, size_t size_img, int hist_len, EMData *img, vector< float > ref_freq_hist, EMData *mask, float ref_h_diff, float ref_h_min)
static float tf (float dzz, float ak, float voltage=300.0f, float cs=2.0f, float wgh=0.1f, float b_factor=0.0f, float sign=-1.0f)
static EMData * compress_image_mask (EMData *image, EMData *mask)
static EMData * reconstitute_image_mask (EMData *image, EMData *mask)
 Recreates a n-d image using its compressed 1-D form and the mask.
static vector< float > merge_peaks (vector< float > peak1, vector< float > peak2, float p_size)
static vector< float > pw_extract (vector< float >pw, int n, int iswi, float ps)
static vector< float > call_cl1 (long int *k, long int *n, float *ps, long int *iswi, float *pw, float *q2, double *q, double *x, double *res, double *cu, double *s, long int *iu)
static vector< float > lsfit (long int *ks, long int *n, long int *klm2d, long int *iswi, float *q1, double *q, double *x, double *res, double *cu, double *s, long int *iu)
static void cl1 (long int *k, long int *l, long int *m, long int *n, long int *klm2d, double *q, double *x, double *res, double *cu, long int *iu, double *s)
static float eval (char *images, EMData *img, vector< int > S, int N, int K, int size)
static vector< double > vrdg (const vector< float > &ph, const vector< float > &th)
static void hsortd (double *theta, double *phi, int *key, int len, int option)
static void voronoidiag (double *theta, double *phi, double *weight, int n)
static void voronoi (double *phi, double *theta, double *weight, int nt)
static void disorder2 (double *x, double *y, int *key, int len)
static void ang_to_xyz (double *x, double *y, double *z, int len)
static void flip23 (double *x, double *y, double *z, int *key, int k, int len)
static bool cmp1 (tmpstruct tmp1, tmpstruct tmp2)
static bool cmp2 (tmpstruct tmp1, tmpstruct tmp2)
static int trmsh3_ (int *n0, double *tol, double *x, double *y, double *z__, int *n, int *list, int *lptr, int *lend, int *lnew, int *indx, int *lcnt, int *near__, int *next, double *dist, int *ier)
static double areav_ (int *k, int *n, double *x, double *y, double *z__, int *list, int *lptr, int *lend, int *ier)
static EMData * madn_scalar (EMData *img, EMData *img1, float scalar)
static EMData * mult_scalar (EMData *img, float scalar)
static EMData * addn_img (EMData *img, EMData *img1)
static EMData * subn_img (EMData *img, EMData *img1)
static EMData * muln_img (EMData *img, EMData *img1)
static EMData * divn_img (EMData *img, EMData *img1)
static EMData * divn_filter (EMData *img, EMData *img1)
static void mad_scalar (EMData *img, EMData *img1, float scalar)
static void mul_scalar (EMData *img, float scalar)
static void add_img (EMData *img, EMData *img1)
static void add_img_abs (EMData *img, EMData *img1)
static void add_img2 (EMData *img, EMData *img1)
static void sub_img (EMData *img, EMData *img1)
static void mul_img (EMData *img, EMData *img1)
static void div_img (EMData *img, EMData *img1)
static void div_filter (EMData *img, EMData *img1)
static EMData * pack_complex_to_real (EMData *img)
static float ang_n (float peakp, string mode, int maxrin)
static vector< float > multiref_polar_ali_2d (EMData *image, const vector< EMData * > &crefim, float xrng, float yrng, float step, string mode, vector< int >numr, float cnx, float cny)
 formerly known as apmq Determine shift and rotation between image and many reference images (crefim, weights have to be applied) quadratic interpolation
static vector< float > multiref_polar_ali_2d_peaklist (EMData *image, const vector< EMData * > &crefim, float xrng, float yrng, float step, string mode, vector< int >numr, float cnx, float cny)
static vector< int > assign_groups (std::string matrix_address, int nref, int nima)
static void getvec (float phi, float theta, float &x, float &y, float &z, int option=0)
static float ang_diff (float v11, float v12, float v13, float v21, float v22, float v23, int &mirror)
static int nearest_ang (const vector< float > &vecref, float x, float y, float z)
static vector< int > assign_projangles (const vector< float > &projangles, const vector< float > &refangles)
static vector< int > nearestk_to_refdir (const vector< float > &projangles, const vector< float > &refangles, const int howmany)
static vector< int > group_proj_by_phitheta (const vector< float > &projangles, const vector< float > &ref_ang, const int img_per_grp)
static vector< float > multiref_polar_ali_2d_delta (EMData *image, const vector< EMData * > &crefim, float xrng, float yrng, float step, string mode, vector< int >numr, float cnx, float cny, float delta_start, float delta)
 formerly known as apmq Determine shift and rotation between image and many reference images (crefim, weights have to be applied) quadratic interpolation
static vector< float > multiref_polar_ali_2d_nom (EMData *image, const vector< EMData * > &crefim, float xrng, float yrng, float step, string mode, vector< int >numr, float cnx, float cny)
 formerly known as apnq DO NOT CONSIDER MIRROR Determine shift and rotation between image and many reference images (crefim, weights have to be applied) quadratic interpolation
static vector< float > multiref_polar_ali_2d_local (EMData *image, const vector< EMData * > &crefim, float xrng, float yrng, float step, float ant, string mode, vector< int >numr, float cnx, float cny)
 formerly known as apmq Determine shift and rotation between image and many reference images (crefim, weights have to be applied) quadratic interpolation
static vector< float > hans (EMData *image, const vector< EMData * > &crefim, float xrng, float yrng, float step, float ant, string mode, vector< int >numr, float cnx, float cny)
static vector< float > multiref_polar_ali_helical (EMData *image, const vector< EMData * > &crefim, float xrng, float yrng, float step, float psi_max, string mode, vector< int >numr, float cnx, float cny, int ynumber=-1)
 formerly known as apmq Determine shift and rotation between image and many reference images (crefim, weights have to be applied) quadratic interpolation Search for peaks only within +/-psi_max from 0 and 180 (helical)
static vector< float > multiref_polar_ali_helical_local (EMData *image, const vector< EMData * > &crefim, float xrng, float yrng, float step, float ant, float psi_max, string mode, vector< int >numr, float cnx, float cny, int ynumber=-1, float yrnglocal=-1.0)
static vector< float > multiref_polar_ali_helical_90 (EMData *image, const vector< EMData * > &crefim, float xrng, float yrng, float step, float psi_max, string mode, vector< int >numr, float cnx, float cny, int ynumber=-1)
static vector< float > multiref_polar_ali_helical_90_local (EMData *image, const vector< EMData * > &crefim, float xrng, float yrng, float step, float ant, float psi_max, string mode, vector< int >numr, float cnx, float cny, int ynumber=-1, float yrnglocal=-1.0)
static vector< float > multiref_polar_ali_2d_local_psi (EMData *image, const vector< EMData * > &crefim, float xrng, float yrng, float step, float ant, float psi_max, string mode, vector< int >numr, float cnx, float cny)
 formerly known as apmq Determine shift and rotation between image and many reference images (crefim, weights have to be applied) quadratic interpolation
static void multiref_peaks_ali2d (EMData *image, EMData *crefim, float xrng, float yrng, float step, string mode, vector< int >numr, float cnx, float cny, EMData *peaks, EMData *peakm)
 Determine shift and rotation between image and one reference image (crefim, weights have to be applied) using quadratic interpolation, return a list of peaks PAP 07/21/08.
static void multiref_peaks_compress_ali2d (EMData *image, EMData *crefim, float xrng, float yrng, float step, string mode, vector< int >numr, float cnx, float cny, EMData *peaks, EMData *peakm, EMData *peaks_compress, EMData *peakm_compress)
 Determine shift and rotation between image and one reference image (crefim, weights have to be applied) using quadratic interpolation, return a list of peaks PAP 07/21/08.
static vector< float > ali2d_ccf_list (EMData *image, EMData *crefim, float xrng, float yrng, float step, string mode, vector< int >numr, float cnx, float cny, double T)
 Determine shift and rotation between image and one reference image (crefim, weights have to be applied) using quadratic interpolation.
static vector< float > twoD_fine_ali (EMData *image, EMData *refim, EMData *mask, float ang, float sxs, float sys)
static vector< float > twoD_fine_ali_G (EMData *image, EMData *refim, EMData *mask, Util::KaiserBessel &kb, float ang, float sxs, float sys)
static vector< float > twoD_to_3D_ali (EMData *volft, Util::KaiserBessel &kb, EMData *refim, EMData *mask, float phi, float theta, float psi, float sxs, float sxy)
static vector< float > twoD_fine_ali_SD (EMData *image, EMData *refim, EMData *mask, float ang, float sxs, float sys)
static float ccc_images (EMData *, EMData *, EMData *, float, float, float)
static vector< float > twoD_fine_ali_SD_G (EMData *image, EMData *refim, EMData *mask, Util::KaiserBessel &kb, float ang, float sxs, float sys)
static float ccc_images_G (EMData *image, EMData *refim, EMData *mask, Util::KaiserBessel &kb, float ang, float sx, float sy)
static EMData * move_points (EMData *img, float qprob, int ri, int ro)
static EMData * get_biggest_cluster (EMData *mg)
static EMData * ctf_img (int nx, int ny, int nz, float dz, float ps, float voltage, float cs, float wgh, float b_factor, float dza, float azz, float sign)
static EMData * ctf_rimg (int nx, int ny, int nz, float dz, float ps, float voltage, float cs, float wgh, float b_factor, float dza, float azz, float sign)
static EMData * ctf2_rimg (int nx, int ny, int nz, float dz, float ps, float voltage, float cs, float wgh, float b_factor, float dza, float azz, float sign)
static int mono (int k1, int k2)
static int nint180 (float arg)
static double mean (double *x, int n)
static double var (double *x, int n)
static vector< float > multi_align_error (vector< float > args, vector< float > all_ali_params, int d)
static double multi_align_error_func (double *x, vector< float > all_ali_params, int nima, int num_ali, int d)
static vector< double > multi_align_error_func2 (double *x, vector< float > all_ali_params, int nima, int num_ali, int d)
static void multi_align_error_dfunc (double *x, vector< float > all_ali_params, int nima, int num_ali, double *g, int d)
static vector< float > cluster_pairwise (EMData *d, int K, float T, float F)
static vector< float > cluster_equalsize (EMData *d)
static vector< float > vareas (EMData *d)
static EMData * get_slice (EMData *vol, int dim, int index)
 This function returns a 2-D slice from a 3-D EMData object dim denotes the slice is perpendicular to which dimension 1 for x-dimension, 2 for y-dimension and 3 for z-dimension.
static void image_mutation (EMData *img, float mutation_rate)
static void array_mutation (float *list, int len_list, float mutation_rate, float min_val, float max_val, int K, int is_mirror)
 The purpose of this function is to convert a list to grey code and mutate them and convert them back.
static vector< float > list_mutation (vector< float > list, float mutation_rate, float min_val, float max_val, int K, int is_mirror)
static float restrict1 (float x, int nx)
static Dict get_transform_params (EMData *image, string xform, string convention)
 This function returns parameters from Transform object as a Dict object.
static void constrained_helix (vector< EMData * > data, vector< EMData * > fdata, vector< EMData * > refproj, vector< EMData * > rotproj, vector< float > dp_dphi_rise_delta, vector< int > nphi_phiwobble_range_ywobble_Dsym_nwx_nwy_nwxc_nwyc, bool FindPsi, float psi_max, vector< EMData * > crefim, vector< int > numr, int maxrin, string mode, int cnx, int cny)
static void constrained_helix_test (vector< EMData * > data, vector< EMData * > fdata, vector< EMData * > refproj, vector< EMData * > rotproj, vector< float > dp_dphi_rise_delta, vector< int > nphi_phiwobble_range_ywobble_Dsym_nwx_nwy_nwxc_nwyc, bool FindPsi, float psi_max, vector< EMData * > crefim, vector< int > numr, int maxrin, string mode, int cnx, int cny)
static Dict predict (float phig, float yg, float dst, float sgn, float ysgn, float dpp, float dphi, bool backpred)


Function Documentation

static void add_img ( EMData *  img,
EMData *  img1 
) [static]

static void add_img2 ( EMData *  img,
EMData *  img1 
) [static]

static void add_img_abs ( EMData *  img,
EMData *  img1 
) [static]

static EMData* addn_img ( EMData *  img,
EMData *  img1 
) [static]

static vector<float> ali2d_ccf_list ( EMData *  image,
EMData *  crefim,
float  xrng,
float  yrng,
float  step,
string  mode,
vector< int >  numr,
float  cnx,
float  cny,
double  T 
) [static]

Determine shift and rotation between image and one reference image (crefim, weights have to be applied) using quadratic interpolation.

static void alrl_ms ( float *  xim,
int  nsam,
int  nrow,
float  cns2,
float  cnr2,
int *  numr,
float *  circ,
int  lcirc,
int  nring,
char  mode 
) [static]

static float ang_diff ( float  v11,
float  v12,
float  v13,
float  v21,
float  v22,
float  v23,
int &  mirror 
) [inline, static]

Definition at line 872 of file util_sparx.h.

References v.

00872                                                                                                                     {
00873                 float v = v11*v21+v12*v22+v13*v23;
00874                 if (v > 1) v = 1;
00875                 if (v < -1) v = -1;
00876                 if (v > 0) { mirror = 1; return acos(v)*180.0f/M_PI; }
00877                 else { mirror = -1; return acos(-v)*180.0f/M_PI; }
00878         }

static float ang_n ( float  peakp,
string  mode,
int  maxrin 
) [static, private]

Referenced by aprq2d().

static void ang_to_xyz ( double *  x,
double *  y,
double *  z,
int  len 
) [static]

Referenced by EMAN::Util::voronoi().

static void Applyws ( EMData *  circ,
vector< int >  numr,
vector< float >  wr 
) [static]

This is a copy of Applyws routine from alignment.py.

static double areav_ ( int *  k,
int *  n,
double *  x,
double *  y,
double *  z__,
int *  list,
int *  lptr,
int *  lend,
int *  ier 
) [static]

static void array_mutation ( float *  list,
int  len_list,
float  mutation_rate,
float  min_val,
float  max_val,
int  K,
int  is_mirror 
) [static]

The purpose of this function is to convert a list to grey code and mutate them and convert them back.

static vector<int> assign_groups ( std::string  matrix_address,
int  nref,
int  nima 
) [static]

static vector<int> assign_projangles ( const vector< float > &  projangles,
const vector< float > &  refangles 
) [static]

static vector<int> bb_enumerateMPI_ ( int *  argParts,
int *  dimClasses,
int  nParts,
int  K,
int  T,
int  n_guesses,
int  LARGEST_CLASS,
int  J,
int  max_branching,
float  stmult,
int  branchfunc,
int  LIM 
) [static]

K is the number of classes in each partition (should be the same for all partitions) the first element of each class is its original index in the partition, and second is dummy var MPI: if nTop <= 0, then initial prune is called, and the pruned partitions are returned in a 1D array.

The first element is reserved for max_levels (the size of the smallest partition after pruning). if nTop > 0, then partitions are assumed to have been pruned, where only dummy variables of un-pruned partitions are set to 1, and findTopLargest is called to find the top weighted matches. The matches, where each match is preceded by its cost, is returned in a one dimensional vector.

essentially the same as bb_enumerate but with the option to do mpi version.

static float bilinear ( float  xold,
float  yold,
int  nsam,
int  nrow,
float *  xim 
) [static]

static void BPCQ ( EMData *  B,
EMData *  CUBE,
const int  radius 
) [static]

static int branch_factor_0 ( int *  costlist,
int *  matchlist,
int  J,
int  T,
int  nParts,
int  curlevel,
int  max_branching,
int  LIM 
) [static]

static int branch_factor_2 ( int *  costlist,
int *  matchlist,
int  J,
int  T,
int  nParts,
int  curlevel,
int  max_branching,
int  LIM 
) [static]

static int branch_factor_3 ( int *  costlist,
int *  matchlist,
int  J,
int  T,
int  nParts,
int  curlevel,
int  max_branching,
int  K,
int  LIM 
) [static]

static int branch_factor_4 ( int *  costlist,
int *  matchlist,
int  J,
int  T,
int  nParts,
int  curlevel,
int  max_branching,
float  stmult 
) [static]

static int* branchMPI ( int *  argParts,
int *  Indices,
int *  dimClasses,
int  nParts,
int  K,
int  T,
int  curlevel,
int  n_guesses,
int  LARGEST_CLASS,
int  J,
int  max_branching,
float  stmult,
int  branchfunc,
int  LIM 
) [static]

same as branch except the nFirst (=Levels[0]) possibilites for the first match are already chosen firstmatches stores the matches and corresponding cost, where each match is preceded by its cost.

... output is an int array, the first element is the cost of the output solution, the second element is the total number of matches in the solution and the rest is the list of matches. output is in one dimensional form.

Referenced by EMAN::Util::bb_enumerateMPI_(), and EMAN::Util::branchMPI().

static vector<float> call_cl1 ( long int *  k,
long int *  n,
float *  ps,
long int *  iswi,
float *  pw,
float *  q2,
double *  q,
double *  x,
double *  res,
double *  cu,
double *  s,
long int *  iu 
) [static]

Referenced by EMAN::Util::pw_extract().

static Dict CANG ( float  PHI,
float  THETA,
float  PSI 
) [static]

static float ccc_images ( EMData *  ,
EMData *  ,
EMData *  ,
float  ,
float  ,
float   
) [static]

static float ccc_images_G ( EMData *  image,
EMData *  refim,
EMData *  mask,
Util::KaiserBessel &  kb,
float  ang,
float  sx,
float  sy 
) [static]

static void cl1 ( long int *  k,
long int *  l,
long int *  m,
long int *  n,
long int *  klm2d,
double *  q,
double *  x,
double *  res,
double *  cu,
long int *  iu,
double *  s 
) [static]

Referenced by EMAN::Util::lsfit().

static vector<float> cluster_equalsize ( EMData *  d  )  [static]

static vector<float> cluster_pairwise ( EMData *  d,
int  K,
float  T,
float  F 
) [static]

static double cml_disc ( const vector< EMData * > &  data,
vector< int >  com,
vector< int >  seq,
vector< float >  weights,
int  n_lines 
) [static]

2009-03-30 15:44:05 JB.

Compute the discrepancy belong all common-lines

static vector<double> cml_init_rot ( vector< float >  Ori  )  [static]

2009-03-25 15:35:05 JB.

This function prepare rotation matrix for common-lines

static vector<double> cml_line_in3d ( vector< float >  Ori,
vector< int >  seq,
int  nprj,
int  nlines 
) [static]

2009-03-26 10:46:14 JB.

This function calculate all common-lines in space for Voronoi

static vector<int> cml_line_insino ( vector< float >  Rot,
int  i_prj,
int  n_prj 
) [static]

2009-03-25 15:35:53 JB.

This function calculates common-lines between sinogram

static vector<int> cml_line_insino_all ( vector< float >  Rot,
vector< int >  seq,
int  n_prj,
int  n_lines 
) [static]

2009-03-30 15:35:07 JB.

This function calculates all common-lines between sinogram

static void cml_prepare_line ( EMData *  sino,
EMData *  line,
int  ilf,
int  ihf,
int  pos_line,
int  nblines 
) [static]

This function prepare the line from sinogram by cutting off some frequencies, and creating the mirror part (complexe conjugate of the first part).

Then both lines (mirror and without) are drop to the sinogram. line is in Fourrier space, ilf low frequency, ihf high frequency, nblines number of lines of the half sinogram (the non miror part), sino the sinogram, pos_line the position of the line in the sino.

static vector<double> cml_spin_psi ( const vector< EMData * > &  data,
vector< int >  com,
vector< float >  weights,
int  iprj,
vector< int >  iw,
int  n_psi,
int  d_psi,
int  n_prj 
) [static]

2009-03-26 11:37:53 JB.

This function spin all angle psi and evaluate the partial discrepancy belong common-lines

static vector<double> cml_spin_psi_now ( const vector< EMData * > &  data,
vector< int >  com,
int  iprj,
vector< int >  iw,
int  n_psi,
int  d_psi,
int  n_prj 
) [static]

static vector<float> cml_update_rot ( vector< float >  Rot,
int  iprj,
float  nph,
float  th,
float  nps 
) [static]

2009-03-25 15:35:37 JB.

this function update only one rotation amtrix according a new orientation

static vector<double> cml_weights ( const vector< float > &  cml  )  [static]

static bool cmp1 ( tmpstruct  tmp1,
tmpstruct  tmp2 
) [static]

Referenced by EMAN::RotateFlipAlignerIterative::align(), EMAN::RotateFlipAligner::align(), EMAN::RotateTranslateFlipAlignerIterative::align(), EMAN::RotateTranslateFlipAligner::align(), and EMAN::RotateTranslateAligner::align().

static bool cmp2 ( tmpstruct  tmp1,
tmpstruct  tmp2 
) [static]

Referenced by EMAN::RotateFlipAlignerIterative::align(), EMAN::RotateFlipAligner::align(), EMAN::RotateTranslateFlipAlignerIterative::align(), EMAN::RotateTranslateFlipAligner::align(), and EMAN::RotateTranslateAligner::align().

static void colreverse ( float *  beg,
float *  end,
int  nx 
) [static]

static EMData* compress_image_mask ( EMData *  image,
EMData *  mask 
) [static]

Referenced by EMAN::PCA::dopca_ooc(), EMAN::varimax::insert_image(), EMAN::PCAlarge::insert_image(), EMAN::PCAsmall::insert_image(), EMAN::varimax::set_params(), EMAN::PCAlarge::set_params(), and EMAN::PCAsmall::set_params().

static void constrained_helix ( vector< EMData * >  data,
vector< EMData * >  fdata,
vector< EMData * >  refproj,
vector< EMData * >  rotproj,
vector< float >  dp_dphi_rise_delta,
vector< int >  nphi_phiwobble_range_ywobble_Dsym_nwx_nwy_nwxc_nwyc,
bool  FindPsi,
float  psi_max,
vector< EMData * >  crefim,
vector< int >  numr,
int  maxrin,
string  mode,
int  cnx,
int  cny 
) [static]

static void constrained_helix_test ( vector< EMData * >  data,
vector< EMData * >  fdata,
vector< EMData * >  refproj,
vector< EMData * >  rotproj,
vector< float >  dp_dphi_rise_delta,
vector< int >  nphi_phiwobble_range_ywobble_Dsym_nwx_nwy_nwxc_nwyc,
bool  FindPsi,
float  psi_max,
vector< EMData * >  crefim,
vector< int >  numr,
int  maxrin,
string  mode,
int  cnx,
int  cny 
) [static]

static int coveig ( int  n,
float *  covmat,
float *  eigval,
float *  eigvec 
) [static]

This file is a part of util.h, To use this file's functions, you should include "util.h" NEVER directly include this file.

Referenced by EMAN::PCAsmall::analyze(), and EMAN::Util::coveig_for_py().

static Dict coveig_for_py ( int  ncov,
const vector< float > &  covmatpy 
) [static]

same function than Util::coveig but wrapped to use directly in python code

static Dict Crosrng_e ( EMData *  circ1,
EMData *  circ2,
vector< int >  numr,
int  neg 
) [static]

static Dict Crosrng_ew ( EMData *  circ1,
EMData *  circ2,
vector< int >  numr,
vector< float >  w,
int  neg 
) [static]

static Dict Crosrng_ms ( EMData *  circ1,
EMData *  circ2,
vector< int >  numr 
) [static]

static Dict Crosrng_ms_delta ( EMData *  circ1,
EMData *  circ2,
vector< int >  numr,
float  delta_start,
float  delta 
) [static]

static EMData* Crosrng_msg ( EMData *  circ1,
EMData *  circ2,
vector< int >  numr 
) [static]

checks both straight & mirrored positions input - fourier transforms of rings!! circ1 already multiplied by weights! returns EM object with 1D ccf

static EMData* Crosrng_msg_m ( EMData *  circ1,
EMData *  circ2,
vector< int >  numr 
) [static]

This program is half of the Crosrng_msg.

It only checks mirrored position. input - fourier transforms of rings!! circ1 already multiplied by weights! returns EM object with 1D ccf

static EMData* Crosrng_msg_s ( EMData *  circ1,
EMData *  circ2,
vector< int >  numr 
) [static]

This program is half of the Crosrng_msg.

It only checks straight position. input - fourier transforms of rings!! circ1 already multiplied by weights! returns EM object with 1D ccf

static void Crosrng_msg_vec ( EMData *  circ1,
EMData *  circ2,
vector< int >  numr,
float *  q,
float *  t 
) [static]

checks both straight & mirrored positions input - fourier transforms of rings!! circ1 already multiplied by weights! returns EM object with 1D ccf

static vector<float> Crosrng_msg_vec_p ( EMData *  circ1,
EMData *  circ2,
vector< int >  numr 
) [static]

static Dict Crosrng_ns ( EMData *  circ1,
EMData *  circ2,
vector< int >  numr 
) [static]

checks both straight & mirrored positions Find only positions within +/-pis_max of 0 and 180 (for helcal use) input - fourier transforms of rings! circ1 already multiplied by weights!

static Dict Crosrng_psi ( EMData *  circ1,
EMData *  circ2,
vector< int >  numr,
float  psi,
float  psimax 
) [static]

checks both straight & mirrored position input - fourier transforms of rings!! circ1 already multiplied by weights!

static Dict Crosrng_sm_psi ( EMData *  circ1,
EMData *  circ2,
vector< int >  numr,
float  psi,
int  flag,
float  psimax 
) [static]

checks either straight or mirrored position depending on flag input - fourier transforms of rings!! circ1 already multiplied by weights!

static EMData* ctf2_rimg ( int  nx,
int  ny,
int  nz,
float  dz,
float  ps,
float  voltage,
float  cs,
float  wgh,
float  b_factor,
float  dza,
float  azz,
float  sign 
) [static]

static EMData* ctf_img ( int  nx,
int  ny,
int  nz,
float  dz,
float  ps,
float  voltage,
float  cs,
float  wgh,
float  b_factor,
float  dza,
float  azz,
float  sign 
) [static]

static EMData* ctf_rimg ( int  nx,
int  ny,
int  nz,
float  dz,
float  ps,
float  voltage,
float  cs,
float  wgh,
float  b_factor,
float  dza,
float  azz,
float  sign 
) [static]

static void cyclicshift ( EMData *  image,
Dict  params 
) [static]

Performs inplace integer cyclic shift as specified by the "dx","dy","dz" parameters on a 3d volume.

Implements the inplace swapping using reversals as descibed in also: http://www.csse.monash.edu.au/~lloyd/tildeAlgDS/Intro/Eg01/

Author:
Phani Ivatury
Date:
18-2006
See also:
http://www.csse.monash.edu.au/~lloyd/tildeAlgDS/Intro/Eg01/
A[0] A[1] A[2] A[3] A[4] A[5] A[6] A[7] A[8] A[9]

10 20 30 40 50 60 70 80 90 100 ------------ m = 3 (shift left three places)

Reverse the items from 0..m-1 and m..N-1:

30 20 10 100 90 80 70 60 50 40

Now reverse the entire sequence:

40 50 60 70 80 90 100 10 20 30

cycl_shift() in libpy/fundementals.py calls this function

Usage: EMData *im1 = new EMData(); im1->set_size(70,80,85); im1->to_one(); Dict params; params["dx"] = 10;params["dy"] = 10000;params["dz"] = -10; Utils::cyclicshift(im1,params); im1.peak_search(1,1)

static EMData* decimate ( EMData *  img,
int  x_step,
int  y_step = 1,
int  z_step = 1 
) [static]

static void disorder2 ( double *  x,
double *  y,
int *  key,
int  len 
) [static]

Referenced by EMAN::Util::voronoi().

static void div_filter ( EMData *  img,
EMData *  img1 
) [static]

static void div_img ( EMData *  img,
EMData *  img1 
) [static]

static EMData* divn_filter ( EMData *  img,
EMData *  img1 
) [static]

static EMData* divn_img ( EMData *  img,
EMData *  img1 
) [static]

static float ener ( EMData *  ave,
vector< int >  numr 
) [static]

static float ener_tot ( const vector< EMData * > &  data,
vector< int >  numr,
vector< float >  tot 
) [static]

static float eval ( char *  images,
EMData *  img,
vector< int >  S,
int  N,
int  K,
int  size 
) [static]

static vector<float> even_angles ( float  delta,
float  t1 = 0,
float  t2 = 90,
float  p1 = 0,
float  p2 = 359.999 
) [static]

Compute a vector containing quasi-evenly spaced Euler angles.

The order of angles in the vector is phi, theta, psi.

Parameters:
[in] delta Delta theta (spacing in theta).
[in] t1 Starting (min) value of theta in degrees, default = 0.
[in] t2 Ending (max) value of theta in degrees, default = 90.
[in] p1 Starting (min) value of phi in degrees, default = 0.
[in] p2 Ending (max) value of phi in degrees, default = 359.9.
Returns:
Vector of angles as a flat list of phi_0, theta_0, psi_0, ..., phi_N, theta_N, psi_N.

Referenced by ali3d_d().

static bool explore ( vector< vector< int * > > &  Parts,
int *  dimClasses,
int  nParts,
int  K,
int  T,
int  partref,
int *  curintx,
int  size_curintx,
int *  next,
int  size_next,
int  depth 
) [static]

Each class in Parts has its dummy variable set to 0 or 1.

Only consider those with its dummy variable set to 1 (the 'active' ones) First element of each class is its original index, second is the dummy variable slot.

static void explore2 ( int *  argParts,
int *  Indices,
int *  dimClasses,
int  nParts,
int  K,
int  T,
int *  curintx,
int  size_curintx,
int *  next,
int  size_next,
int  depth,
int  J,
int *  matchlist,
int *  costlist,
int *  curbranch 
) [static]

Referenced by EMAN::Util::explore2(), and EMAN::Util::search2().

static std::complex<float> extractpoint2 ( int  nx,
int  ny,
float  nuxnew,
float  nuynew,
EMData *  fimage,
Util::KaiserBessel &  kb 
) [static]

static void fftc_d ( double *  br,
double *  bi,
int  ln,
int  ks 
) [static]

Definition at line 366 of file spidfft.cpp.

Referenced by fftr_d().

00367 {
00368    double rni,sgn,tr1,tr2,ti1,ti2;
00369    double cc,c,ss,s,t,x2,x3,x4,x5;
00370    int    b3,b4,b5,b6,b7,b56;
00371    int    n, k, l, j, i, ix0, ix1, status=0; 
00372    double tab1[15];
00373 
00374    tab1(1)=9.58737990959775e-5;
00375    tab1(2)=1.91747597310703e-4;
00376    tab1(3)=3.83495187571395e-4;
00377    tab1(4)=7.66990318742704e-4;
00378    tab1(5)=1.53398018628476e-3;
00379    tab1(6)=3.06795676296598e-3;
00380    tab1(7)=6.13588464915449e-3;
00381    tab1(8)=1.22715382857199e-2;
00382    tab1(9)=2.45412285229123e-2;
00383    tab1(10)=4.90676743274181e-2;
00384    tab1(11)=9.80171403295604e-2;
00385    tab1(12)=1.95090322016128e-1;
00386    tab1(13)=3.82683432365090e-1;
00387    tab1(14)=7.07106781186546e-1;
00388    tab1(15)=1.00000000000000;
00389 
00390    n=(int)pow(2,ln);
00391 
00392    k=abs(ks);
00393    l=16-ln;
00394    b3=n*k;
00395    b6=b3;
00396    b7=k;
00397    if (ks > 0) {
00398       sgn=1.0;
00399    }
00400    else {
00401       sgn=-1.0;
00402       rni=1.0/(float)(n);
00403       j=1;
00404       for (i=1;i<=n;i++) {
00405          br(j)=br(j)*rni;
00406          bi(j)=bi(j)*rni;
00407          j=j+k;
00408       }
00409    }
00410 
00411 L12:
00412    b6=b6/2;
00413    b5=b6;
00414    b4=2*b6;
00415    b56=b5-b6;
00416 
00417 L14:
00418    tr1=br(b5+1);
00419    ti1=bi(b5+1);
00420    tr2=br(b56+1);
00421    ti2=bi(b56+1);
00422 
00423    br(b5+1)=tr2-tr1;
00424    bi(b5+1)=ti2-ti1;
00425    br(b56+1)=tr1+tr2;
00426    bi(b56+1)=ti1+ti2;
00427 
00428    b5=b5+b4;
00429    b56=b5-b6;
00430    if ( b5 <= b3 )  goto  L14;
00431    if ( b6 == b7 )  goto  L20;
00432 
00433    b4=b7;
00434    cc=2.0*pow(tab1(l),2);
00435    c=1.0-cc;
00436    l++;
00437    ss=sgn*tab1(l);
00438    s=ss;
00439 
00440 L16:
00441    b5=b6+b4;
00442    b4=2*b6;
00443    b56=b5-b6;
00444 
00445 L18:
00446    tr1=br(b5+1);
00447    ti1=bi(b5+1);
00448    tr2=br(b56+1);
00449    ti2=bi(b56+1);
00450    br(b5+1)=c*(tr2-tr1)-s*(ti2-ti1);
00451    bi(b5+1)=s*(tr2-tr1)+c*(ti2-ti1);
00452    br(b56+1)=tr1+tr2;
00453    bi(b56+1)=ti1+ti2;
00454 
00455    b5=b5+b4;
00456    b56=b5-b6;
00457    if ( b5 <= b3 )  goto  L18;
00458    b4=b5-b6;
00459    b5=b4-b3;
00460    c=-c;
00461    b4=b6-b5;
00462    if ( b5 < b4 )  goto  L16;
00463    b4=b4+b7;
00464    if ( b4 >= b5 ) goto  L12;
00465 
00466    t=c-cc*c-ss*s;
00467    s=s+ss*c-cc*s;
00468    c=t;
00469    goto  L16;
00470 
00471 L20:
00472    ix0=b3/2;
00473    b3=b3-b7;
00474    b4=0;
00475    b5=0;
00476    b6=ix0;
00477    ix1=0;
00478    if (b6 == b7) goto EXIT;
00479 
00480 L22:
00481    b4=b3-b4;
00482    b5=b3-b5;
00483    x2=br(b4+1);
00484    x3=br(b5+1);
00485    x4=bi(b4+1);
00486    x5=bi(b5+1);
00487    br(b4+1)=x3;
00488    br(b5+1)=x2;
00489    bi(b4+1)=x5;
00490    bi(b5+1)=x4;
00491    if(b6 < b4)  goto  L22;
00492 
00493 L24:
00494    b4=b4+b7;
00495    b5=b6+b5;
00496    x2=br(b4+1);
00497    x3=br(b5+1);
00498    x4=bi(b4+1);
00499    x5=bi(b5+1);
00500    br(b4+1)=x3;
00501    br(b5+1)=x2;
00502    bi(b4+1)=x5;
00503    bi(b5+1)=x4;
00504    ix0=b6;
00505 
00506 L26:
00507    ix0=ix0/2;
00508    ix1=ix1-ix0;
00509    if( ix1 >= 0)  goto L26;
00510 
00511    ix0=2*ix0;
00512    b4=b4+b7;
00513    ix1=ix1+ix0;
00514    b5=ix1;
00515    if ( b5 >= b4)  goto  L22;
00516    if ( b4 < b6)   goto  L24;
00517 
00518 EXIT:
00519    status = 0;
00520 } 

static void fftc_q ( float *  br,
float *  bi,
int  ln,
int  ks 
) [static]

Definition at line 135 of file spidfft.cpp.

Referenced by fftr_q().

00136 {
00137    //  dimension  br(1),bi(1)
00138 
00139    int b3,b4,b5,b6,b7,b56;
00140    int n, k, l, j, i, ix0, ix1; 
00141    float rni, tr1, ti1, tr2, ti2, cc, c, ss, s, t, x2, x3, x4, x5, sgn;
00142    float tab1[15]; 
00143    int status=0;
00144 
00145    tab1(1)=9.58737990959775e-5;
00146    tab1(2)=1.91747597310703e-4;
00147    tab1(3)=3.83495187571395e-4;
00148    tab1(4)=7.66990318742704e-4;
00149    tab1(5)=1.53398018628476e-3;
00150    tab1(6)=3.06795676296598e-3;
00151    tab1(7)=6.13588464915449e-3;
00152    tab1(8)=1.22715382857199e-2;
00153    tab1(9)=2.45412285229123e-2;
00154    tab1(10)=4.90676743274181e-2;
00155    tab1(11)=9.80171403295604e-2;
00156    tab1(12)=1.95090322016128e-1;
00157    tab1(13)=3.82683432365090e-1;
00158    tab1(14)=7.07106781186546e-1;
00159    tab1(15)=1.00000000000000;
00160 
00161    n=(int)pow(2,ln);
00162 
00163    k=abs(ks);
00164    l=16-ln;
00165    b3=n*k;
00166    b6=b3;
00167    b7=k;
00168    if( ks > 0 ) {
00169       sgn=1.0;
00170    } 
00171    else {
00172       sgn=-1.0;
00173       rni=1.0/(float)n;
00174       j=1;
00175       for (i=1; i<=n;i++) {
00176          br(j)=br(j)*rni;
00177          bi(j)=bi(j)*rni;
00178          j=j+k;
00179       }
00180    }
00181 L12:
00182    b6=b6/2;
00183    b5=b6;
00184    b4=2*b6;
00185    b56=b5-b6;
00186 L14:
00187    tr1=br(b5+1);
00188    ti1=bi(b5+1);
00189    tr2=br(b56+1);
00190    ti2=bi(b56+1);
00191 
00192    br(b5+1)=tr2-tr1;
00193    bi(b5+1)=ti2-ti1;
00194    br(b56+1)=tr1+tr2;
00195    bi(b56+1)=ti1+ti2;
00196 
00197    b5=b5+b4;
00198    b56=b5-b6;
00199    if (b5 <= b3)  goto  L14;
00200    if (b6 == b7)  goto  L20;
00201 
00202    b4=b7;
00203    cc=2.0*pow(tab1(l),2);
00204    c=1.0-cc;
00205    l=l+1;
00206    ss=sgn*tab1(l);
00207    s=ss;
00208 L16: 
00209    b5=b6+b4;
00210    b4=2*b6;
00211    b56=b5-b6;
00212 L18:
00213    tr1=br(b5+1);
00214    ti1=bi(b5+1);
00215    tr2=br(b56+1);
00216    ti2=bi(b56+1);
00217    br(b5+1)=c*(tr2-tr1)-s*(ti2-ti1);
00218    bi(b5+1)=s*(tr2-tr1)+c*(ti2-ti1);
00219    br(b56+1)=tr1+tr2;
00220    bi(b56+1)=ti1+ti2;
00221 
00222    b5=b5+b4;
00223    b56=b5-b6;
00224    if(b5 <= b3)  goto L18;
00225    b4=b5-b6;
00226    b5=b4-b3;
00227    c=-c;
00228    b4=b6-b5;
00229    if(b5 < b4)  goto  L16;
00230    b4=b4+b7;
00231    if(b4 >= b5) goto  L12;
00232 
00233    t=c-cc*c-ss*s;
00234    s=s+ss*c-cc*s;
00235    c=t;
00236    goto  L16;
00237 L20:
00238    ix0=b3/2;
00239    b3=b3-b7;
00240    b4=0;
00241    b5=0;
00242    b6=ix0;
00243    ix1=0;
00244    if ( b6 == b7) goto EXIT;
00245 L22:
00246    b4=b3-b4;
00247    b5=b3-b5;
00248    x2=br(b4+1);
00249    x3=br(b5+1);
00250    x4=bi(b4+1);
00251    x5=bi(b5+1);
00252    br(b4+1)=x3;
00253    br(b5+1)=x2;
00254    bi(b4+1)=x5;
00255    bi(b5+1)=x4;
00256    if (b6 < b4) goto  L22;
00257 L24:
00258    b4=b4+b7;
00259    b5=b6+b5;
00260    x2=br(b4+1);
00261    x3=br(b5+1);
00262    x4=bi(b4+1);
00263    x5=bi(b5+1);
00264    br(b4+1)=x3;
00265    br(b5+1)=x2;
00266    bi(b4+1)=x5;
00267    bi(b5+1)=x4;
00268    ix0=b6;
00269 L26:
00270    ix0=ix0/2;
00271    ix1=ix1-ix0;
00272    if(ix1 >= 0)  goto  L26;
00273 
00274    ix0=2*ix0;
00275    b4=b4+b7;
00276    ix1=ix1+ix0;
00277    b5=ix1;
00278    if (b5 >= b4)  goto  L22;
00279    if (b4 < b6)   goto  L24;
00280 EXIT:
00281    status = 0; 
00282 }

static void fftr_d ( double *  xcmplx,
int  nv 
) [static]

Definition at line 285 of file spidfft.cpp.

Referenced by crosrng_e(), and crosrng_ms().

00286 {
00287    // double precision  x(2,1)
00288    int    i1, i2,  nu, inv, nu1, n, isub, n2, i;
00289    double tr1,tr2,ti1,ti2,tr,ti;
00290    double cc,c,ss,s,t;
00291    double tab1[15];
00292 
00293    tab1(1)=9.58737990959775e-5;
00294    tab1(2)=1.91747597310703e-4;
00295    tab1(3)=3.83495187571395e-4;
00296    tab1(4)=7.66990318742704e-4;
00297    tab1(5)=1.53398018628476e-3;
00298    tab1(6)=3.06795676296598e-3;
00299    tab1(7)=6.13588464915449e-3;
00300    tab1(8)=1.22715382857199e-2;
00301    tab1(9)=2.45412285229123e-2;
00302    tab1(10)=4.90676743274181e-2;
00303    tab1(11)=9.80171403295604e-2;
00304    tab1(12)=1.95090322016128e-1;
00305    tab1(13)=3.82683432365090e-1;
00306    tab1(14)=7.07106781186546e-1;
00307    tab1(15)=1.00000000000000;
00308 
00309    nu=abs(nv);
00310    inv=nv/nu;
00311    nu1=nu-1;
00312    n=(int)pow(2,nu1);
00313    isub=16-nu1;
00314    ss=-tab1(isub);
00315    cc=-2.0*pow(tab1(isub-1),2);
00316    c=1.0;
00317    s=0.0;
00318    n2=n/2;
00319 
00320    if ( inv > 0 ) {
00321       fftc_d(&xcmplx(1,1),&xcmplx(2,1),nu1,2);
00322       tr=xcmplx(1,1);
00323       ti=xcmplx(2,1);
00324       xcmplx(1,1)=tr+ti;
00325       xcmplx(2,1)=tr-ti;
00326       for (i=1;i<=n2;i++) {
00327          i1=i+1;
00328          i2=n-i+1;
00329          tr1=xcmplx(1,i1);
00330          tr2=xcmplx(1,i2);
00331          ti1=xcmplx(2,i1);
00332          ti2=xcmplx(2,i2);
00333          t=(cc*c-ss*s)+c;
00334          s=(cc*s+ss*c)+s;
00335          c=t;
00336          xcmplx(1,i1)=0.5*((tr1+tr2)+(ti1+ti2)*c-(tr1-tr2)*s);
00337          xcmplx(1,i2)=0.5*((tr1+tr2)-(ti1+ti2)*c+(tr1-tr2)*s);
00338          xcmplx(2,i1)=0.5*((ti1-ti2)-(ti1+ti2)*s-(tr1-tr2)*c);
00339          xcmplx(2,i2)=0.5*(-(ti1-ti2)-(ti1+ti2)*s-(tr1-tr2)*c);
00340       }
00341    }
00342    else {
00343       tr=xcmplx(1,1);
00344       ti=xcmplx(2,1);
00345       xcmplx(1,1)=0.5*(tr+ti);
00346       xcmplx(2,1)=0.5*(tr-ti);
00347       for (i=1;i<=n2;i++) {
00348          i1=i+1;
00349          i2=n-i+1;
00350          tr1=xcmplx(1,i1);
00351          tr2=xcmplx(1,i2);
00352          ti1=xcmplx(2,i1);
00353          ti2=xcmplx(2,i2);
00354          t=(cc*c-ss*s)+c;
00355          s=(cc*s+ss*c)+s;
00356          c=t;
00357          xcmplx(1,i1)=0.5*((tr1+tr2)-(tr1-tr2)*s-(ti1+ti2)*c);
00358          xcmplx(1,i2)=0.5*((tr1+tr2)+(tr1-tr2)*s+(ti1+ti2)*c);
00359          xcmplx(2,i1)=0.5*((ti1-ti2)+(tr1-tr2)*c-(ti1+ti2)*s);
00360          xcmplx(2,i2)=0.5*(-(ti1-ti2)+(tr1-tr2)*c-(ti1+ti2)*s);
00361       } 
00362       fftc_d(&xcmplx(1,1),&xcmplx(2,1),nu1,-2);
00363    } 
00364 } 

static void fftr_q ( float *  xcmplx,
int  nv 
) [static]

Definition at line 53 of file spidfft.cpp.

Referenced by frngs().

00054 {
00055    // dimension xcmplx(2,1); xcmplx(1,i) --- real, xcmplx(2,i) --- imaginary
00056 
00057    float tab1[15];
00058    int nu, inv, nu1, n, isub, n2, i1, i2, i;
00059    float ss, cc, c, s, tr, ti, tr1, tr2, ti1, ti2, t;
00060 
00061    tab1(1)=9.58737990959775e-5;
00062    tab1(2)=1.91747597310703e-4;
00063    tab1(3)=3.83495187571395e-4;
00064    tab1(4)=7.66990318742704e-4;
00065    tab1(5)=1.53398018628476e-3;
00066    tab1(6)=3.06795676296598e-3;
00067    tab1(7)=6.13588464915449e-3;
00068    tab1(8)=1.22715382857199e-2;
00069    tab1(9)=2.45412285229123e-2;
00070    tab1(10)=4.90676743274181e-2;
00071    tab1(11)=9.80171403295604e-2;
00072    tab1(12)=1.95090322016128e-1;
00073    tab1(13)=3.82683432365090e-1;
00074    tab1(14)=7.07106781186546e-1;
00075    tab1(15)=1.00000000000000;
00076 
00077    nu=abs(nv);
00078    inv=nv/nu;
00079    nu1=nu-1;
00080    n=(int)pow(2,nu1);
00081    isub=16-nu1;
00082 
00083    ss=-tab1(isub);
00084    cc=-2.0*pow(tab1(isub-1),2);
00085    c=1.0;
00086    s=0.0;
00087    n2=n/2;
00088    if ( inv > 0) {
00089       fftc_q(&xcmplx(1,1),&xcmplx(2,1),nu1,2);
00090       tr=xcmplx(1,1);
00091       ti=xcmplx(2,1);
00092       xcmplx(1,1)=tr+ti;
00093       xcmplx(2,1)=tr-ti;
00094       for (i=1;i<=n2;i++) {
00095          i1=i+1;
00096          i2=n-i+1;
00097          tr1=xcmplx(1,i1);
00098          tr2=xcmplx(1,i2);
00099          ti1=xcmplx(2,i1);
00100          ti2=xcmplx(2,i2);
00101          t=(cc*c-ss*s)+c;
00102          s=(cc*s+ss*c)+s;
00103          c=t;
00104          xcmplx(1,i1)=0.5*((tr1+tr2)+(ti1+ti2)*c-(tr1-tr2)*s);
00105          xcmplx(1,i2)=0.5*((tr1+tr2)-(ti1+ti2)*c+(tr1-tr2)*s);
00106          xcmplx(2,i1)=0.5*((ti1-ti2)-(ti1+ti2)*s-(tr1-tr2)*c);
00107          xcmplx(2,i2)=0.5*(-(ti1-ti2)-(ti1+ti2)*s-(tr1-tr2)*c);
00108      }
00109    }
00110    else {
00111      tr=xcmplx(1,1);
00112      ti=xcmplx(2,1);
00113      xcmplx(1,1)=0.5*(tr+ti);
00114      xcmplx(2,1)=0.5*(tr-ti);
00115      for (i=1; i<=n2; i++) {
00116         i1=i+1;
00117         i2=n-i+1;
00118         tr1=xcmplx(1,i1);
00119         tr2=xcmplx(1,i2);
00120         ti1=xcmplx(2,i1);
00121         ti2=xcmplx(2,i2);
00122         t=(cc*c-ss*s)+c;
00123         s=(cc*s+ss*c)+s;
00124         c=t;
00125         xcmplx(1,i1)=0.5*((tr1+tr2)-(tr1-tr2)*s-(ti1+ti2)*c);
00126         xcmplx(1,i2)=0.5*((tr1+tr2)+(tr1-tr2)*s+(ti1+ti2)*c);
00127         xcmplx(2,i1)=0.5*((ti1-ti2)+(tr1-tr2)*c-(ti1+ti2)*s);
00128         xcmplx(2,i2)=0.5*(-(ti1-ti2)+(tr1-tr2)*c-(ti1+ti2)*s);
00129      }
00130      fftc_q(&xcmplx(1,1),&xcmplx(2,1),nu1,-2);
00131    }
00132 }

static void flip23 ( double *  x,
double *  y,
double *  z,
int *  key,
int  k,
int  len 
) [static]

static void Frngs ( EMData *  circ,
vector< int >  numr 
) [static]

This function conducts the Single Precision Fourier Transform for a set of rings.

Referenced by ali3d_d(), EMAN::Util::constrained_helix(), and EMAN::Util::constrained_helix_test().

static void Frngs_inv ( EMData *  circ,
vector< int >  numr 
) [static]

This function conducts the Single Precision Inverse Fourier Transform for a set of rings.

static int generatesubmax ( int *  argParts,
int *  Indices,
int *  dimClasses,
int  nParts,
int  K,
int  T,
int  n_guesses,
int  LARGEST_CLASS 
) [static]

make an intelligent "guess" at the largest weight of all possible feasible matches.

we make "n_guesses" guesses and return the largest one. the largest weight of all feasible matches is guaranteed to be larger than or equal to the returned guess.

static EMData* get_biggest_cluster ( EMData *  mg  )  [static]

static float get_pixel_conv_new ( int  nx,
int  ny,
int  nz,
float  delx,
float  dely,
float  delz,
float *  data,
Util::KaiserBessel &  kb 
) [static]

static float get_pixel_conv_new_background ( int  nx,
int  ny,
int  nz,
float  delx,
float  dely,
float  delz,
float *  data,
Util::KaiserBessel &  kb,
int  xnew,
int  ynew 
) [static]

static EMData* get_slice ( EMData *  vol,
int  dim,
int  index 
) [static]

This function returns a 2-D slice from a 3-D EMData object dim denotes the slice is perpendicular to which dimension 1 for x-dimension, 2 for y-dimension and 3 for z-dimension.

static Dict get_transform_params ( EMData *  image,
string  xform,
string  convention 
) [static]

This function returns parameters from Transform object as a Dict object.

It allows to omit problem with passing Transform object through C++/Python layer (It causes memory leak).

Referenced by EMAN::Util::constrained_helix(), and EMAN::Util::constrained_helix_test().

static void getvec ( float  phi,
float  theta,
float &  x,
float &  y,
float &  z,
int  option = 0 
) [inline, static]

Definition at line 851 of file util_sparx.h.

00851                                                                                                       {
00852                 float pi180 = M_PI/180.0f;
00853                 
00854                 if (theta > 180.0f) {
00855                         theta -= 180.0f;
00856                         phi += 180.0f;
00857                 } else if (theta > 90.0f && option == 0) {
00858                         theta = 180.0f - theta;
00859                         phi += 180.0f;
00860                 }
00861 
00862                 phi   *= pi180;
00863                 theta *= pi180;
00864 
00865                 x = sin(theta)*cos(phi);
00866                 y = sin(theta)*sin(phi);
00867                 z = cos(theta);
00868 
00869                 return;
00870         }

static vector<int> group_proj_by_phitheta ( const vector< float > &  projangles,
const vector< float > &  ref_ang,
const int  img_per_grp 
) [static]

static vector<float> hans ( EMData *  image,
const vector< EMData * > &  crefim,
float  xrng,
float  yrng,
float  step,
float  ant,
string  mode,
vector< int >  numr,
float  cnx,
float  cny 
) [static]

static float hist_comp_freq ( float  PA,
float  PB,
size_t  size_img,
int  hist_len,
EMData *  img,
vector< float >  ref_freq_hist,
EMData *  mask,
float  ref_h_diff,
float  ref_h_min 
) [static]

static Dict histc ( EMData *  ref,
EMData *  img,
EMData *  mask 
) [static]

static vector<float> histogram ( EMData *  image,
EMData *  mask,
int  nbins = 128,
float  hmin = 0.0f,
float  hmax = 0.0f 
) [static]

static void hsortd ( double *  theta,
double *  phi,
int *  key,
int  len,
int  option 
) [static]

Referenced by EMAN::Util::vrdg().

static Dict im_diff ( EMData *  V1,
EMData *  V2,
EMData *  mask = 0 
) [static]

static void image_mutation ( EMData *  img,
float  mutation_rate 
) [static]

static vector<float> infomask ( EMData *  Vol,
EMData *  mask,
bool   
) [static]

Referenced by ali3d_d(), EMAN::Util::histc(), and EMAN::NormalizeRampNormVar::process_inplace().

static void initial_prune ( vector< vector< int * > > &  Parts,
int *  dimClasses,
int  nParts,
int  K,
int  T 
) [static]

initial_prune removes all classes C from Parts where there does not exist ANY feasible matching containing class C which has weight gt T.

The first element of each class is its original index, and second is dummy variable

Referenced by EMAN::Util::bb_enumerateMPI_().

static int k_means_cont_table_ ( int *  group1,
int *  group2,
int *  stb,
long int  s1,
long int  s2,
int  flag 
) [static]

helper to create the contengency table for partition matching (k-means) flag define is the list of stable obj must be store to stb, but the size st must be know before.

The trick is first start wihtout the flag to get number of elements stable, then again with the flag to get the list. This avoid to have two differents functions for the same thing.

Referenced by EMAN::Util::explore(), EMAN::Util::explore2(), EMAN::Util::initial_prune(), EMAN::Util::sanitycheck(), and EMAN::Util::search2().

static vector<float> list_mutation ( vector< float >  list,
float  mutation_rate,
float  min_val,
float  max_val,
int  K,
int  is_mirror 
) [static]

static vector<float> lsfit ( long int *  ks,
long int *  n,
long int *  klm2d,
long int *  iswi,
float *  q1,
double *  q,
double *  x,
double *  res,
double *  cu,
double *  s,
long int *  iu 
) [static]

Referenced by EMAN::Util::call_cl1().

static void mad_scalar ( EMData *  img,
EMData *  img1,
float  scalar 
) [static]

static EMData* madn_scalar ( EMData *  img,
EMData *  img1,
float  scalar 
) [static]

static double mean ( double *  x,
int  n 
) [inline, static]

Definition at line 1023 of file util_sparx.h.

Referenced by EMAN::EMData::calc_center_density(), EMAN::NormalizeLREdgeMeanProcessor::calc_mean(), EMAN::NormalizeMaskProcessor::calc_mean(), EMAN::EMData::calc_sigma_diff(), EMAN::EMData::common_lines_real(), EMAN::EMData::compute_missingwedge(), EMAN::EMData::get_attr(), EMAN::NSigmaClampingProcessor::process_inplace(), EMAN::TestImageNoiseGauss::process_inplace(), EMAN::AutoMask3DProcessor::process_inplace(), EMAN::NormalizeProcessor::process_inplace(), EMAN::AverageXProcessor::process_inplace(), EMAN::VerticalStripeProcessor::process_inplace(), EMAN::CutoffBlockProcessor::process_inplace(), EMAN::DiffBlockProcessor::process_inplace(), EMAN::BoxSigmaProcessor::process_pixel(), EMAN::MrcIO::update_stat(), EMAN::EMData::update_stat(), and var().

01023                                                     {
01024                 double s = 0.0;
01025                 for (int i=0; i<n; i++) s+=x[i];
01026                 return s/static_cast<double>(n);
01027         }

static vector<float> merge_peaks ( vector< float >  peak1,
vector< float >  peak2,
float  p_size 
) [static]

static Dict min_dist_four ( EMData *  image,
const vector< EMData * > &  data 
) [static]

helper function for k-means

static Dict min_dist_real ( EMData *  image,
const vector< EMData * > &  data 
) [static]

k-means helper

static int mono ( int  k1,
int  k2 
) [inline, static]

Definition at line 1008 of file util_sparx.h.

References max, and min.

01008                                                {
01009 #ifdef _WIN32
01010                 int  mk = _cpp_max(k1,k2);
01011                 return  _cpp_min(k1,k2) + mk*(mk-1)/2;
01012 #else
01013                 int  mk = std::max(k1,k2);
01014                 return  std::min(k1,k2) + mk*(mk-1)/2;
01015 #endif  //_WIN32
01016         }

static EMData* move_points ( EMData *  img,
float  qprob,
int  ri,
int  ro 
) [static]

static void mul_img ( EMData *  img,
EMData *  img1 
) [static]

Referenced by ali3d_d().

static void mul_scalar ( EMData *  img,
float  scalar 
) [static]

static EMData* muln_img ( EMData *  img,
EMData *  img1 
) [static]

static EMData* mult_scalar ( EMData *  img,
float  scalar 
) [static]

static vector<float> multi_align_error ( vector< float >  args,
vector< float >  all_ali_params,
int  d 
) [static]

static void multi_align_error_dfunc ( double *  x,
vector< float >  all_ali_params,
int  nima,
int  num_ali,
double *  g,
int  d 
) [static]

static double multi_align_error_func ( double *  x,
vector< float >  all_ali_params,
int  nima,
int  num_ali,
int  d 
) [static]

static vector<double> multi_align_error_func2 ( double *  x,
vector< float >  all_ali_params,
int  nima,
int  num_ali,
int  d 
) [static]

static void multiref_peaks_ali2d ( EMData *  image,
EMData *  crefim,
float  xrng,
float  yrng,
float  step,
string  mode,
vector< int >  numr,
float  cnx,
float  cny,
EMData *  peaks,
EMData *  peakm 
) [static]

Determine shift and rotation between image and one reference image (crefim, weights have to be applied) using quadratic interpolation, return a list of peaks PAP 07/21/08.

ccf1d keeps 1d ccfs stored as (maxrin, -kx-1:kx+1, -ky-1:ky+1) margin is needed for peak search and both arrays are initialized with -1.0e20

static void multiref_peaks_compress_ali2d ( EMData *  image,
EMData *  crefim,
float  xrng,
float  yrng,
float  step,
string  mode,
vector< int >  numr,
float  cnx,
float  cny,
EMData *  peaks,
EMData *  peakm,
EMData *  peaks_compress,
EMData *  peakm_compress 
) [static]

Determine shift and rotation between image and one reference image (crefim, weights have to be applied) using quadratic interpolation, return a list of peaks PAP 07/21/08.

ccf1d keeps 1d ccfs stored as (maxrin, -kx-1:kx+1, -ky-1:ky+1) margin is needed for peak search and both arrays are initialized with -1.0e20

static vector<float> multiref_polar_ali_2d ( EMData *  image,
const vector< EMData * > &  crefim,
float  xrng,
float  yrng,
float  step,
string  mode,
vector< int >  numr,
float  cnx,
float  cny 
) [static]

formerly known as apmq Determine shift and rotation between image and many reference images (crefim, weights have to be applied) quadratic interpolation

Referenced by ali3d_d().

static vector<float> multiref_polar_ali_2d_delta ( EMData *  image,
const vector< EMData * > &  crefim,
float  xrng,
float  yrng,
float  step,
string  mode,
vector< int >  numr,
float  cnx,
float  cny,
float  delta_start,
float  delta 
) [static]

formerly known as apmq Determine shift and rotation between image and many reference images (crefim, weights have to be applied) quadratic interpolation

static vector<float> multiref_polar_ali_2d_local ( EMData *  image,
const vector< EMData * > &  crefim,
float  xrng,
float  yrng,
float  step,
float  ant,
string  mode,
vector< int >  numr,
float  cnx,
float  cny 
) [static]

formerly known as apmq Determine shift and rotation between image and many reference images (crefim, weights have to be applied) quadratic interpolation

static vector<float> multiref_polar_ali_2d_local_psi ( EMData *  image,
const vector< EMData * > &  crefim,
float  xrng,
float  yrng,
float  step,
float  ant,
float  psi_max,
string  mode,
vector< int >  numr,
float  cnx,
float  cny 
) [static]

formerly known as apmq Determine shift and rotation between image and many reference images (crefim, weights have to be applied) quadratic interpolation

static vector<float> multiref_polar_ali_2d_nom ( EMData *  image,
const vector< EMData * > &  crefim,
float  xrng,
float  yrng,
float  step,
string  mode,
vector< int >  numr,
float  cnx,
float  cny 
) [static]

formerly known as apnq DO NOT CONSIDER MIRROR Determine shift and rotation between image and many reference images (crefim, weights have to be applied) quadratic interpolation

static vector<float> multiref_polar_ali_2d_peaklist ( EMData *  image,
const vector< EMData * > &  crefim,
float  xrng,
float  yrng,
float  step,
string  mode,
vector< int >  numr,
float  cnx,
float  cny 
) [static]

static vector<float> multiref_polar_ali_helical ( EMData *  image,
const vector< EMData * > &  crefim,
float  xrng,
float  yrng,
float  step,
float  psi_max,
string  mode,
vector< int >  numr,
float  cnx,
float  cny,
int  ynumber = -1 
) [static]

formerly known as apmq Determine shift and rotation between image and many reference images (crefim, weights have to be applied) quadratic interpolation Search for peaks only within +/-psi_max from 0 and 180 (helical)

static vector<float> multiref_polar_ali_helical_90 ( EMData *  image,
const vector< EMData * > &  crefim,
float  xrng,
float  yrng,
float  step,
float  psi_max,
string  mode,
vector< int >  numr,
float  cnx,
float  cny,
int  ynumber = -1 
) [static]

static vector<float> multiref_polar_ali_helical_90_local ( EMData *  image,
const vector< EMData * > &  crefim,
float  xrng,
float  yrng,
float  step,
float  ant,
float  psi_max,
string  mode,
vector< int >  numr,
float  cnx,
float  cny,
int  ynumber = -1,
float  yrnglocal = -1.0 
) [static]

static vector<float> multiref_polar_ali_helical_local ( EMData *  image,
const vector< EMData * > &  crefim,
float  xrng,
float  yrng,
float  step,
float  ant,
float  psi_max,
string  mode,
vector< int >  numr,
float  cnx,
float  cny,
int  ynumber = -1,
float  yrnglocal = -1.0 
) [static]

static int nearest_ang ( const vector< float > &  vecref,
float  x,
float  y,
float  z 
) [static]

static vector<int> nearestk_to_refdir ( const vector< float > &  projangles,
const vector< float > &  refangles,
const int  howmany 
) [static]

static int nint180 ( float  arg  )  [inline, static]

Definition at line 1018 of file util_sparx.h.

01018                                              {
01019             int res = int(arg + 180.5) - 180;
01020             return res;
01021         }

static void Normalize_ring ( EMData *  ring,
const vector< int > &  numr 
) [static]

static EMData* pack_complex_to_real ( EMData *  img  )  [static]

static EMData* pad ( EMData *  img,
int  new_nx,
int  new_ny = 1,
int  new_nz = 1,
int  x_offset = 0,
int  y_offset = 0,
int  z_offset = 0,
const char *  params = "average" 
) [static]

Referenced by EMAN::SpiderIO::write_single_header().

static EMData* Polar2D ( EMData *  image,
vector< int >  numr,
string  mode 
) [static]

static EMData* Polar2Dm ( EMData *  image,
float  cns2,
float  cnr2,
vector< int >  numr,
string  cmode 
) [static]

Referenced by ali3d_d().

static EMData* Polar2Dmi ( EMData *  image,
float  cns2,
float  cnr2,
vector< int >  numr,
string  cmode,
Util::KaiserBessel &  kb 
) [static]

static void prb1d ( double *  b,
int  npoint,
float *  pos 
) [static]

Definition at line 787 of file spidutil.cpp.

Referenced by crosrng_e(), and crosrng_ms().

00788 {
00789    double  c2,c3;
00790    int     nhalf;
00791 
00792    nhalf = npoint/2 + 1;
00793    *pos  = 0.0;
00794 
00795    if (npoint == 7) {
00796       c2 = 49.*b(1) + 6.*b(2) - 21.*b(3) - 32.*b(4) - 27.*b(5)
00797          - 6.*b(6) + 31.*b(7);
00798       c3 = 5.*b(1) - 3.*b(3) - 4.*b(4) - 3.*b(5) + 5.*b(7);
00799    } 
00800    else if (npoint == 5) {
00801       c2 = (74.*b(1) - 23.*b(2) - 60.*b(3) - 37.*b(4)
00802          + 46.*b(5) ) / (-70.);
00803       c3 = (2.*b(1) - b(2) - 2.*b(3) - b(4) + 2.*b(5) ) / 14.0;
00804    }
00805    else if (npoint == 3) {
00806       c2 = (5.*b(1) - 8.*b(2) + 3.*b(3) ) / (-2.0);
00807       c3 = (b(1) - 2.*b(2) + b(3) ) / 2.0;
00808    }
00809    else if (npoint == 9) {
00810       c2 = (1708.*b(1) + 581.*b(2) - 246.*b(3) - 773.*b(4)
00811          - 1000.*b(5) - 927.*b(6) - 554.*b(7) + 119.*b(8)
00812          + 1092.*b(9) ) / (-4620.);
00813       c3 = (28.*b(1) + 7.*b(2) - 8.*b(3) - 17.*b(4) - 20.*b(5)
00814          - 17.*b(6) - 8.*b(7) + 7.*b(8) + 28.*b(9) ) / 924.0;
00815    }
00816    if (c3 != 0.0)  *pos = c2/(2.0*c3) - nhalf;
00817 }

static Dict predict ( float  phig,
float  yg,
float  dst,
float  sgn,
float  ysgn,
float  dpp,
float  dphi,
bool  backpred 
) [static]

static vector<float> pw_extract ( vector< float >  pw,
int  n,
int  iswi,
float  ps 
) [static]

static float quadri ( float  x,
float  y,
int  nx,
int  ny,
float *  image 
) [static]

Quadratic interpolation (2D).

Note: This routine starts counting from 1, not 0!

This routine uses six image points for interpolation:

See also:
M. Abramowitz & I.E. Stegun, Handbook of Mathematical Functions (Dover, New York, 1964), Sec. 25.2.67. http://www.math.sfu.ca/~cbm/aands/page_882.htm

http://www.cl.cam.ac.uk/users/nad/pubs/quad.pdf

                f3    fc
                |
                | x
         f2-----f0----f1
                |
                |
                f4
		 *

f0 - f4 are image values near the interpolated point X. f0 is the interior mesh point nearest x.

Coords:

Mesh spacings: Interpolant: f = f0 + c1*(x-x0) + c2*(x-x0)*(x-x1) + c3*(y-y0) + c4*(y-y0)*(y-y1) + c5*(x-x0)*(y-y0)

Parameters:
[in] x x-coord value
[in] y y-coord value
nx 
ny 
[in] image Image object (pointer)
Returns:
Interpolated value

Definition at line 186 of file spidutil.cpp.

Referenced by alrq(), alrq_ms(), apring1(), and quadri().

00187 {
00188 /*
00189 c  purpose: quadratic interpolation 
00190 c 
00191 c  parameters:       xx,yy treated as circularly closed.
00192 c                    fdata - image 1..nxdata, 1..nydata
00193 c
00194 c                    f3    fc       f0, f1, f2, f3 are the values
00195 c                     +             at the grid points.  x is the
00196 c                     + x           point at which the function
00197 c              f2++++f0++++f1       is to be estimated. (it need
00198 c                     +             not be in the first quadrant).
00199 c                     +             fc - the outer corner point
00200 c                    f4             nearest x.
00201 c
00202 c                                   f0 is the value of the fdata at
00203 c                                   fdata(i,j), it is the interior mesh
00204 c                                   point nearest  x.
00205 c                                   the coordinates of f0 are (x0,y0),
00206 c                                   the coordinates of f1 are (xb,y0),
00207 c                                   the coordinates of f2 are (xa,y0),
00208 c                                   the coordinates of f3 are (x0,yb),
00209 c                                   the coordinates of f4 are (x0,ya),
00210 c                                   the coordinates of fc are (xc,yc),
00211 c
00212 c                   o               hxa, hxb are the mesh spacings
00213 c                   +               in the x-direction to the left
00214 c                  hyb              and right of the center point.
00215 c                   +
00216 c            ++hxa++o++hxb++o       hyb, hya are the mesh spacings
00217 c                   +               in the y-direction.
00218 c                  hya
00219 c                   +               hxc equals either  hxb  or  hxa
00220 c                   o               depending on where the corner
00221 c                                   point is located.
00222 c
00223 c                                   construct the interpolant
00224 c                                   f = f0 + c1*(x-x0) +
00225 c                                       c2*(x-x0)*(x-x1) +
00226 c                                       c3*(y-y0) + c4*(y-y0)*(y-y1)
00227 c                                       + c5*(x-x0)*(y-y0)
00228 c
00229 c
00230 */
00231     float x, y, dx0, dy0, f0, c1, c2, c3, c4, c5, dxb, dyb;
00232     float quadri;
00233     int   i, j, ip1, im1, jp1, jm1, ic, jc, hxc, hyc;
00234 
00235     x = xx;
00236     y = yy;
00237 
00238     // circular closure
00239     if (x < 1.0)               x = x+(1 - floor(x) / nxdata) * nxdata;
00240     if (x > (float)nxdata+0.5) x = fmod(x-1.0,(float)nxdata) + 1.0;
00241     if (y < 1.0)               y = y+(1 - floor(y) / nydata) * nydata;
00242     if (y > (float)nydata+0.5) y = fmod(y-1.0,(float)nydata) + 1.0;
00243 
00244 
00245     i   = (int) floor(x);
00246     j   = (int) floor(y);
00247 
00248     dx0 = x - i;
00249     dy0 = y - j;
00250 
00251     ip1 = i + 1;
00252     im1 = i - 1;
00253     jp1 = j + 1;
00254     jm1 = j - 1;
00255 
00256     if (ip1 > nxdata) ip1 = ip1 - nxdata;
00257     if (im1 < 1)      im1 = im1 + nxdata;
00258     if (jp1 > nydata) jp1 = jp1 - nydata;
00259     if (jm1 < 1)      jm1 = jm1 + nydata;
00260 
00261     f0  = fdata(i,j);
00262     c1  = fdata(ip1,j) - f0;
00263     c2  = (c1 - f0 + fdata(im1,j)) * 0.5;
00264     c3  = fdata(i,jp1) - f0;
00265     c4  = (c3 - f0 + fdata(i,jm1)) * 0.5;
00266 
00267     dxb = dx0 - 1;
00268     dyb = dy0 - 1;
00269 
00270     // hxc & hyc are either 1 or -1
00271     if (dx0 >= 0) {
00272        hxc = 1;
00273     }
00274     else {
00275        hxc = -1;
00276     }
00277     if (dy0 >= 0) {
00278        hyc = 1;
00279     }
00280     else {
00281        hyc = -1;
00282     }
00283  
00284     ic  = i + hxc;
00285     jc  = j + hyc;
00286 
00287     if (ic > nxdata) {
00288        ic = ic - nxdata;
00289     }
00290     else if (ic < 1) {
00291        ic = ic + nxdata;
00292     }
00293 
00294     if (jc > nydata) {
00295        jc = jc - nydata;
00296     }
00297     else if (jc < 1) {
00298        jc = jc + nydata;
00299     }
00300 
00301     c5  =  ( (fdata(ic,jc) - f0 - hxc * c1 - (hxc * (hxc - 1.0)) * c2 
00302             - hyc * c3 - (hyc * (hyc - 1.0)) * c4) * (hxc * hyc));
00303 
00304     quadri = f0 + dx0 * (c1 + dxb * c2 + dy0 * c5) + dy0 * (c3 + dyb * c4);
00305 
00306     return quadri; 
00307 }

static float quadri_background ( float  x,
float  y,
int  nx,
int  ny,
float *  image,
int  xnew,
int  ynew 
) [static]

Quadratic interpolation (2D).

This is identical to quadri except the wrap around is not done circulantly.

Note: This routine starts counting from 1, not 0!

This routine uses six image points for interpolation:

See also:
M. Abramowitz & I.E. Stegun, Handbook of Mathematical Functions (Dover, New York, 1964), Sec. 25.2.67. http://www.math.sfu.ca/~cbm/aands/page_882.htm

http://www.cl.cam.ac.uk/users/nad/pubs/quad.pdf

                f3    fc
                |
                | x
         f2-----f0----f1
                |
                |
                f4
		 *

f0 - f4 are image values near the interpolated point X. f0 is the interior mesh point nearest x.

Coords:

Mesh spacings: Interpolant: f = f0 + c1*(x-x0) + c2*(x-x0)*(x-x1) + c3*(y-y0) + c4*(y-y0)*(y-y1) + c5*(x-x0)*(y-y0)

Parameters:
[in] x x-coord value
[in] y y-coord value
nx 
ny 
[in] image Image object (pointer)
Returns:
Interpolated value

static void Radialize ( int *  PermMatTr,
float *  kValsSorted,
float *  weightofkvalsSorted,
int  Size,
int *  SizeReturned 
) [static]

list the sorted lengths of the integer lattice sites of a square sided image of size Size.

PRB

Parameters:
[out] PermMatTr The matrix telling the ordering of the lattice sites wrt the array
[out] kValsSorted 
[out] weightofkvalsSorted the number of sites at that distance
[in] Size The length of the image
[out] SizeReturned 

Referenced by EMAN::EMData::FH2F(), and EMAN::EMData::real2FH().

static EMData* reconstitute_image_mask ( EMData *  image,
EMData *  mask 
) [static]

Recreates a n-d image using its compressed 1-D form and the mask.

Referenced by EMAN::varimax::analyze(), EMAN::PCAlarge::analyze(), EMAN::PCAsmall::analyze(), and EMAN::PCA::dopca_ooc().

static float restrict1 ( float  x,
int  nx 
) [inline, static]

Definition at line 1062 of file util_sparx.h.

01062                                                        {
01063                 while ( x < 0.0f )        x += nx;
01064                 while ( x >= (float)(nx) )  x -= nx;
01065                 return x;
01066         }

static bool sanitycheck ( int *  argParts,
int *  Indices,
int *  dimClasses,
int  nParts,
int  K,
int  T,
int *  output 
) [static]

First element of output is total cost of the matches in the output Second element of output is the total number of matches in output So output has 2+(*(output+1))nParts elements.

Referenced by EMAN::Util::bb_enumerateMPI_().

static void search2 ( int *  argParts,
int *  Indices,
int *  dimClasses,
int  nParts,
int  K,
int  T,
int *  matchlist,
int *  costlist,
int  J 
) [static]

return the weight of the largest weighted feasible match, along with the match in the (preallocated) argument curmax.

The returned weight has to be gt newT. If there is no such feasible matching, return 0 as *curmax

Referenced by EMAN::Util::branchMPI().

static void set_line ( EMData *  img,
int  posline,
EMData *  line,
int  offset,
int  length 
) [static]

This function drop a line (line) to an 2D image (img).

The position of the line to the image is defined by (postline). The part of the line paste is defined by (offset), the begin position and (length) the size.

static void slicereverse ( float *  beg,
float *  end,
int  nx,
int  ny 
) [static]

static void spline ( float *  x,
float *  y,
int  n,
float  yp1,
float  ypn,
float *  y2 
) [static]

Given a tabulated function y of x (unordered), and Given the values of the first derivatives at the end points This routine returns an array y2, that contains the second derivatives of the function at the tabulated points.

PRB This function is called by splint

Parameters:
x 
[in] y of x is the tabulated function of length n
n 
[in] yp1 : the derivatives of the first point.
[in] ypn : the derivatives of the last point.
[out] y2 is the value of the second derivatives

Referenced by EMAN::Util::spline_mat().

static void spline_mat ( float *  x,
float *  y,
int  n,
float *  xq,
float *  yq,
int  m 
) [static]

Given a tabulated function y of x (n unordered points), and Given the values of the m values xq to be interpolated This routine returns the interpolated array yq, PRB This function is called by splint.

Parameters:
x 
[in] y of x is the tabulated function of length n
n 
[in] xq is the x values to be splined: has m points.
[out] yq are the splined values
m 

Referenced by EMAN::EMData::FH2F(), and EMAN::EMData::real2FH().

static void splint ( float *  xa,
float *  ya,
float *  y2a,
int  n,
float *  xq,
float *  yq,
int  m 
) [static]

Given the arrays xa(ordered, ya of length n, which tabulate a function and given the array y2a which is the output of spline and an unordered array xq, this routine returns a cubic-spline interpolated array yq.

Parameters:
xa 
[in] ya of x is the tabulated function of length n
[in] y2a is returned from spline: second derivs
n 
[in] xq is the x values to be splined: has m points.
[out] yq are the splined values
m 

Referenced by EMAN::Util::spline_mat().

static void sub_fav ( EMData *  ave,
EMData *  dat,
float  tot,
int  mirror,
vector< int >  numr 
) [static]

static void sub_img ( EMData *  img,
EMData *  img1 
) [static]

static EMData* subn_img ( EMData *  img,
EMData *  img1 
) [static]

static float tf ( float  dzz,
float  ak,
float  voltage = 300.0f,
float  cs = 2.0f,
float  wgh = 0.1f,
float  b_factor = 0.0f,
float  sign = -1.0f 
) [static]

Referenced by EMAN::file_store::add_image(), EMAN::newfile_store::add_image(), EMAN::Processor::EMFourierFilterFunc(), ctf_store_new::get_ctf(), ctf_store::get_ctf(), EMAN::EMData::nn(), EMAN::EMData::nn_ctf(), EMAN::EMData::nn_ctf_applied(), EMAN::EMData::nn_SSNR(), EMAN::EMData::nn_SSNR_ctf(), EMAN::EMData::onelinenn(), EMAN::EMData::onelinenn_ctf(), EMAN::EMData::onelinenn_ctf_applied(), EMAN::EMData::onelinenn_mult(), EMAN::FourierGriddingProjector::project3d(), and EMAN::PDBReader::read_from_pdb().

static float triquad ( float  r,
float  s,
float  t,
float *  fdata 
) [static]

Quadratic interpolation (3D).

Parameters:
r 
s 
t 
fdata 
Returns:
Interpolated value

static int trmsh3_ ( int *  n0,
double *  tol,
double *  x,
double *  y,
double *  z__,
int *  n,
int *  list,
int *  lptr,
int *  lend,
int *  lnew,
int *  indx,
int *  lcnt,
int *  near__,
int *  next,
double *  dist,
int *  ier 
) [static]

Referenced by EMAN::Util::voronoi().

static vector<float> twoD_fine_ali ( EMData *  image,
EMData *  refim,
EMData *  mask,
float  ang,
float  sxs,
float  sys 
) [static]

static vector<float> twoD_fine_ali_G ( EMData *  image,
EMData *  refim,
EMData *  mask,
Util::KaiserBessel &  kb,
float  ang,
float  sxs,
float  sys 
) [static]

static vector<float> twoD_fine_ali_SD ( EMData *  image,
EMData *  refim,
EMData *  mask,
float  ang,
float  sxs,
float  sys 
) [static]

static vector<float> twoD_fine_ali_SD_G ( EMData *  image,
EMData *  refim,
EMData *  mask,
Util::KaiserBessel &  kb,
float  ang,
float  sxs,
float  sys 
) [static]

static vector<float> twoD_to_3D_ali ( EMData *  volft,
Util::KaiserBessel &  kb,
EMData *  refim,
EMData *  mask,
float  phi,
float  theta,
float  psi,
float  sxs,
float  sxy 
) [static]

static EMData* TwoDTestFunc ( int  Size,
float  p,
float  q,
float  a,
float  b,
int  flag = 0,
float  alphaDeg = 0 
) [static]

Creates a Two D Test Pattern.

Parameters:
[in] Size must be odd
[in] p the x frequency
[in] q the y frequency
[in] a the x falloff
b the y falloff
flag 
[in] alphaDeg the projection angle
Returns:
The 2D test pattern in real space, fourier space, or the projection in real or fourier space or the FH of the pattern

static void update_fav ( EMData *  ave,
EMData *  dat,
float  tot,
int  mirror,
vector< int >  numr 
) [static]

static double var ( double *  x,
int  n 
) [inline, static]

Definition at line 1029 of file util_sparx.h.

References mean().

Referenced by EMAN::LoGFourierProcessor::create_radial_func().

01029                                                    {
01030                 double s = 0.0;
01031                 double m = mean(x, n);
01032                 for (int i=0; i<n; i++) s += (x[i]-m)*(x[i]-m);
01033                 return s/static_cast<double>(n);
01034         }

static vector<float> vareas ( EMData *  d  )  [static]

static void voronoi ( double *  phi,
double *  theta,
double *  weight,
int  nt 
) [static]

Referenced by EMAN::Util::vrdg().

static void voronoidiag ( double *  theta,
double *  phi,
double *  weight,
int  n 
) [static]

static vector<double> vrdg ( const vector< float > &  ph,
const vector< float > &  th 
) [static]

Referenced by EMAN::Util::cml_weights().

static EMData* window ( EMData *  img,
int  new_nx,
int  new_ny = 1,
int  new_nz = 1,
int  x_offset = 0,
int  y_offset = 0,
int  z_offset = 0 
) [static]

Referenced by EMAN::Util::constrained_helix(), EMAN::Util::constrained_helix_test(), and win_resize().

static void WTF ( EMData *  PROJ,
vector< float >  SS,
float  SNR,
int  K 
) [static]

static void WTM ( EMData *  PROJ,
vector< float >  SS,
int  DIAMETER,
int  NUMP 
) [static]


Generated on Tue Jun 11 12:42:02 2013 for EMAN2 by  doxygen 1.4.7