** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: ir.h,v 1.6 2000/05/03 08:49:49 kevin Exp $
+** $Id: ir.h,v 1.7 2000/05/03 19:51:41 kevin Exp $
** $Log: ir.h,v $
+** Revision 1.7 2000/05/03 19:51:41 kevin
+** function renaming for phantoms and phantom elements
+**
** Revision 1.6 2000/05/03 08:49:49 kevin
** Code cleanup
**
float calctime; /* time to calculate voxels in seconds */
};
-struct object_st {
- int type; /* object type (box, ellipse, etc) */
+struct phmelem_st {
+ int type; /* phmelem type (box, ellipse, etc) */
double atten; /* X-ray attenuation coefficient */
- double cx,cy; /* center of object */
- double u,v; /* size of object */
- double rot; /* object rotation angle (in radians) */
+ double cx,cy; /* center of phmelem */
+ double u,v; /* size of phmelem */
+ double rot; /* phmelem 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; /* object limits */
+ double xmin, xmax, ymin, ymax; /* phmelem limits */
double radius; /* " */
struct { /* transform matrices */
- GRFMTX_2D p_to_o; /* map from phm to standard obj coords */
- GRFMTX_2D o_to_p; /* map from std object coords to phm coords */
+ GRFMTX_2D p_to_o; /* map from phantom to standard phmelem coords */
+ GRFMTX_2D o_to_p; /* map from std phmelem coords to phantom coords */
} xform;
- struct object_st *next; /* pointer to next object in PHANTOM */
+ struct phmelem_st *next; /* pointer to next phmelem in phantom */
};
-typedef struct object_st OBJECT;
+typedef struct phmelem_st PHMELEM;
-struct phm_st { /* PHANTOM structure */
- OBJECT *objlist; /* object list */
+struct phm_st { /* Phantom structure */
+ PHMELEM *objlist; /* phmelem list */
int type;
- int numobj; /* number of objects in PHANTOM */
- double xmin, xmax, ymin, ymax; /* extent of objects in object coordinates */
+ int n_pelem; /* number of phmelems in phantom */
+ double xmin, xmax, ymin, ymax; /* extent of phmelems in phmelem coordinates */
double radius; /* " " */
};
typedef struct image_st IMAGE;
typedef struct phm_st PHANTOM;
-#define P_OBJECTS 0 /* PHANTOM made of objects */
-#define P_UNIT_PULSE 1 /* Special PHANTOM, not made of objects */
+#define P_PHMELEMS 0 /* PHANTOM made of phmelems */
+#define P_UNIT_PULSE 1 /* Special PHANTOM, not made of phmelems */
#define P_FILTER 9 /* defined only by a type */
/*----------------------------------------------------------------------*/
/* USER SYMBOLS */
/*----------------------------------------------------------------------*/
-/* codes for object types, passed to add_obj() */
+/* codes for phmelem types, passed to add_obj() */
#define O_RECTANGLE 1
#define O_TRIANGLE 2
/* Codes for Coordinate Types */
/* Defines coords for inside_obj() */
-#define OBJ_COORD -1 /* Normalized Object Coordinates */
+#define OBJ_COORD -1 /* Normalized Phmelem 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 object size */
+ /* limits compared to phmelem size */
#define N_EXTRA_DETECTORS 4 /* Number of extra detectors */
/* widths when calculating detlen */
-#define DET_PARALLEL 1
-#define DET_FAN 2
-
#define O_TRACE_NONE_STR "none"
#define O_TRACE_TEXT_STR "text"
#define O_TRACE_PHM_STR "phm"
void scale2d(double x[], double y[], int pts, double xfact, double yfact);
int circle_pts(double theta);
/* dialogs.c */
-int add_objs_kb(PHANTOM *phm);
+int phm_add_pelem_kb(PHANTOM *phm);
PHANTOM *phm_select(void);
int interpolation_select(void);
int filter_select(double *filter_param);
PHANTOM *phm_create(const int phmid);
PHANTOM *phm_create_from_file(const char *fname);
PHANTOM *phm_init(void);
-int add_objs_kb(PHANTOM *phm);
-int add_objs_file(PHANTOM *phm, const char *fname);
-void addobject(PHANTOM *phm, const int type, const double cx, const double cy,
+int phm_add_pelem_file(PHANTOM *phm, const char *fname);
+void phm_add_pelem (PHANTOM *phm, const int type, const double cx, const double cy,
const double u, const double v, const double rot, const double atten);
-int makeobjpts(OBJECT *obj);
-void makeobjxform(OBJECT *obj);
+int pelem_make_points(PHMELEM *obj);
+void pelem_make_xform (PHMELEM *obj);
+PHMELEM *pelem_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);
-OBJECT *alloc_obj(void);
void phm_print(PHANTOM *phm);
#if HAVE_INTERACTIVE_GRAPHICS
void phm_show(const PHANTOM *phm);
/* 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 inside_obj(const OBJECT *obj, double x, double y, const int coord_type);
+int inside_obj(const PHMELEM *obj, double x, double y, const int coord_type);
/* phmstd.c */
void herm_head(PHANTOM *phm);
void row_head(PHANTOM *phm);
DETECTOR *detect_create(const PHANTOM *phm, int ndet, int nview, int nsample, const double rot_anglen);
void detect_free(DETECTOR *det);
double calc_rsum(const PHANTOM *phm, const double x1, const double y1, const double x2, const double y2);
-double calc_objsum(const OBJECT *obj, const double x1, const double y1, const double x2, const double y2);
-int clipobj(const OBJECT *obj, double *x1, double *y1, double *x2, double *y2);
+double calc_objsum(const PHMELEM *obj, const double x1, const double y1, const double x2, const double y2);
+int clipobj(const PHMELEM *obj, double *x1, double *y1, double *x2, double *y2);
/* raycollect.c */
int raysum_collect(RAYSUM *rs, const DETECTOR *det, const PHANTOM *phm, const int start_view,
const int trace, const int unit_pulse);