EMAN2
Functions | Variables
runcartrec.cpp File Reference
#include <stdio.h>
#include <stdlib.h>
#include <mpi.h>
#include <math.h>
#include <string.h>
Include dependency graph for runcartrec.cpp:

Go to the source code of this file.

Functions

int setpart_gc1 (MPI_Comm comm_2d, int nangs, int *psize, int *nbase)
int getnnz (int *volsize, int ri, int *origin, int *nrays, int *nnz)
int setpart_gr1 (MPI_Comm comm_2d, int nnz, int *nnzpart, int *nnzbase)
int getcb2sph (int *volsize, int ri, int *origin, int nnz0, int *ptrs, int *cord)
int sphpart (MPI_Comm comm_2d, int nrays, int *ptrs, int *nnzbase, int *ptrstart)
int make_proj_mat (float phi, float theta, float psi, float *dm)
int ifix (float a)
int fwdpj3_Cart (int *volsize, int nraysloc, int nnzloc, float *dm, int *origin, int ri, int *ptrs, int *cord, int myptrstart, float *x, float *y)
int bckpj3_Cart (int *volsize, int nraysloc, int nnzloc, float *dm, int *origin, int ri, int *ptrs, int *cord, int myptrstart, float *x, float *y)
int fwdpj3 (int *volsize, int nrays, int nnz, float *dm, int *origin, int ri, int *ptrs, int *cord, float *x, float *y)
int bckpj3 (int *volsize, int nrays, int nnz, float *dm, int *origin, int ri, int *ptrs, int *cord, float *x, float *y)
int main (int argc, char *argv[])

Variables

int nangs
int nangsloc
int nx
int ny
int myptrstart
int nnz
int nrays
int nnzloc
int nraysloc
float * imagesloc
float * images
float * newimagesloc
float * reprojloc
float * angles
float * anglesloc
float * vol_sph
float * onevol_sph
float * reproj

Function Documentation

int bckpj3 ( int *  volsize,
int  nrays,
int  nnz,
float *  dm,
int *  origin,
int  ri,
int *  ptrs,
int *  cord,
float *  x,
float *  y 
)

Definition at line 618 of file utilcomm2d.cpp.

References cord, dm, ifix(), nrays, nx, ny, ptrs, status, x, and y.

{
    int       i, j, iqx,iqy, xc, yc, zc;
    float     xb, yb, dx, dy, dx1m, dy1m, dxdy;
    int       status = 0; 

    int xcent = origin[0];
    int ycent = origin[1];
    int zcent = origin[2];

    int nx = volsize[0];
    int ny = volsize[1];

    // Phi: adding the shift parameters that get passed in as the last two entries of dm
    float sx, sy;

    sx = dm(7);
    sy = dm(8);


    if ( nx > 2*ri) {
        for (i = 1; i <= nrays; i++) {
            zc = cord(1,i) - zcent;
            yc = cord(2,i) - ycent;
            xc = cord(3,i) - xcent;

            xb = zc*dm(1)+yc*dm(2)+xc*dm(3) + xcent + sx;
            yb = zc*dm(4)+yc*dm(5)+xc*dm(6) + ycent + sy;

            for (j = ptrs(i); j <ptrs(i+1); j++) {
                iqx = ifix(xb);
                iqy = ifix(yb);

                dx = xb - iqx;
                dy = yb - iqy;
                dx1m = 1.0 - dx;
                dy1m = 1.0 - dy;
                dxdy = dx*dy;
/*
c               y(j) = y(j) + dx1m*dy1m*x(iqx  , iqy)
c     &                     + dx1m*dy  *x(iqx  , iqy+1)
c     &                     + dx  *dy1m*x(iqx+1, iqy)
c     &                     + dx  *dy  *x(iqx+1, iqy+1)  
c
c              --- faster version of the above commented out
c                  code (derived by summing the following table 
c                  of coefficients along  the colunms) ---
c
c                        1         dx        dy      dxdy
c                     ------   --------  --------  -------
c                      x(i,j)   -x(i,j)   -x(i,j)    x(i,j)  
c                                        x(i,j+1) -x(i,j+1)
c                              x(i+1,j)           -x(i+1,j)
c                                                x(i+1,j+1) 
c
*/
                // Phi: add index checking, now that shifts are being used
                if ( iqx <= nx && iqy <= ny && iqx >= 1 && iqy >= 1 ) {
                    y(j) += x(iqx,iqy);
                    if ( iqx + 1 <= nx && iqx + 1 >= 1 ) {
                        y(j) += dx*(-x(iqx,iqy)+x(iqx+1,iqy));
                    }
                    if ( iqy + 1 <= ny && iqy + 1 >= 1 ) {
                        y(j) += dy*(-x(iqx,iqy)+x(iqx,iqy+1));
                    }
                    if ( iqx + 1 <= nx && iqy + 1 <= ny && iqx + 1 >= 1 && iqy + 1 >= 1 ) {
                        y(j) += dxdy*( x(iqx,iqy) - x(iqx,iqy+1) -x(iqx+1,iqy) + x(iqx+1,iqy+1) );
                    }
                }

//                y(j) += x(iqx,iqy)
//                     +  dx*(-x(iqx,iqy)+x(iqx+1,iqy))
//                     +  dy*(-x(iqx,iqy)+x(iqx,iqy+1))
//                     +  dxdy*( x(iqx,iqy) - x(iqx,iqy+1) 
//                              -x(iqx+1,iqy) + x(iqx+1,iqy+1) );

               xb += dm(1);
               yb += dm(4);
            } // end for j
        } // end for i
     }
    else {
        fprintf(stderr, "bckpj3: nx must be greater than 2*ri\n");
    }

    return status;
}
int bckpj3_Cart ( int *  volsize,
int  nraysloc,
int  nnzloc,
float *  dm,
int *  origin,
int  ri,
int *  ptrs,
int *  cord,
int  myptrstart,
float *  x,
float *  y 
)

Definition at line 412 of file utilcomm2d.cpp.

References cord, dm, ifix(), myptrstart, nraysloc, nx, ny, ptrs, status, x, and y.

{
    int       i, j, iqx,iqy, xc, yc, zc, jj;
    float     xb, yb, dx, dy, dx1m, dy1m, dxdy;
    int       status = 0; 

    int xcent = origin[0];
    int ycent = origin[1];
    int zcent = origin[2];

    int nx = volsize[0];
    int ny = volsize[1];

    // Phi: adding the shift parameters that get passed in as the last two entries of dm
    float sx, sy;

    sx = dm(7);
    sy = dm(8);

    if ( nx > 2*ri) {
        for (i = 1; i <= nraysloc; i++) {
            zc = cord(1,myptrstart+i) - zcent;
            yc = cord(2,myptrstart+i) - ycent;
            xc = cord(3,myptrstart+i) - xcent;

            xb = zc*dm(1)+yc*dm(2)+xc*dm(3) + xcent + sx;
            yb = zc*dm(4)+yc*dm(5)+xc*dm(6) + ycent + sy;

            for (j = ptrs(myptrstart+i); j <ptrs(myptrstart+i+1); j++) {
                jj = j-ptrs[myptrstart]+1;

                // jj is the index on the local volume
                iqx = ifix(xb);
                iqy = ifix(yb);

                dx = xb - iqx;
                dy = yb - iqy;
                dx1m = 1.0 - dx;
                dy1m = 1.0 - dy;
                dxdy = dx*dy;
/*
c               y(j) = y(j) + dx1m*dy1m*x(iqx  , iqy)
c     &                     + dx1m*dy  *x(iqx  , iqy+1)
c     &                     + dx  *dy1m*x(iqx+1, iqy)
c     &                     + dx  *dy  *x(iqx+1, iqy+1)  
c
c              --- faster version of the above commented out
c                  code (derived by summing the following table 
c                  of coefficients along  the colunms) ---
c
c                        1         dx        dy      dxdy
c                     ------   --------  --------  -------
c                      x(i,j)   -x(i,j)   -x(i,j)    x(i,j)  
c                                        x(i,j+1) -x(i,j+1)
c                              x(i+1,j)           -x(i+1,j)
c                                                x(i+1,j+1) 
c
*/
                // Phi: add index checking, now that shifts are being used
                if ( iqx <= nx && iqy <= ny && iqx >= 1 && iqy >= 1 ) {
                    y(jj) += x(iqx,iqy);
                    if ( iqx + 1 <= nx && iqx + 1 >= 1 ) {
                        y(jj) += dx*(-x(iqx,iqy)+x(iqx+1,iqy));
                    }
                    if ( iqy + 1 <= ny && iqy + 1 >= 1 ) {
                        y(jj) += dy*(-x(iqx,iqy)+x(iqx,iqy+1));
                    }
                    if ( iqx + 1 <= nx && iqy + 1 <= ny && iqx + 1 >= 1 && iqy + 1 >= 1 ) {
                        y(jj) += dxdy*( x(iqx,iqy) - x(iqx,iqy+1) -x(iqx+1,iqy) + x(iqx+1,iqy+1) );
                    }
                }

//                y(j) += x(iqx,iqy)
//                     +  dx*(-x(iqx,iqy)+x(iqx+1,iqy))
//                     +  dy*(-x(iqx,iqy)+x(iqx,iqy+1))
//                     +  dxdy*( x(iqx,iqy) - x(iqx,iqy+1) 
//                              -x(iqx+1,iqy) + x(iqx+1,iqy+1) );

               xb += dm(1);
               yb += dm(4);
            } // end for j
        } // end for i
     }
    else {
        fprintf(stderr, "bckpj3: nx must be greater than 2*ri\n");
    }

    return status;
}
int fwdpj3 ( int *  volsize,
int  nrays,
int  nnz,
float *  dm,
int *  origin,
int  ri,
int *  ptrs,
int *  cord,
float *  x,
float *  y 
)

