-#ifdef MPI_CT
-#define MPI_MAX_PROCESS 128
-struct mpi_ct_st
-{
- int my_rank;
- int nproc;
- int base_local_work_units;
- int remainder_work_units;
- int local_work_units[MPI_MAX_PROCESS];
- int start_work_unit[MPI_MAX_PROCESS];
- MPI_Comm comm;
-};
-
-extern struct mpi_ct_st mpi_ct;
-void mpi_ct_calc_work_units(const unsigned int global_work_units);
-#endif
-
-
-struct histo_st {
- int *b; /* Histogram array (# of elements in each bin) */
- int nbin; /* Number of histogram bins */
- double xmin, xmax, xinc; /* Limits of histogram boundaries */
-};
-
-typedef struct histo_st HISTOGRAM;
-
-/*---------------------------------------------------------------------------*/
-
-static const int POINTS_PER_CIRCLE=90;
-#define MAXREMARK 99
-
-typedef FMTX_2D IMAGE_ARRAY; /* use 2d floating point matrix */
-typedef float IMAGE_ELEM_VAL; /* use floats for image storing */
-
-struct image_st {
- IMAGE_ARRAY v; /* values of voxels in matrix form */
- SDF_2D *dfp_2d; /* Pointer to disk image file */
- int nx, ny; /* size of voxel matrix */
- double xmin, xmax, ymin, ymax; /* extent of voxel matrix in phm coord */
- char remark[MAXREMARK+1]; /* description of voxel data */
- float calctime; /* time to calculate voxels in seconds */
-};
-typedef struct image_st IMAGE;
-
-typedef enum {
- RECTANGLE,
- TRIANGLE,
- ELLIPSE,
- SECTOR,
- SEGMENT
-} PElmType;
-
-struct pelm_st {
- PElmType type; /* pelm type (box, ellipse, etc) */
- double atten; /* X-ray attenuation coefficient */
- double cx,cy; /* center of pelm */
- double u,v; /* size of pelm */
- double rot; /* pelm rotation angle (in radians) */
- double *x, *y; /* ptr to array of points in obj world coord */
- int pts; /* number of points in outline arrays */
- double xmin, xmax, ymin, ymax; /* pelm limits */
- double radius; /* " */
- GRFMTX_2D p_to_o; /* map from phantom to standard pelm coords */
- GRFMTX_2D o_to_p; /* map from std pelm coords to phantom coords */
- struct pelm_st *next; /* pointer to next pelm in phantom */
-};
-typedef struct pelm_st PELM;
-
-typedef enum {
- P_PELMS, /* Phantom made of Pelms */
- P_UNIT_PULSE, /* Special phantom, not made of pelms */
- P_FILTER /* defined only by this type */
-} PhmType;
-
-struct phm_st { /* Phantom structure */
- PELM *pelm_list; /* pelm linked-list */
- PhmType type;
- int n_pelm; /* number of pelms in phantom */
- double xmin, xmax, ymin, ymax; /* extent of pelms in pelm coordinates */
- double radius; /* " " */
-};
-typedef struct phm_st PHANTOM;
-
-
-/*----------------------------------------------------------------------*/
-/* RAYSUM SYMBOLS */
-/*----------------------------------------------------------------------*/
-
-/* Ray sums are collected along an array of ndet detectors. The data
- * for these detectors is stored in the structure DETECTARRAY
- */
-
-typedef float DETECT_TYPE;
-
-struct detarray_st {
- DETECT_TYPE *detval; /* Pointer to array of values recorded by detector */
- int ndet; /* Number of detectors in array */
- double view_angle; /* View angle in radians */
-};
-typedef struct detarray_st DETARRAY;
-
-
-typedef enum {
- DETECTOR_PARALLEL,
- DETECTOR_EQUIANGLE,
- DETECTOR_EQUILINEAR
-} ScannerGeometry;
-
-struct detector_st {
- ScannerGeometry geometry; /* Geometry of detectory */
- int ndet; /* Number of detectors in array */
- int nview; /* Number of rotated views */
- int nsample; /* Number of rays per detector */
- double detlen; /* Total length of detector array */
- double rotlen; /* Rotation angle length in radians (norm 2PI) */
- double det_inc; /* Increment between centers of detectors */
- double rot_inc; /* Increment in rotation angle between views */
- double radius; /* Radius of rotation. Distance from */
- /* center of phm to center of det */
- double phmlen; /* Maximum Length of phantom or area of interest */
- struct {
- double xd1,yd1,xd2,yd2; /* Coordinates of detector endpoints */
- double xs1,ys1,xs2,ys2; /* Coordinates of source endpoints */
- double angle; /* Starting angle */
- } init;
-};
-typedef struct detector_st DETECTOR;
-
-struct raysum_st {
- int fd; /* Disk file descriptor */
- int file_mode; /* Current file mode (read or write) */
- int header_size; /* Size of disk file header */
- int geometry; /* Geometry of scanner */
- struct detarray_st **view; /* Pointer to array of detarray_st pointers */
-
- char remark[MAXREMARK+1]; /* description of raysum data */
- double calctime; /* time required to calculate raysums */
-
- int ndet; /* number of detectors in array */
- int nview; /* number of rotated views */
- double rot_start; /* starting view rotation */
- double rot_inc; /* angle between rotations */
- double det_start; /* distance of beginning detector to center */
- /* of PHANTOM */
- double det_inc; /* increment between detectors */
- double phmlen; /* Length of PHANTOM edge (phm is square) */
-};
-typedef struct raysum_st RAYSUM;