From: Kevin M. Rosenberg Date: Wed, 3 May 2000 19:51:41 +0000 (+0000) Subject: r33: function renaming for phantoms and phantom elements X-Git-Tag: debian-4.5.3-3~984 X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=commitdiff_plain;h=0ed0b45e2292346f54ea196825135ccc35536bfe r33: function renaming for phantoms and phantom elements --- diff --git a/include/ct.h b/include/ct.h index deec77b..5e66c29 100644 --- a/include/ct.h +++ b/include/ct.h @@ -2,8 +2,11 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ct.h,v 1.3 2000/04/30 19:17:35 kevin Exp $ +** $Id: ct.h,v 1.4 2000/05/03 19:51:41 kevin Exp $ ** $Log: ct.h,v $ +** Revision 1.4 2000/05/03 19:51:41 kevin +** function renaming for phantoms and phantom elements +** ** Revision 1.3 2000/04/30 19:17:35 kevin ** Set up include files for conditional INTERACTIVE_GRAPHICS ** @@ -46,7 +49,9 @@ #ifdef HAVE_STDDEF_H #include #endif +#ifdef HAVE_STDLIB_H #include +#endif #ifdef HAVE_STDARG_H #include #endif @@ -77,6 +82,18 @@ #ifdef HAVE_SETJMP_H #include #endif +#ifdef HAVE_SYS_PARAM_H +#include /* for htonl on FreeBSD */ +#endif +#ifdef HAVE_NETINET_IN_H +#include /* for htonl on Linux/Solaris */ +#endif +#ifdef HAVE_INTTYPES_H +#include /* for htonl on Solaris */ +#endif +#ifdef HAVE_STDINT_H +#include /* Standard ints on Linux */ +#endif #ifdef MPI_CT #include "mpi.h" diff --git a/include/ir.h b/include/ir.h index a834ea3..7a3ab95 100644 --- a/include/ir.h +++ b/include/ir.h @@ -2,8 +2,11 @@ ** 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 ** @@ -93,38 +96,38 @@ struct image_st { 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 */ /*----------------------------------------------------------------------*/ @@ -193,7 +196,7 @@ typedef struct raysum_st RAYSUM; /* 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 @@ -204,7 +207,7 @@ typedef struct raysum_st RAYSUM; /* 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 */ @@ -248,13 +251,10 @@ typedef struct raysum_st RAYSUM; /* 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" @@ -398,7 +398,7 @@ void xlat2d(double x[], double y[], int pts, double xoffset, double yoffset); 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); @@ -431,16 +431,15 @@ const char *name_of_backproj(const int backproj); 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); @@ -449,7 +448,7 @@ void phm_draw(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); @@ -458,8 +457,8 @@ void row_bord_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); diff --git a/include/kstddef.h b/include/kstddef.h index 3ad537a..5634ef9 100644 --- a/include/kstddef.h +++ b/include/kstddef.h @@ -2,8 +2,11 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: kstddef.h,v 1.5 2000/05/02 20:00:25 kevin Exp $ +** $Id: kstddef.h,v 1.6 2000/05/03 19:51:41 kevin Exp $ ** $Log: kstddef.h,v $ +** Revision 1.6 2000/05/03 19:51:41 kevin +** function renaming for phantoms and phantom elements +** ** Revision 1.5 2000/05/02 20:00:25 kevin ** *** empty log message *** ** @@ -107,8 +110,12 @@ typedef unsigned char string[STR_SIZE]; #define ABS(x) ((x) < 0 ? -(x) : (x)) #define SQR(x) ((x) * (x)) +#ifndef MAX #define MAX(a,b) ((a) > (b) ? (a) : (b)) +#endif +#ifndef MIN #define MIN(a,b) ((a) <= (b) ? (a) : (b)) +#endif #define ISWAP(a,b) {int i; i = a; a = b; b = i;} #define CLIP(n,lb,ub) if (n < lb) n = lb; else if (n > ub) n = ub