Definition at line 526 of file utilcomm2d.cpp.

References cord, dm, ifix(), nrays, nx, ny, ptrs, status, x, and y.

{
    /*
        purpose:  y <--- proj(x)
        input  :  volsize  the size (nx,ny,nz) of the volume
                  nrays    number of rays within the compact spherical 
                           representation
                  nnz      number of voxels within the sphere
                  dm       an array of size 9 storing transformation 
                           associated with the projection direction
                  origin   coordinates of the center of the volume
                  ri       radius of the sphere
                  ptrs     the beginning address of each ray
                  cord     the coordinates of the first point in each ray
                  x        3d input volume
                  y        2d output image 
    */

    int    iqx, iqy, i, j, xc, yc, zc;
    float  ct, dipx, dipy, dipx1m, dipy1m, xb, yb, dm1, dm4;
    int    status = 0;
    
    // Phi: adding the shift parameters that get passed in as the last two entries of dm
    float sx, sy;

    sx = dm(7);
    sy = dm(8);

    int xcent = origin[0];
    int ycent = origin[1];
    int zcent = origin[2];

    int nx = volsize[0];
    int ny = volsize[1];

    dm1 = dm(1);
    dm4 = dm(4);
 
    if ( nx > 2*ri ) {
        for (i = 1; i <= nrays; i++) {

            zc = cord(1,i)-zcent;
            yc = cord(2,i)-ycent;
            xc = cord(3,i)-xcent;
            xb = zc* dm(1) +yc* dm(2) +xc* dm(3) + xcent + sx;
            yb = zc* dm(4) +yc* dm(5) +xc* dm(6) + ycent + sy;

            for (j = ptrs(i); j< ptrs(i+1); j++) {
               iqx = ifix(xb);
               iqy = ifix(yb);

               ct   = x(j);

               // dipx =  xb - (float)(iqx);
               // dipy = (yb - (float)(iqy)) * ct;
                   dipx =  xb - iqx;
                   dipy = (yb - iqy) * ct;

               dipy1m = ct - dipy;
               dipx1m = 1.0 - dipx;

                        if (iqx <= nx && iqy <= ny && iqx >= 1 && iqy >= 1) 
               // y(iqx  ,iqy)   = y(iqx  ,iqy)   + dipx1m*dipy1m;
               y(iqx  ,iqy)   +=  dipx1m*dipy1m;
                        if (iqx + 1 <= nx && iqy <= ny && iqx >= 0 && iqy >= 1) 
               // y(iqx+1,iqy)   = y(iqx+1,iqy)   + dipx*dipy1m; 
               y(iqx+1,iqy)   +=  dipx*dipy1m; 
                        if (iqx + 1 <= nx && iqy + 1 <= ny && iqx >= 0 && iqy >= 0) 
               // y(iqx+1,iqy+1) = y(iqx+1,iqy+1) + dipx*dipy;         
               y(iqx+1,iqy+1) +=  dipx*dipy;         
                        if (iqx <= nx && iqy + 1 <= ny && iqx >= 1 && iqy >= 0) 
               // y(iqx  ,iqy+1) = y(iqx  ,iqy+1) + dipx1m*dipy;
               y(iqx  ,iqy+1) +=  dipx1m*dipy;
               xb += dm1;
               yb += dm4;
           }
        }
    }
    else {
        fprintf(stderr, " nx must be greater than 2*ri\n");
        exit(1);
    }
    return status;
}
int fwdpj3_Cart ( int *  volsize,
int  nraysloc,
int  nnzloc,
float *  dm,
int *  origin,
int  ri,
int *  ptrs,
int *  cord,
int  myptrstart,
float *  x,
float *  y 
)

Definition at line 322 of file utilcomm2d.cpp.

References cord, dm, ifix(), myptrstart, nraysloc, nx, ny, ptrs, status, x, and y.

{
    int    iqx, iqy, i, j, xc, yc, zc, jj;
    float  ct, dipx, dipy, dipx1m, dipy1m, xb, yb, dm1, dm4;
    int    status = 0;
    
    // Phi: adding the shift parameters that get passed in as the last two entries of dm
    float sx, sy;

    sx = dm(7);
    sy = dm(8);

    int xcent = origin[0];
    int ycent = origin[1];
    int zcent = origin[2];

    int nx = volsize[0];
    int ny = volsize[1];

    dm1 = dm(1);
    dm4 = dm(4);
 
    if ( nx > 2*ri ) {
        for (i = 1; i <= nraysloc; i++) {

            zc = cord(1,myptrstart+i)-zcent;
            yc = cord(2,myptrstart+i)-ycent;
            xc = cord(3,myptrstart+i)-xcent;
            xb = zc* dm(1) +yc* dm(2) +xc* dm(3) + xcent + sx;
            yb = zc* dm(4) +yc* dm(5) +xc* dm(6) + ycent + sy;

            for (j = ptrs(myptrstart+i); j< ptrs(myptrstart+i+1); j++) {
               jj = j-ptrs[myptrstart]+1;
               iqx = ifix(xb);
               iqy = ifix(yb);

                // jj is the index on the local volume
               ct   = x(jj);

               // dipx =  xb - (float)(iqx);
               // dipy = (yb - (float)(iqy)) * ct;
                   dipx =  xb - iqx;
                   dipy = (yb - iqy) * ct;

               dipy1m = ct - dipy;
               dipx1m = 1.0 - dipx;

                        if (iqx <= nx && iqy <= ny && iqx >= 1 && iqy >= 1) 
               // y(iqx  ,iqy)   = y(iqx  ,iqy)   + dipx1m*dipy1m;
               y(iqx  ,iqy)   +=  dipx1m*dipy1m;
                        if (iqx + 1 <= nx && iqy <= ny && iqx >= 0 && iqy >= 1) 
               // y(iqx+1,iqy)   = y(iqx+1,iqy)   + dipx*dipy1m; 
               y(iqx+1,iqy)   +=  dipx*dipy1m; 
                        if (iqx + 1 <= nx && iqy + 1 <= ny && iqx >= 0 && iqy >= 0) 
               // y(iqx+1,iqy+1) = y(iqx+1,iqy+1) + dipx*dipy;         
               y(iqx+1,iqy+1) +=  dipx*dipy;         
                        if (iqx <= nx && iqy + 1 <= ny && iqx >= 1 && iqy >= 0) 
               // y(iqx  ,iqy+1) = y(iqx  ,iqy+1) + dipx1m*dipy;
               y(iqx  ,iqy+1) +=  dipx1m*dipy;
               xb += dm1;
               yb += dm4;
           }
        }
    }
    else {
        fprintf(stderr, " nx must be greater than 2*ri\n");
        exit(1);
    }
    return status;
}
int getcb2sph ( int *  volsize,
int  ri,
int *  origin,
int  nnz0,
int *  ptrs,
int *  cord 
)

Definition at line 144 of file utilcomm2d.cpp.

References cord, nnz, nrays, nx, ny, ptrs, and status.

{
    int    xs, ys, zs, xx, yy, zz, rs, r2;
    int    ix, iy, iz, jnz, nnz, nrays;
    int    ftm = 0, status = 0;  

    int xcent = (int)origin[0];
    int ycent = (int)origin[1];
    int zcent = (int)origin[2];

    int nx = (int)volsize[0];
    int ny = (int)volsize[1];
    int nz = (int)volsize[2];

    r2      = ri*ri;
    nnz     = 0;
    nrays    = 0;
    ptrs(1) = 1;

    for (ix = 1; ix <= nx; ix++) {
       xs  = ix-xcent;
       xx  = xs*xs;
       for ( iy = 1; iy <= ny; iy++ ) {
           ys = iy-ycent;
           yy = ys*ys;
           jnz = 0;

           ftm = 1;
           // not the most efficient implementation
           for (iz = 1; iz <= nz; iz++) {
               zs = iz-zcent;
               zz = zs*zs;
               rs = xx + yy + zz;
               if (rs <= r2) {
                  jnz++;
                  nnz++;
     //             sphere(nnz) = cube(iz, iy, ix); 

                  //  record the coordinates of the first nonzero ===
                  if (ftm) {
                     nrays++;
                     cord(1,nrays) = iz; 
                     cord(2,nrays) = iy; 
                     cord(3,nrays) = ix;
                     ftm = 0;
                  }
               }
            } // end for (iz..)
            if (jnz > 0) {
                ptrs(nrays+1) = ptrs(nrays) + jnz;
            }  // endif (jnz)
       } // end for iy
    } // end for ix
    if (nnz != nnz0) status = -1;
    return status;
}
int getnnz ( int *  volsize,
int  ri,
int *  origin,
int *  nrays,
int *  nnz 
)

