** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: ir.h,v 1.10 2000/05/04 18:16:34 kevin Exp $
+** $Id: ir.h,v 1.12 2000/05/07 12:46:19 kevin Exp $
** $Log: ir.h,v $
+** Revision 1.12 2000/05/07 12:46:19 kevin
+** made c++ compatible
+**
+** Revision 1.11 2000/05/05 02:37:31 kevin
+** renamed phmelm to pelm
+**
** Revision 1.10 2000/05/04 18:16:34 kevin
** renamed filter definitions
**
#ifndef IR_H
#define IR_H
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
#ifdef MPI_CT
#define MPI_MAX_PROCESS 128
struct mpi_ct_st
float calctime; /* time to calculate voxels in seconds */
};
-struct phmelm_st {
- int type; /* phmelm type (box, ellipse, etc) */
+struct pelm_st {
+ int type; /* pelm type (box, ellipse, etc) */
double atten; /* X-ray attenuation coefficient */
- double cx,cy; /* center of phmelm */
- double u,v; /* size of phmelm */
- double rot; /* phmelm rotation angle (in radians) */
+ 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; /* phmelm limits */
+ double xmin, xmax, ymin, ymax; /* pelm limits */
double radius; /* " */
struct { /* transform matrices */
- GRFMTX_2D p_to_o; /* map from phantom to standard phmelm coords */
- GRFMTX_2D o_to_p; /* map from std phmelm coords to phantom coords */
+ 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 */
} xform;
- struct phmelm_st *next; /* pointer to next phmelm in phantom */
+ struct pelm_st *next; /* pointer to next pelm in phantom */
};
-typedef struct phmelm_st PHMELM;
+typedef struct pelm_st PELM;
struct phm_st { /* Phantom structure */
- PHMELM *phmelm_list; /* phmelm linked-list */
+ PELM *pelm_list; /* pelm linked-list */
int type;
- int n_pelm; /* number of phmelms in phantom */
- double xmin, xmax, ymin, ymax; /* extent of phmelms in phmelm coordinates */
+ int n_pelm; /* number of pelms in phantom */
+ double xmin, xmax, ymin, ymax; /* extent of pelms in pelm coordinates */
double radius; /* " " */
};
typedef struct image_st IMAGE;
typedef struct phm_st PHANTOM;
-#define P_PHMELMS 0 /* Phantom made of phmelms */
-#define P_UNIT_PULSE 1 /* Special PHANTOM, not made of phmelms */
+#define P_PELMS 0 /* Phantom made of pelms */
+#define P_UNIT_PULSE 1 /* Special PHANTOM, not made of pelms */
#define P_FILTER 9 /* defined only by a type */
/*----------------------------------------------------------------------*/
/* USER SYMBOLS */
/*----------------------------------------------------------------------*/
-/* codes for phmelm types, passed to add_obj() */
+/* codes for pelm types, passed to phm_add_pelm() */
#define O_RECTANGLE 1
#define O_TRIANGLE 2
/* Codes for Coordinate Types */
/* Defines coords for pelm_is_point_inside() */
-#define PELM_COORD -1 /* Normalized Phmelm Coordinates */
+#define PELM_COORD -1 /* Normalized Pelm Coordinates */
#define PHM_COORD -2 /* User's PHANTOM Coordinates */
/* Codes for Filter types */
/* Constants for sizing PHANTOM */
#define PERCENT_PHM_SIZE_INCR 0.0 /* Fractional increase in PHANTOM */
- /* limits compared to phmelm size */
+ /* limits compared to pelm size */
#define N_EXTRA_DETECTORS 4 /* Number of extra detectors */
/* widths when calculating detlen */
int phm_add_pelm_file(PHANTOM *phm, const char *fname);
void phm_add_pelm (PHANTOM *phm, const int type, const double cx, const double cy,
const double u, const double v, const double rot, const double atten);
-int pelm_make_points(PHMELM *obj);
-void pelm_make_xform (PHMELM *obj);
-PHMELM *pelm_alloc(void);
+int pelm_make_points(PELM *obj);
+void pelm_make_xform (PELM *obj);
+PELM *pelm_alloc(void);
void calc_arc(double x[], double y[], const int pts, const double xcent, const double ycent,
const double r, const double start, const double stop);
void calc_ellipse(double x[], double y[], const int pts, const double u, const double v);
/* phm2image.c */
void phm_to_image(const PHANTOM *phm, IMAGE *im, const int col_start, const int col_count,
const int nsample, const int trace);
-int pelm_is_point_inside(const PHMELM *obj, double x, double y, const int coord_type);
+int pelm_is_point_inside(const PELM *obj, double x, double y, const int coord_type);
/* phmstd.c */
void phm_std_herman (PHANTOM *phm);
int raysum_collect(RAYSUM *rs, const DETECTOR *det, const PHANTOM *phm, const int start_view, const int trace, const int unit_pulse);
void rayview(const PHANTOM *phm, DETARRAY *darray, const DETECTOR *det, const double xd1, const double yd1, const double xd2, const double yd2, const double xs1, const double ys1, const double xs2, const double ys2, const int unit_pulse);
double phm_ray_attenuation (const PHANTOM *phm, const double x1, const double y1, const double x2, const double y2);
-double pelm_ray_attenuation (const PHMELM *obj, const double x1, const double y1, const double x2, const double y2);
-int pelm_clip_line (const PHMELM *obj, double *x1, double *y1, double *x2, double *y2);
+double pelm_ray_attenuation (const PELM *obj, const double x1, const double y1, const double x2, const double y2);
+int pelm_clip_line (const PELM *obj, double *x1, double *y1, double *x2, double *y2);
void raysum_trace_show_param (const char *label, const char *fmt, int row, int color, ...);
/* scanner.c */
int detarray_write(RAYSUM *rs, const DETARRAY *darray, const int view_num);
int raysum_print(const RAYSUM *rs);
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#endif