Definition at line 43 of file utilcomm2d.cpp.

References nx, ny, and status.

{
    int  ix, iy, iz, rs, r2, xs, ys, zs, xx, yy, zz;
    int  ftm=0, status = 0;

    r2    = ri*ri;
    *nnz  = 0;
    *nrays = 0;
    int nx = volsize[0];
    int ny = volsize[1];
    int nz = volsize[2];
    // int nx = (int)volsize[0];
    // int ny = (int)volsize[1];
    // int nz = (int)volsize[2];

    int xcent = origin[0]; 
    int ycent = origin[1]; 
    int zcent = origin[2]; 
    // int xcent = (int)origin[0]; 
    // int ycent = (int)origin[1]; 
    // int zcent = (int)origin[2]; 

    // need to add some error checking 
    for (ix = 1; ix <=nx; ix++) { 
        xs  = ix-xcent;
        xx  = xs*xs;
        for (iy = 1; iy <= ny; iy++) {
            ys = iy-ycent;
            yy = ys*ys; 
            ftm = 1;
            for (iz = 1; iz <= nz; iz++) {
                zs = iz-zcent;
                zz = zs*zs;
                rs = xx + yy + zz;
                if (rs <= r2) {
                    (*nnz)++;
                    if (ftm) {
                       (*nrays)++;
                       ftm = 0;
                    }
                }
            }
        } // end for iy
    } // end for ix
    return status;
}
int ifix ( float  a)

Definition at line 41 of file utilnum.cpp.

{
    int ia = 0;
    if (a >= 0.0) {
       ia = (int)floor(a);
    }
    else {
       ia = (int)ceil(a);
    }
    return ia;
}
int main ( int  argc,
char *  argv[] 
)

Definition at line 32 of file runcartrec.cpp.

References angles, anglesloc, bckpj3(), bckpj3_Cart(), COL, cord, dm, fwdpj3(), fwdpj3_Cart(), getcb2sph(), getnnz(), ierr, images, imagesloc, make_proj_mat(), max, myptrstart, nangs, nangsloc, newimagesloc, nnz, nnzloc, nrays, nraysloc, nx, ny, onevol_sph, phi, ptrs, reproj, reprojloc, ROW, setpart_gc1(), setpart_gr1(), sphpart(), sqrt(), theta, and vol_sph.

{
  int ncpus, mypid, nrem, ierr;
  MPI_Status mpistatus;
  MPI_Comm comm = MPI_COMM_WORLD;
  
  // Variables needed for the Cartesian topology.
  int ROW = 0, COL = 1;
  int dims[2], periods[2], keep_dims[2];
  int my2dpid, mycoords[2], srcoords[2], otherpid;
  MPI_Comm comm_2d, comm_row, comm_col; 
                  
// Initialize MPI.
  MPI_Init(&argc, &argv);
  MPI_Comm_size(comm, &ncpus);
  MPI_Comm_rank(comm, &mypid);
  
  if ( argc < 3  ) {
          printf ("ERROR: %s requires Cartesian dimensions input\n", argv[0]);
          return -1;
  }
// Set up a Cartesian virtual topology and get the rank and coordinates of the processes in the topology. 
  dims[ROW] = atoi(argv[1]); // Row dimension of the topology
  dims[COL] = atoi(argv[2]); // Column dimension of the topology
  
  if (dims[ROW]*dims[COL] != ncpus){
        printf("ERROR: Row dim and col dim not equal to ncpus\n");
        return -1;
  }
  
  periods[ROW] = periods[COL] = 1; // Set the periods for wrap-around
  
  MPI_Cart_create(comm, 2, dims, periods, 1, &comm_2d);
  MPI_Comm_rank(comm_2d, &my2dpid); //Get my pid in the new 2D topology
  MPI_Cart_coords(comm_2d, my2dpid, 2, mycoords); // Get my coordinates
  
  /* Create the row-based sub-topology */ 
  keep_dims[ROW] = 0; 
  keep_dims[COL] = 1; 
  MPI_Cart_sub(comm_2d, keep_dims, &comm_row); 
 
  /* Create the column-based sub-topology */ 
  keep_dims[ROW] = 1; 
  keep_dims[COL] = 0; 
  MPI_Cart_sub(comm_2d, keep_dims, &comm_col); 

// STEP 1: Have processor (0,0) read in the entire set of 2D images, divide up the images, and send corresponding images to processors in processor group: g_c_0  Do the same for the angles.
  
  if (mycoords[ROW] == 0 && mycoords[COL] == 0){ //I'm processor (0,0)
    FILE *fp, *fpa;
    char imagefname[80]="tf2d84.raw", anglesfname[80]="angles.dat";
          
    fp = fopen(imagefname,"r");
    fread(&nangs, sizeof(int), 1, fp);
    fread(&nx, sizeof(int), 1, fp);
    fread(&ny, sizeof(int), 1, fp);
    
    images = new float[nx*ny*nangs];
    fread(images, sizeof(float), nx*ny*nangs, fp);
    fclose(fp);
    
    fpa = fopen(anglesfname,"r");
    angles = new float[3*nangs];
    for (int i = 0; i< 3*nangs; i++)
      fscanf(fpa, "%f",&angles[i]);
       
    fclose(fpa);
    printf("There are %d 2D images of size %d x %d\n", nangs, nx, ny);
  }
  
  // Broadcast variables nangs, nx, ny to all processors
  srcoords[ROW] = srcoords[COL] = 0;
  MPI_Cart_rank(comm_2d, srcoords, &otherpid); 
  
  MPI_Bcast (&nangs, 1, MPI_INT, otherpid, comm_2d);
  MPI_Bcast (&nx, 1, MPI_INT, otherpid, comm_2d);
  MPI_Bcast (&ny, 1, MPI_INT, otherpid, comm_2d);
  
  // Send images and angles from Processor (0,0) to processors in group g_c_0
  int *psize = new int[dims[ROW]];
  int *nbase = new int[dims[ROW]];
  
  nangsloc = setpart_gc1(comm_2d, nangs, psize, nbase);
  imagesloc = new float[psize[mycoords[ROW]]*nx*ny];
  reprojloc = new float[psize[mycoords[ROW]]*nx*ny];
  anglesloc = new float[psize[mycoords[ROW]]*3];
  
// printf("My coords are (%d,%d) and nangsloc = %d\n", mycoords[ROW], mycoords[COL], nangsloc);
  
  if (mycoords[COL] == 0 && mycoords[ROW] == 0) { //I'm Proc. (0,0)
    for(int ip = 0; ip < dims[ROW]; ++ip){
      int begidx = nbase[ip]*nx*ny;
      if (ip !=0){ // Proc (0,0) sends images and angle data to other processors
         srcoords[COL] = 0;
         srcoords[ROW] = ip;
         MPI_Cart_rank(comm_2d, srcoords, &otherpid);
         MPI_Send(&images[begidx],psize[ip]*nx*ny, MPI_FLOAT, otherpid, otherpid, comm_2d);
         MPI_Send(&angles[nbase[ip]*3],psize[ip]*3, MPI_FLOAT, otherpid, otherpid, comm_2d);
      }
      else{ // ip = 0: Proc (0,0) needs to copy images and angles into its imagesloc and anglesloc
        for (int i = 0; i < psize[ip]*nx*ny; i++){
          imagesloc[i] = images[begidx+i];
        }
        for (int i = 0; i < psize[ip]*3; i++){
                anglesloc[i] = angles[nbase[ip]*3 + i];
        }
        //printf("Finished copying to Proc (0,0) local");
      }
    } //End for loop
  } //End if
  
  if (mycoords[COL] == 0 && mycoords[ROW] != 0) { //I'm in g_c_0 and I'm not Processor (0,0) so I should receive data.
    MPI_Recv(imagesloc, psize[mycoords[ROW]]*nx*ny, MPI_FLOAT, 0, mypid, comm_2d, &mpistatus);
    MPI_Recv(anglesloc, psize[mycoords[ROW]]*3, MPI_FLOAT, 0, mypid, comm_2d, &mpistatus);
  }
  // Now have all the processors in group g_c_0 broadcast the images and angles along the row communicator
  srcoords[ROW] = 0;
  MPI_Cart_rank(comm_row, srcoords, &otherpid);
  MPI_Bcast(imagesloc, nangsloc*nx*ny, MPI_FLOAT, otherpid , comm_row);
  MPI_Bcast(anglesloc, nangsloc*3, MPI_FLOAT, otherpid , comm_row);
 
// Now distribute the volume (in spherical format) among columns of processors and use nnz to determine the splitting.  Note: ptrs and coord are on all processors
  int radius;
  int volsize[3], origin[3];
  volsize[0] = nx;
  volsize[1] = nx;
  volsize[2] = nx;
  origin[0] = nx/2+1;
  origin[1] = nx/2+1;
  origin[2] = nx/2+1;
  radius = nx/2-1;
   
  ierr = getnnz( volsize, radius, origin, &nrays, &nnz);
   
  int * ptrs = new int[nrays+1];
  int * cord = new int[3*nrays];
  ierr = getcb2sph(volsize, radius, origin, nnz, ptrs, cord);
                  
  int *nnzpart = new int[dims[COL]];
  int *nnzbase = new int[dims[COL]+1]; 
  nnzloc = setpart_gr1(comm_2d, nnz, nnzpart, nnzbase);
  
  int *ptrstart = new int[dims[COL]+1];
  nraysloc = sphpart(comm_2d, nrays, ptrs, nnzbase, ptrstart);
  
  myptrstart = ptrstart[mycoords[COL]];
  int nnzall[dims[COL]];
  for (int i = 0; i<dims[COL]; i++)
    nnzall[i] = ptrs[ptrstart[i+1]] - ptrs[ptrstart[i]];
  
  nnzloc = nnzall[mycoords[COL]];
  
  // Print some stuff.
 printf("My coords are (%d,%d) and nangsloc = %d, nraysloc = %d, myptrstart = %d, nnzloc = %d\n", mycoords[ROW], mycoords[COL], nangsloc, nraysloc, myptrstart, nnzloc);
  
  float *bvol_loc = new float[nnzloc];
  float *vol_sphloc = new float[nnzloc];
  for (int i=0; i< nnzloc; i++)
    bvol_loc[i] = 0.0;
  
  // STEP 2: Have everyone perform the backprojection operation for their assigned images and portions of the volume.  Then perform an Allreduce along the columns.
  
  float phi, theta, psi;
  float dm[8];
  
  for (int i=0; i<nangsloc; i++){
    phi = anglesloc[3*i+0];
    theta = anglesloc[3*i+1];
    psi = anglesloc[3*i+2];
    dm[6] = 0;
    dm[7] = 0;
 
    make_proj_mat(phi, theta, psi, dm);

    ierr = bckpj3_Cart(volsize, nraysloc, nnzloc, dm, origin, radius, ptrs, cord, myptrstart, &imagesloc[nx*ny*i], bvol_loc);
  }
  
  // Now an all reduce along the columns
  MPI_Allreduce (bvol_loc, vol_sphloc, nnzloc, MPI_FLOAT, MPI_SUM, comm_col);
  
  // For testing purposes, we bring all the portions of the volume back together onto Proc (0,0). Note: we only need to deal with the first row of processors.
  if (mycoords[COL] != 0 && mycoords[ROW] == 0) {
        //Send data to Processor (0,0)
        srcoords[COL] = srcoords[ROW] = 0;
        MPI_Cart_rank(comm_2d, srcoords, &otherpid);
        MPI_Send(vol_sphloc, nnzloc, MPI_FLOAT, otherpid, otherpid, comm_2d);
  }
  float *onevol_sph = new float[nnz];
  if (mycoords[COL] == 0 && mycoords[ROW] ==0){
          //Copy data and recieve data
        float *vol_sph = new float[nnz];
        for (int i=0; i<nnzloc; i++)
          vol_sph[i] = vol_sphloc[i];
        
        for (int i=1; i<dims[COL]; i++){
          srcoords[ROW] = 0;
          srcoords[COL] = i;
          MPI_Cart_rank(comm_2d, srcoords, &otherpid);
                
          MPI_Recv(&vol_sph[ptrs[ptrstart[i]]-1], nnzall[i], MPI_FLOAT, otherpid, mypid, comm_2d, &mpistatus);
        }
        //printf("Finished combining all volume parts\n");
  
  //Now compute the back projection serially on one processor (0,0)
    for (int i=0; i< nnz; i++)
      onevol_sph[i] = 0.0;
    
    for (int i=0; i<nangs; i++){
            phi = angles[3*i+0];
            theta = angles[3*i+1];
            psi = angles[3*i+2];
            dm[6] = 0;
            dm[7] = 0;
 
            make_proj_mat(phi, theta, psi, dm);
  
            ierr = bckpj3(volsize, nrays, nnz, dm, origin, radius, ptrs, cord, &images[nx*ny*i], onevol_sph);
    }
    
    float err=0;
    for (int i=0; i< nnz; i++){
            err = err+(onevol_sph[i]-vol_sph[i])*(onevol_sph[i]-vol_sph[i]);
    }
    err = sqrt(err);
    printf("Cumulative error for backprojection is %f\n", err);
    delete [] vol_sph;
  }
  
    // STEP 3: Now perform a forward projection operation for the assigned images and portions of the volume.  Then perform an all_reduce along the rows.
  float * newimagesloc = new float[nangsloc*nx*ny];
  for (int i=0; i<nangsloc*nx*ny; i++)
          newimagesloc[i] = 0.0;
        
  for (int i=0; i<nangsloc; i++){
  phi = anglesloc[3*i+0];
          theta = anglesloc[3*i+1];
          psi = anglesloc[3*i+2];
          dm[6] = 0;
          dm[7] = 0;
    
          make_proj_mat(phi, theta, psi, dm);
  
         ierr = fwdpj3_Cart(volsize, nraysloc, nnzloc, dm, origin, radius, ptrs, cord, myptrstart, vol_sphloc, &newimagesloc[nx*ny*i]);
  }

  // Now an all reduce along the rows
  MPI_Allreduce (newimagesloc, reprojloc, nangsloc*nx*ny, MPI_FLOAT, MPI_SUM, comm_row);
 
  delete [] newimagesloc;
  // For testing purposes, we bring all the 2D images together onto Proc (0,0). Note: we only need to deal with the first column of processors.
  if (mycoords[ROW] != 0 && mycoords[COL] == 0) {
        //Send data to Processor (0,0)
          srcoords[COL] = srcoords[ROW] = 0;
          MPI_Cart_rank(comm_2d, srcoords, &otherpid);
          MPI_Send(reprojloc, nangsloc*nx*ny, MPI_FLOAT, otherpid, otherpid, comm_2d);
  }
  if (mycoords[COL] == 0 && mycoords[ROW] ==0){
          //Copy data and recieve data
          float *reproj = new float[nangs*nx*ny];
          for (int i=0; i<nangsloc*nx*ny; i++)
                  reproj[i] = reprojloc[i];
        
          for (int i=1; i<dims[ROW]; i++){
                  srcoords[COL] = 0;
                  srcoords[ROW] = i;
                  MPI_Cart_rank(comm_2d, srcoords, &otherpid);
                
                  MPI_Recv(&reproj[nbase[i]*nx*ny], psize[i]*nx*ny, MPI_FLOAT, otherpid, mypid, comm_2d, &mpistatus);
          }
  delete [] reprojloc;
  // Now compute the forward projection serially on one processor (0,0)

          float *allimages = new float[nangs*nx*ny];
          for (int i=0; i< nangs*nx*ny; i++)
                  allimages[i] = 0.0;
    
          for (int i=0; i<nangs; i++){
            phi = angles[3*i+0];
            theta = angles[3*i+1];
            psi = angles[3*i+2];
            dm[6] = 0;
            dm[7] = 0;
    
            make_proj_mat(phi, theta, psi, dm);
                  
            ierr = fwdpj3(volsize, nrays, nnz, dm, origin, radius, ptrs, cord, onevol_sph, &allimages[nx*ny*i]);

          }

          //  Now compute the overall error.
int idx;        
  float err=0, max =0;
          for (int i=0; i< nangs*nx*ny; i++){
                //if (allimages[i]!=reproj[i] && i < 256)
                //      printf("i= %d\n",i);
                
            err = err+(allimages[i]-reproj[i])*(allimages[i]-reproj[i]);

                if (fabs(allimages[i]-reproj[i]) > max){
                        max = fabs(allimages[i]-reproj[i]);
idx = i;
}
          }
err = sqrt(err);  
          printf("Cumulative error for forward projection is %f with max error of %f occuring at %d\n", err, max, idx);
printf("Max error: compare %f and %f\n",allimages[idx], reproj[idx]);

          delete [] reproj;
          delete [] allimages;
          delete [] angles;
          delete [] images;
  }
  delete [] onevol_sph;
  delete [] vol_sphloc;
  delete [] bvol_loc;  
  delete [] ptrs;
  delete [] cord;
  delete [] nnzpart;
  delete [] nnzbase;
  delete [] ptrstart;
  delete [] anglesloc;
  delete [] imagesloc;
  delete [] nbase;
  delete [] psize;        
  
  MPI_Comm_free(&comm_2d);
  MPI_Comm_free(&comm_row);
  MPI_Comm_free(&comm_col);
  
  MPI_Finalize();
}
int make_proj_mat ( float  phi,
float  theta,
float  psi,
float *  dm 
)

Definition at line 354 of file project3d.cpp.

References phi, and theta.

Referenced by LBD_Cart(), main(), recons3d_CGLS_mpi_Cart(), recons3d_sirt_mpi(), and recons3d_sirt_mpi_Cart().

{
//     float cphi=cos(phi);
//     float sphi=sin(phi);
//     float cthe=cos(theta);
//     float sthe=sin(theta);
//     float cpsi=cos(psi);
//     float spsi=sin(psi);

    double cphi, sphi, cthe, sthe, cpsi, spsi;
    double dphi = phi;
    double dthe = theta;
    double dpsi = psi;
    sincos(dphi, &sphi, &cphi);
    sincos(dthe, &sthe, &cthe);
    sincos(dpsi, &spsi, &cpsi);

    dm[0]=cphi*cthe*cpsi-sphi*spsi;
    dm[1]=sphi*cthe*cpsi+cphi*spsi;
    dm[2]=-sthe*cpsi;
    dm[3]=-cphi*cthe*spsi-sphi*cpsi;
    dm[4]=-sphi*cthe*spsi+cphi*cpsi;
    dm[5]=sthe*spsi;

    return 0;
}
int setpart_gc1 ( MPI_Comm  comm_2d,
int  nangs,
int *  psize,
int *  nbase 
)

Definition at line 323 of file utilcomm_Cart.cpp.

References COL, nangsloc, and ROW.

Referenced by main(), and ReadStackandDist_Cart().

{
        int ROW = 0, COL = 1;
        int dims[2], periods[2], mycoords[2];
        int nangsloc, nrem;

        // Get information associated with comm_2d
        MPI_Cart_get(comm_2d, 2, dims, periods, mycoords);
 
        nangsloc = nangs/dims[ROW];
        nrem = nangs - dims[ROW]*nangsloc;
        if (mycoords[ROW] < nrem) nangsloc++;

        for (int i = 0; i < dims[ROW]; i++) {
                psize[i] = nangs/dims[ROW];
                if (i < nrem) psize[i]++;
        }
 
        for (int i = 0; i < dims[ROW]; i++) {
          if(i==0)
            nbase[i] = 0;
          else
            nbase[i] = nbase[i-1] + psize[i-1];
        }
   
//printf("I am [%d,%d], nloc = %d, psize = [%d, %d], nbase = [%d, %d]", mycoords[ROW], mycoords[COL],nangsloc,psize[0],psize[1], nbase[0], nbase[1]);

        return nangsloc;
}
int setpart_gr1 ( MPI_Comm  comm_2d,
int  nnz,
int *  nnzpart,
int *  nnzbase 
)

Definition at line 364 of file utilcomm_Cart.cpp.

References COL, nnz, nnzloc, and ROW.

Referenced by main(), recons3d_CGLS_mpi_Cart(), recons3d_HyBR_mpi_Cart(), and recons3d_sirt_mpi_Cart().

{
        int ROW = 0, COL = 1;
        int dims[2], periods[2], mycoords[2];
        int nnzloc, nrem;
        
        // Get information associated with comm_2d
        MPI_Cart_get(comm_2d, 2, dims, periods, mycoords);
 
        nnzloc = nnz/dims[COL];
        nrem = nnz - dims[COL]*nnzloc;
        if (mycoords[COL] < nrem) nnzloc++;

        for (int i = 0; i < dims[COL]; i++) {
                nnzpart[i] = nnz/dims[COL];
                if (i < nrem) nnzpart[i]++;
        }
 
        nnzbase[0] = 0; 
        for (int i = 1; i < dims[COL]; i++) {
                nnzbase[i] = nnzbase[i-1] + nnzpart[i-1];
        }
        nnzbase[dims[COL]] = nnz;
        return nnzloc;
}
int sphpart ( MPI_Comm  comm_2d,
int  nrays,
int *  ptrs,
int *  nnzbase,
int *  ptrstart 
)

Definition at line 85 of file project3d_Cart.cpp.

References COL, nrays, nraysloc, and ROW.

Referenced by main(), recons3d_CGLS_mpi_Cart(), recons3d_HyBR_mpi_Cart(), and recons3d_sirt_mpi_Cart().

{
        int ROW = 0, COL = 1;
        int dims[2], periods[2], mycoords[2];
        int nraysloc = 0;
        
        // Get information associated with comm_2d
        MPI_Cart_get(comm_2d, 2, dims, periods, mycoords);

        int count = 1;
        if (mycoords[COL] == 0){ // First column starts out with the first ray
          nraysloc++;
        }
        ptrstart[0] = 0;

        for(int i=1; i<nrays ; i++){
          if (ptrs[i]-1 <= nnzbase[count] && ptrs[i+1]-1 >= nnzbase[count]){ 
                //nnzbase is between or equal to ptrs

            if (nnzbase[count]-(ptrs[i]-1)>= ptrs[i+1]-1-nnzbase[count]){
              if(mycoords[COL] == count-1){  // ray belongs to count-1
                nraysloc++;
              }
              ptrstart[count] = i+1;
              count++;

            } else { //nnzbase[count]-(ptrs[i]-1)>= ptrs[i+1]-1-nnzbase[count]
                if(mycoords[COL] == count){// ray belongs to count and it's a new starting ray
                  nraysloc++;
                }
                ptrstart[count] = i;
                count++;
            }

        }
        else {  //ptrs[i]-1 > nnzbase[count] so ray belongs to count-1
          if(mycoords[COL] == count-1){
            nraysloc++;
          }

        }
        } // end for
        ptrstart[dims[COL]] = nrays;
        return nraysloc;

}

Variable Documentation

float* angles
float * anglesloc

Definition at line 12 of file runcartrec.cpp.

Referenced by main().

float * images

Definition at line 10 of file runcartrec.cpp.

Referenced by EMAN::EMData::common_lines_real(), and main().

float* imagesloc

Definition at line 10 of file runcartrec.cpp.

Referenced by main().

int nangs

Definition at line 8 of file runcartrec.cpp.

Referenced by main().

int nangsloc

Definition at line 8 of file runcartrec.cpp.

Referenced by main(), and setpart_gc1().

float* newimagesloc

Definition at line 11 of file runcartrec.cpp.

Referenced by main().

int nnz
int nnzloc
int nrays
int nraysloc
int nx

Definition at line 8 of file runcartrec.cpp.

Referenced by EMAN::MeanShrinkProcessor::accrue_mean_one_p_five(), EMAN::MedianShrinkProcessor::accrue_median(), add_complex_at_fast(), EMAN::newfile_store::add_image(), EMAN::MinMaxAverager::add_image(), EMAN::FourierWeightAverager::add_image(), EMAN::ImageAverager::add_image(), EMAN::TomoAverager::add_image(), EMAN::Util::add_img(), EMAN::Util::add_img2(), EMAN::Util::add_img_abs(), EMAN::Util::addn_img(), ali3d_d(), EMAN::FRM2DAligner::align(), EMAN::RTFSlowExhaustiveAligner::align(), EMAN::TranslationalAligner::align(), EMAN::PCAlarge::analyze(), EMAN::ShapeAnalyzer::analyze(), EMAN::InertiaMatrixAnalyzer::analyze(), EMAN::EMData::ap2ri(), apmd(), apmq(), asta2(), EMAN::BoxingTools::auto_correlation_pick(), EMAN::EMData::average_circ_sub(), EMAN::PawelProjector::backproject3d(), EMAN::ChaoProjector::bckpj3(), bckpj3(), bckpj3_Cart(), EMAN::EMData::calc_fourier_shell_correlation(), EMAN::NormalizeLREdgeMeanProcessor::calc_mean(), EMAN::ChaoProjector::cb2sph(), cb2sph(), EMAN::EMData::center_origin(), EMAN::EMData::center_origin_fft(), EMAN::EMData::center_origin_yz(), circumference(), CleanStack(), CleanStack_Cart(), EMAN::Util::cluster_equalsize(), EMAN::Util::cluster_pairwise(), EMAN::Util::cml_line_in3d(), EMAN::Util::cml_prepare_line(), EMAN::XYZCmp::cmp(), EMAN::OptVarianceCmp::cmp(), EMAN::QuadMinDotCmp::cmp(), EMAN::TomoFscCmp::cmp(), EMAN::DotCmp::cmp(), EMAN::SqEuclideanCmp::cmp(), cmplx(), EMAN::EMData::cog(), EMAN::Util::colreverse(), wustl_mm::SkeletonMaker::Volume::components26(), wustl_mm::SkeletonMaker::Volume::components6(), EMAN::Util::compress_image_mask(), EMAN::EMAN2Ctf::compute_1d_fromimage(), EMAN::EMAN2Ctf::compute_2d_complex(), EMAN::EMAN1Ctf::compute_2d_complex(), EMAN::EMData::conjg(), wustl_mm::SkeletonMaker::Volume::countInt(), wustl_mm::SkeletonMaker::Volume::countIntEuler(), wustl_mm::SkeletonMaker::Volume::curveSkeleton(), wustl_mm::SkeletonMaker::Volume::curveSkeleton2D(), EMAN::Util::cyclicshift(), EMAN::Util::decimate(), EMAN::EMData::delete_disconnected_regions(), EMAN::EMData::depad(), EMAN::EMData::depad_corner(), EMAN::Util::div_filter(), EMAN::Util::div_img(), EMAN::EMData::divkbsinh(), EMAN::EMData::divkbsinh_rect(), EMAN::Util::divn_filter(), EMAN::Util::divn_img(), EMAN::EMData::do_fft(), EMAN::EMData::do_fft_inplace(), EMAN::EMData::do_ift(), EMAN::EMData::do_ift_inplace(), EMAN::PCA::dopca_lan(), EMAN::PCA::dopca_ooc(), EMAN::EMData::downsample(), EMAN::TestUtil::dump_emdata(), EMAN::Processor::EMFourierFilterFunc(), wustl_mm::SkeletonMaker::Volume::erodeHelix(), wustl_mm::SkeletonMaker::Volume::erodeSheet(), EMAN::EMData::extract_plane(), EMAN::EMData::extract_plane_rect(), EMAN::EMData::extract_plane_rect_fast(), EMAN::EMData::extractline(), EMAN::EMData::extractpoint(), fcalc(), EMAN::FFTResampleProcessor::fft_resample(), EMAN::EMData::fft_shuffle(), fgcalc(), EMAN::EMData::FH2F(), EMAN::AutoMask3DProcessor::fill_nearby(), EMAN::EMData::filter_by_image(), EMAN::EMData::find_3d_threshold(), find_group(), EMAN::CtfCAutoAverager::finish(), EMAN::CtfCWautoAverager::finish(), EMAN::IterationAverager::finish(), EMAN::FourierWeightAverager::finish(), EMAN::TomoAverager::finish(), EMAN::Util::flip_image(), EMAN::EMData::Four_ds(), EMAN::EMData::Four_shuf_ds_cen_us(), EMAN::Phase180Processor::fourier_phaseshift180(), EMAN::EMData::fouriergridrot2d(), EMAN::EMData::fouriergridrot_shift2d(), EMAN::fourierproduct(), EMAN::EMData::FourInterpol(), EMAN::EMData::FourTruncate(), EMAN::ChaoProjector::fwdpj3(), fwdpj3(), fwdpj3_Cart(), EMAN::Util::get_biggest_cluster(), get_complex_index_fast(), EMAN::EMData::get_pixel_conv(), EMAN::EMData::get_pixel_conv7(), EMAN::Util::get_pixel_conv_new(), EMAN::Util::get_pixel_conv_new_background(), EMAN::EMData::get_pixel_filtered(), EMAN::EMData::get_pow(), EMAN::EMUtil::get_region_dims(), get_size(), EMAN::Util::get_slice(), get_value_at(), get_xsize(), EMAN::XYData::get_yatx(), EMAN::XYData::get_yatx_smooth(), getcb2sph(), EMAN::EMData::getconvpt2d_kbi0(), EMAN::ChaoProjector::getnnz(), getnnz(), wustl_mm::SkeletonMaker::Volume::getNumNeighbor6(), wustl_mm::SkeletonMaker::Volume::getNumPotComplex(), wustl_mm::SkeletonMaker::Volume::hasCompleteHelix(), wustl_mm::SkeletonMaker::Volume::hasCompleteSheet(), EMAN::EMData::helicise(), EMAN::EMData::helicise_grid(), EMAN::Util::histogram(), ilaenv_(), EMAN::Util::im_diff(), EMAN::Util::image_mutation(), EMAN::Util::infomask(), EMAN::ImagicIO2::init_test(), EMAN::EMData::insert_clip(), EMAN::PCAlarge::insert_image(), EMAN::PCAsmall::insert_image(), EMAN::EMData::insert_rect_slice(), EMAN::EMData::insert_rect_slice_ctf(), EMAN::EMData::insert_rect_slice_ctf_applied(), EMAN::EMData::insert_scaled_sum(), EMAN::GaussFFTProjector::interp_ft_3d(), EMAN::OmapIO::is_valid(), EMAN::MrcIO::is_valid(), EMAN::ImagicIO2::is_valid(), EMAN::ImagicIO::is_valid(), EMAN::EmIO::is_valid(), wustl_mm::SkeletonMaker::Volume::isFeatureFace(), wustl_mm::SkeletonMaker::Volume::isHelixEnd(), wustl_mm::SkeletonMaker::Volume::isSheetEnd(), LBD_Cart(), EMAN::Util::local_inner_product(), EMAN::Util::mad_scalar(), EMAN::Util::madn_scalar(), main(), EMAN::TestUtil::make_image_file(), EMAN::TestUtil::make_image_file2(), EMAN::TestUtil::make_image_file_by_mode(), wustl_mm::SkeletonMaker::Volume::markCellFace(), EMAN::Util::min_dist_four(), EMAN::Util::move_points(), EMAN::Util::mul_img(), EMAN::Util::mul_scalar(), EMAN::Util::muln_img(), EMAN::EMData::mult_radial(), EMAN::Util::mult_scalar(), EMAN::EMData::nn_SSNR(), EMAN::EMData::nn_SSNR_ctf(), EMAN::EMData::norm_pad(), operator()(), EMAN::Util::pack_complex_to_real(), EMAN::Util::pad(), EMAN::EMData::pad_corner(), EMAN::padfft_slice(), EMAN::EMData::peak_ccf(), EMAN::EMData::peak_search(), EMAN::periodogram(), EMAN::EMData::phase_cog(), EMAN::Util::Polar2Dmi(), EMAN::PawelProjector::prepcubes(), printImage(), EMAN::Util::printMatI3D(), EMAN::ConvolutionKernelProcessor::process(), EMAN::WatershedProcessor::process(), EMAN::DirectionalSumProcessor::process(), EMAN::BooleanShrinkProcessor::process(), EMAN::KmeansSegmentProcessor::process(), EMAN::DistanceSegmentProcessor::process(), EMAN::ApplyPolynomialProfileToHelix::process_inplace(), EMAN::ModelEMCylinderProcessor::process_inplace(), EMAN::Rotate180Processor::process_inplace(), EMAN::MirrorProcessor::process_inplace(), EMAN::RadialProcessor::process_inplace(), EMAN::WaveletProcessor::process_inplace(), EMAN::TestImageCylinder::process_inplace(), EMAN::TestImageEllipse::process_inplace(), EMAN::TestImageHollowEllipse::process_inplace(), EMAN::TestImageCirclesphere::process_inplace(), EMAN::TestImageSquarecube::process_inplace(), EMAN::TestImageSinewaveCircular::process_inplace(), EMAN::TestImageSinewave::process_inplace(), EMAN::TestImageSphericalWave::process_inplace(), EMAN::TestImagePureGaussian::process_inplace(), EMAN::TestImageScurve::process_inplace(), EMAN::TestImageGradient::process_inplace(), EMAN::TestImageGaussian::process_inplace(), EMAN::TestImageFourierNoiseProfile::process_inplace(), EMAN::CTFSNRWeightProcessor::process_inplace(), EMAN::TestImageFourierNoiseGaussian::process_inplace(), EMAN::IterBinMaskProcessor::process_inplace(), EMAN::AutoMaskDustProcessor::process_inplace(), EMAN::AutoMask3DProcessor::process_inplace(), EMAN::SmartMaskProcessor::process_inplace(), EMAN::CoordinateMaskFileProcessor::process_inplace(), EMAN::SymSearchProcessor::process_inplace(), EMAN::StripeXYProcessor::process_inplace(), EMAN::AddMaskShellProcessor::process_inplace(), EMAN::AddRandomNoiseProcessor::process_inplace(), EMAN::AutoMask2DProcessor::process_inplace(), EMAN::AutoMaskAsymUnit::process_inplace(), EMAN::PhaseToCenterProcessor::process_inplace(), EMAN::PhaseToCornerProcessor::process_inplace(), EMAN::FourierToCenterProcessor::process_inplace(), EMAN::FourierToCornerProcessor::process_inplace(), EMAN::FlipProcessor::process_inplace(), EMAN::RotationalSubstractProcessor::process_inplace(), EMAN::RotationalAverageProcessor::process_inplace(), EMAN::BilateralProcessor::process_inplace(), EMAN::NormalizeRowProcessor::process_inplace(), EMAN::DecayEdgeProcessor::process_inplace(), EMAN::AverageXProcessor::process_inplace(), EMAN::MeanZeroEdgeProcessor::process_inplace(), EMAN::BeamstopProcessor::process_inplace(), EMAN::SigmaZeroEdgeProcessor::process_inplace(), EMAN::RealToFFTProcessor::process_inplace(), EMAN::VerticalStripeProcessor::process_inplace(), EMAN::GradientPlaneRemoverProcessor::process_inplace(), EMAN::GradientRemoverProcessor::process_inplace(), EMAN::BooleanShrinkProcessor::process_inplace(), EMAN::CutoffBlockProcessor::process_inplace(), EMAN::DiffBlockProcessor::process_inplace(), EMAN::BoxStatProcessor::process_inplace(), EMAN::PaintProcessor::process_inplace(), EMAN::LowpassRandomPhaseProcessor::process_inplace(), EMAN::LinearPyramidProcessor::process_inplace(), EMAN::Axis0FourierProcessor::process_inplace(), EMAN::EMUtil::process_region_io(), EMAN::FourierGriddingProjector::project3d(), EMAN::MaxValProjector::project3d(), EMAN::StandardProjector::project3d(), EMAN::PawelProjector::project3d(), ReadStackandDist(), ReadStackandDist_Cart(), ReadVandBcast(), EMAN::EMData::real2FH(), recons3d_CGLS_mpi_Cart(), recons3d_HyBR_mpi_Cart(), recons3d_sirt_mpi(), recons3d_sirt_mpi_Cart(), EMAN::Util::reconstitute_image_mask(), EMAN::EMData::render_amp24(), EMAN::EMData::render_ap24(), EMAN::EMData::replace_amplitudes(), restrict1(), restrict2(), EMAN::EMData::ri2ap(), EMAN::EMData::ri2inten(), EMAN::EMData::rot_scale_conv(), EMAN::EMData::rot_scale_conv7(), EMAN::EMData::rot_scale_conv_new(), EMAN::EMData::rot_scale_conv_new_3D(), EMAN::EMData::rot_scale_conv_new_background(), EMAN::EMData::rot_scale_conv_new_background_3D(), EMAN::EMData::rot_scale_trans(), EMAN::EMData::rot_scale_trans2D(), EMAN::EMData::rot_scale_trans2D_background(), EMAN::EMData::rot_scale_trans_background(), EMAN::Util::rotate_phase_origin(), EMAN::EMData::rotavg(), EMAN::EMData::rotavg_i(), EMAN::EMData::scale_factors(), set_data(), EMAN::Util::set_freq(), EMAN::PointArray::set_from_density_map(), EMAN::Util::set_line(), EMAN::varimax::set_params(), EMAN::PCAlarge::set_params(), EMAN::PCAsmall::set_params(), set_value_at(), set_value_at_fast(), sgebrd_(), sgelqf_(), sgeqrf_(), EMAN::EMData::shuffle_pad_corner(), wustl_mm::SkeletonMaker::Volume::skeleton(), sorglq_(), sorgql_(), sorgqr_(), EMAN::ChaoProjector::sph2cb(), sph2cb(), EMAN::Util::square_img(), EMAN::Util::squaren_img(), ssytrd_(), EMAN::Util::sub_img(), EMAN::Util::subn_img(), wustl_mm::SkeletonMaker::Volume::surfaceSkeletonPres(), EMAN::EMData::symplane0_rect(), EMAN::EMData::symvol(), EMAN::TestUtil::to_emobject(), EMAN::TransformProcessor::transform(), unified(), EMAN::TestUtil::verify_image_file(), EMAN::TestUtil::verify_image_file2(), EMAN::TestUtil::verify_image_file_by_mode(), EMAN::EMUtil::vertical_acf(), EMAN::Util::window(), and EMAN::SpiderIO::write_single_header().

int ny

Definition at line 8 of file runcartrec.cpp.

Referenced by EMAN::MeanShrinkProcessor::accrue_mean(), EMAN::MeanShrinkProcessor::accrue_mean_one_p_five(), EMAN::MedianShrinkProcessor::accrue_median(), add_complex_at_fast(), EMAN::newfile_store::add_image(), EMAN::MinMaxAverager::add_image(), EMAN::FourierWeightAverager::add_image(), EMAN::ImageAverager::add_image(), EMAN::TomoAverager::add_image(), EMAN::Util::add_img(), EMAN::Util::add_img2(), EMAN::Util::add_img_abs(), EMAN::Util::addn_img(), ali3d_d(), EMAN::RTFExhaustiveAligner::align(), EMAN::RotatePrecenterAligner::align(), EMAN::TranslationalAligner::align(), EMAN::ShapeAnalyzer::analyze(), EMAN::InertiaMatrixAnalyzer::analyze(), EMAN::EMData::ap2ri(), apmd(), apmq(), asta2(), EMAN::BoxingTools::auto_correlation_pick(), EMAN::EMData::average_circ_sub(), EMAN::PawelProjector::backproject3d(), bckpj3(), bckpj3_Cart(), EMAN::EMData::calc_fourier_shell_correlation(), EMAN::ChaoProjector::cb2sph(), cb2sph(), EMAN::EMData::center_origin(), EMAN::EMData::center_origin_fft(), EMAN::EMData::center_origin_yz(), circumference(), CleanStack(), CleanStack_Cart(), EMAN::Util::cml_line_in3d(), EMAN::XYZCmp::cmp(), EMAN::FRCCmp::cmp(), EMAN::PhaseCmp::cmp(), EMAN::QuadMinDotCmp::cmp(), EMAN::TomoFscCmp::cmp(), EMAN::DotCmp::cmp(), EMAN::SqEuclideanCmp::cmp(), cmplx(), EMAN::EMData::cog(), wustl_mm::SkeletonMaker::Volume::components26(), wustl_mm::SkeletonMaker::Volume::components6(), EMAN::Util::compress_image_mask(), EMAN::EMAN2Ctf::compute_1d_fromimage(), EMAN::EMAN2Ctf::compute_2d_complex(), EMAN::EMAN1Ctf::compute_2d_complex(), EMAN::EMData::conjg(), wustl_mm::SkeletonMaker::Volume::countInt(), wustl_mm::SkeletonMaker::Volume::countIntEuler(), EMAN::Util::ctf2_rimg(), EMAN::Util::ctf_img(), EMAN::Util::ctf_rimg(), wustl_mm::SkeletonMaker::Volume::curveSkeleton(), wustl_mm::SkeletonMaker::Volume::curveSkeleton2D(), EMAN::Util::cyclicshift(), EMAN::Util::decimate(), EMAN::EMData::delete_disconnected_regions(), EMAN::EMData::depad(), EMAN::EMData::depad_corner(), EMAN::Util::div_filter(), EMAN::Util::div_img(), EMAN::EMData::divkbsinh(), EMAN::EMData::divkbsinh_rect(), EMAN::Util::divn_filter(), EMAN::Util::divn_img(), EMAN::EMData::do_fft(), EMAN::EMData::do_fft_inplace(), EMAN::EMData::do_ift(), EMAN::EMData::do_ift_inplace(), EMAN::EMData::downsample(), EMAN::TestUtil::dump_emdata(), EMAN::Processor::EMFourierFilterFunc(), wustl_mm::SkeletonMaker::Volume::erodeHelix(), wustl_mm::SkeletonMaker::Volume::erodeSheet(), EMAN::EMData::extract_plane(), EMAN::EMData::extract_plane_rect(), EMAN::EMData::extract_plane_rect_fast(), EMAN::EMData::extractline(), EMAN::EMData::extractpoint(), fcalc(), EMAN::FFTResampleProcessor::fft_resample(), EMAN::EMData::fft_shuffle(), fgcalc(), EMAN::EMData::FH2F(), EMAN::AutoMask3DProcessor::fill_nearby(), EMAN::EMData::filter_by_image(), EMAN::EMData::find_3d_threshold(), find_group(), EMAN::CtfCAutoAverager::finish(), EMAN::CtfCWautoAverager::finish(), EMAN::IterationAverager::finish(), EMAN::FourierWeightAverager::finish(), EMAN::TomoAverager::finish(), EMAN::EMData::Four_ds(), EMAN::EMData::Four_shuf_ds_cen_us(), EMAN::Phase180Processor::fourier_phaseshift180(), EMAN::EMData::fouriergridrot2d(), EMAN::EMData::fouriergridrot_shift2d(), EMAN::fourierproduct(), EMAN::EMData::FourInterpol(), EMAN::EMData::FourTruncate(), fwdpj3(), fwdpj3_Cart(), EMAN::Util::get_biggest_cluster(), get_complex_index_fast(), get_ndim(), EMAN::EMData::get_pixel_conv(), EMAN::EMData::get_pixel_conv7(), EMAN::Util::get_pixel_conv_new(), EMAN::Util::get_pixel_conv_new_background(), EMAN::EMData::get_pixel_filtered(), EMAN::EMData::get_pow(), EMAN::EMUtil::get_region_dims(), get_size(), EMAN::Util::get_slice(), get_ysize(), getcb2sph(), EMAN::EMData::getconvpt2d_kbi0(), EMAN::ChaoProjector::getnnz(), getnnz(), wustl_mm::SkeletonMaker::Volume::getNumNeighbor6(), wustl_mm::SkeletonMaker::Volume::getNumPotComplex(), wustl_mm::SkeletonMaker::Volume::hasCompleteHelix(), wustl_mm::SkeletonMaker::Volume::hasCompleteSheet(), EMAN::EMData::helicise(), EMAN::EMData::helicise_grid(), EMAN::Util::histogram(), EMAN::Util::im_diff(), EMAN::Util::infomask(), EMAN::ImagicIO2::init_test(), EMAN::EMData::insert_clip(), EMAN::EMData::insert_rect_slice(), EMAN::EMData::insert_rect_slice_ctf(), EMAN::EMData::insert_rect_slice_ctf_applied(), EMAN::EMData::insert_scaled_sum(), EMAN::GaussFFTProjector::interp_ft_3d(), EMAN::OmapIO::is_valid(), EMAN::MrcIO::is_valid(), EMAN::ImagicIO2::is_valid(), EMAN::ImagicIO::is_valid(), EMAN::EmIO::is_valid(), wustl_mm::SkeletonMaker::Volume::isFeatureFace(), wustl_mm::SkeletonMaker::Volume::isHelixEnd(), wustl_mm::SkeletonMaker::Volume::isSheetEnd(), EMAN::Util::local_inner_product(), EMAN::Util::mad_scalar(), EMAN::Util::madn_scalar(), main(), EMAN::TestUtil::make_image_file(), EMAN::TestUtil::make_image_file2(), EMAN::TestUtil::make_image_file_by_mode(), wustl_mm::SkeletonMaker::Volume::markCellFace(), EMAN::Util::min_dist_four(), EMAN::Util::move_points(), EMAN::Util::mul_img(), EMAN::Util::mul_scalar(), EMAN::Util::muln_img(), EMAN::EMData::mult_radial(), EMAN::Util::mult_scalar(), EMAN::EMData::nn(), EMAN::EMData::nn_ctf(), EMAN::EMData::nn_ctf_applied(), EMAN::EMData::nn_ctfw(), EMAN::EMData::nn_SSNR(), EMAN::EMData::nn_SSNR_ctf(), EMAN::EMData::norm_pad(), operator()(), EMAN::Util::pack_complex_to_real(), EMAN::Util::pad(), EMAN::EMData::pad_corner(), EMAN::padfft_slice(), EMAN::EMData::peak_ccf(), EMAN::EMData::peak_search(), EMAN::periodogram(), EMAN::EMData::phase_cog(), EMAN::Util::Polar2Dmi(), EMAN::PawelProjector::prepcubes(), printImage(), EMAN::Util::printMatI3D(), EMAN::WatershedProcessor::process(), EMAN::DirectionalSumProcessor::process(), EMAN::BooleanShrinkProcessor::process(), EMAN::KmeansSegmentProcessor::process(), EMAN::DistanceSegmentProcessor::process(), EMAN::EMUtil::process_ascii_region_io(), EMAN::ApplyPolynomialProfileToHelix::process_inplace(), EMAN::ModelEMCylinderProcessor::process_inplace(), EMAN::TomoTiltEdgeMaskProcessor::process_inplace(), EMAN::Rotate180Processor::process_inplace(), EMAN::MirrorProcessor::process_inplace(), EMAN::RadialProcessor::process_inplace(), EMAN::WaveletProcessor::process_inplace(), EMAN::TestImageCylinder::process_inplace(), EMAN::TestImageEllipse::process_inplace(), EMAN::TestImageHollowEllipse::process_inplace(), EMAN::TestImageCirclesphere::process_inplace(), EMAN::TestImageSquarecube::process_inplace(), EMAN::TestImageSinewaveCircular::process_inplace(), EMAN::TestImageSinewave::process_inplace(), EMAN::TestImageSphericalWave::process_inplace(), EMAN::TestImagePureGaussian::process_inplace(), EMAN::TestImageAxes::process_inplace(), EMAN::TestImageGradient::process_inplace(), EMAN::TestImageGaussian::process_inplace(), EMAN::IterBinMaskProcessor::process_inplace(), EMAN::AutoMask3D2Processor::process_inplace(), EMAN::AutoMaskDustProcessor::process_inplace(), EMAN::AutoMask3DProcessor::process_inplace(), EMAN::SmartMaskProcessor::process_inplace(), EMAN::CoordinateMaskFileProcessor::process_inplace(), EMAN::SymSearchProcessor::process_inplace(), EMAN::StripeXYProcessor::process_inplace(), EMAN::AddMaskShellProcessor::process_inplace(), EMAN::AddRandomNoiseProcessor::process_inplace(), EMAN::AutoMaskAsymUnit::process_inplace(), EMAN::PhaseToCenterProcessor::process_inplace(), EMAN::PhaseToCornerProcessor::process_inplace(), EMAN::FourierToCenterProcessor::process_inplace(), EMAN::FourierToCornerProcessor::process_inplace(), EMAN::FlipProcessor::process_inplace(), EMAN::RotationalSubstractProcessor::process_inplace(), EMAN::RotationalAverageProcessor::process_inplace(), EMAN::BilateralProcessor::process_inplace(), EMAN::NormalizeRowProcessor::process_inplace(), EMAN::ZeroEdgePlaneProcessor::process_inplace(), EMAN::DecayEdgeProcessor::process_inplace(), EMAN::AverageXProcessor::process_inplace(), EMAN::MeanZeroEdgeProcessor::process_inplace(), EMAN::BeamstopProcessor::process_inplace(), EMAN::SigmaZeroEdgeProcessor::process_inplace(), EMAN::RealToFFTProcessor::process_inplace(), EMAN::VerticalStripeProcessor::process_inplace(), EMAN::GradientPlaneRemoverProcessor::process_inplace(), EMAN::GradientRemoverProcessor::process_inplace(), EMAN::BooleanShrinkProcessor::process_inplace(), EMAN::CutoffBlockProcessor::process_inplace(), EMAN::DiffBlockProcessor::process_inplace(), EMAN::BoxStatProcessor::process_inplace(), EMAN::PaintProcessor::process_inplace(), EMAN::LowpassRandomPhaseProcessor::process_inplace(), EMAN::LinearPyramidProcessor::process_inplace(), EMAN::Axis0FourierProcessor::process_inplace(), EMAN::EMUtil::process_region_io(), EMAN::FourierGriddingProjector::project3d(), EMAN::MaxValProjector::project3d(), EMAN::StandardProjector::project3d(), EMAN::PawelProjector::project3d(), ReadStackandDist(), ReadStackandDist_Cart(), ReadVandBcast(), EMAN::EMData::real2FH(), EMAN::Util::reconstitute_image_mask(), EMAN::EMData::render_amp24(), EMAN::EMData::render_ap24(), EMAN::EMData::replace_amplitudes(), EMAN::EMData::ri2ap(), EMAN::EMData::ri2inten(), EMAN::EMData::rot_scale_conv(), EMAN::EMData::rot_scale_conv7(), EMAN::EMData::rot_scale_conv_new(), EMAN::EMData::rot_scale_conv_new_3D(), EMAN::EMData::rot_scale_conv_new_background(), EMAN::EMData::rot_scale_conv_new_background_3D(), EMAN::EMData::rot_scale_trans(), EMAN::EMData::rot_scale_trans2D(), EMAN::EMData::rot_scale_trans2D_background(), EMAN::EMData::rot_scale_trans_background(), EMAN::Util::rotate_phase_origin(), EMAN::EMData::rotavg(), EMAN::EMData::rotavg_i(), EMAN::EMData::scale_factors(), EMAN::AutoMask3DProcessor::search_nearby(), set_complex_size(), set_data(), EMAN::Util::set_freq(), EMAN::PointArray::set_from_density_map(), EMAN::varimax::set_params(), EMAN::PCAlarge::set_params(), EMAN::PCAsmall::set_params(), set_value_at(), EMAN::EMData::shuffle_pad_corner(), wustl_mm::SkeletonMaker::Volume::skeleton(), EMAN::Util::slicereverse(), EMAN::ChaoProjector::sph2cb(), sph2cb(), EMAN::Util::square_img(), EMAN::Util::squaren_img(), EMAN::Util::sub_img(), EMAN::Util::subn_img(), wustl_mm::SkeletonMaker::Volume::surfaceSkeletonPres(), EMAN::Phase180Processor::swap_central_slices_180(), EMAN::Phase180Processor::swap_corners_180(), EMAN::EMData::symplane0_rect(), EMAN::EMData::symvol(), EMAN::TestUtil::to_emobject(), EMAN::TransformProcessor::transform(), unified(), EMAN::Util::vareas(), EMAN::TestUtil::verify_image_file(), EMAN::TestUtil::verify_image_file2(), EMAN::TestUtil::verify_image_file_by_mode(), EMAN::EMUtil::vertical_acf(), EMAN::Util::window(), and EMAN::SpiderIO::write_single_header().

float* onevol_sph

Definition at line 14 of file runcartrec.cpp.

Referenced by main().

float * reproj

Definition at line 14 of file runcartrec.cpp.

Referenced by main().

float * reprojloc

Definition at line 11 of file runcartrec.cpp.

Referenced by main().

float* vol_sph

Definition at line 13 of file runcartrec.cpp.

Referenced by main().