-typedef struct greyscale_st GREYSCALE;
-
-
-/* From reconstr.c */
-IMAGE *image_reconst (IMAGE *im, RAYSUM *rs, int filt_type, double filt_param, int interp_type, int interp_param, const int backproj_type, int ir_trace);
-
-/* From bproj.c */
-void backproj_init (const RAYSUM *rs, IMAGE *im, const int bproj_method);
-int backproj_calc (const RAYSUM *rs, IMAGE *im, const double *t, const double view_angle,
- const int interp_type, const int bproj_method);
-void backproj_term (const RAYSUM *rs, IMAGE *im, const int bproj_method);
-
-void backproj_init_trig (const RAYSUM *rs, IMAGE *im);
-int backproj_calc_trig (const RAYSUM *rs, IMAGE *im, const double *t,
- const double view_angle, const int interp_type);
-void backproj_term_trig (const RAYSUM *rs, IMAGE *im);
-void backproj_init_table (const RAYSUM *rs, IMAGE *im);
-int backproj_calc_table (const RAYSUM *rs, IMAGE *im, const double *t,
- const double view_angle, const int interp_type);
-void backproj_term_table (const RAYSUM *rs, IMAGE *im);
-void backproj_init_d (const RAYSUM *rs, IMAGE *im);
-int backproj_calc_d (const RAYSUM *rs, IMAGE *im, const double *t,
- const double view_angle, const int interp_type);
-void backproj_term_d (const RAYSUM *rs, IMAGE *im);
-void backproj_init_d2 (const RAYSUM *rs, IMAGE *im);
-int backproj_calc_d2 (const RAYSUM *rs, IMAGE *im, const double *t,
- const double view_angle, const int interp_type);
-void backproj_term_d2 (const RAYSUM *rs, IMAGE *im);
-void backproj_init_id (const RAYSUM *rs, IMAGE *im);
-int backproj_calc_id (const RAYSUM *rs, IMAGE *im, const double *t,
- const double view_angle, const int interp_type);
-void backproj_term_id (const RAYSUM *rs, IMAGE *im);
-void backproj_init_id2 (const RAYSUM *rs, IMAGE *im);
-int backproj_calc_id2 (const RAYSUM *rs, IMAGE *im, const double *t,
- const double view_angle, const int interp_type);
-void backproj_term_id2 (const RAYSUM *rs, IMAGE *im);
-
-void usage (const char *program);
-int main(const int argc, char * const argv[]);
-
-
-
-/* bspline.c */
-int bspline(int samples, int zoom_factor, int spline_order, double input[], double output[]);
-/* clip.c */
-int inside_obj(const OBJECT *obj, double x, double y, const int coord_type);
-int clipsegment(double *x1, double *y1, double *x2, double *y2, const double u, const double v);
-int clipsector(double *x1, double *y1, double *x2, double *y2, const double u, const double v);
-int clipcircle(double *x1, double *y1, double *x2, double *y2, const double cx, const double cy, const double radius, double t1, double t2);
-int cliptriangle(double *x1, double *y1, double *x2, double *y2, const double u, const double v, const int clip_xaxis);
-/* convolve.c */
-double convolve(const double f1[], const double f2[], const double dx, const int n, const int np, const int func_type);
-double convolve_both(const double f1[], const double f2[], const double dx, const int n, const int np);
-/* ctsub.c */
-void dminmax(const double array[], const int pts, double *xmin, double *xmax);
-void rotate2d(double x[], double y[], int pts, double angle);
-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);
-/* filt.c */
-double d_filtfunc(int filt_type, double x, double bw, double param, int n);
-double filter_freq(int filt_type, double u, double bw, double param);
-double a_filtfunc(int filt_type, double x, double bw, double param);
-double sinc(double x, double mult);
-double abscos_int(double u, double w);
-double *filter_generate(int filt_type, double bw, double xmin, double xmax, int n, double param, int domain, int numint);
-void image_filter_init(IMAGE *im, int domain, double bw, int filt_type, double filt_param, int opt_trace);
-/* im_draw.c */
-void image_show(IMAGE *im, int nxcell, int nycell, double densmin, double densmax, bool disp_scale);
-int image_paint(int dev, IMAGE *im, int xmin, int ymin, int nxcell, int nycell, double densmin, double densmax, bool disp_scale);
-int gs_image(GREYSCALE *gs, IMAGE *im, double densmin, double densmax, bool disp_scale);
-void paint_cscale(GREYSCALE *gs, int nx, int ny);
-GREYSCALE *gs_init(int dev, int xmin, int ymin, int nxcell, int nycell);
-void gs_pixel(GREYSCALE *gs, int x, int y, int gs_level);
-void gs_set_pos(GREYSCALE *gs, int x, int y);
-void gs_set_at_addr(GREYSCALE *gs, int gs_level);
-void gs_set_color_scale(void);
-/* image.c */
-IMAGE *image_create(const char *fname, const int nx, const int ny);
-int image_clear(IMAGE *im);
-int image_save(IMAGE *im);
-IMAGE *image_load(const char *fname);
-/* ir_vars.c */
-/* options.c */
-int opt_set_trace(const char *optarg, const char *program);
-const char *name_of_picture(const int picnum);
-int opt_set_picture(const char *optarg, const char *program);
-int opt_set_interpolation(const char *optarg, const char *program);
+typedef enum {
+ O_PHM_HERMAN, /* Herman head phantom */
+ O_PHM_ROWLAND, /* Rowland head phantom */
+ O_PHM_BROWLAND, /* Bordered Rowland head phantom */
+ O_PHM_UNITPULSE /* Unit pulse phantom */
+} PhantomType;
+
+static const char O_PHM_HERMAN_STR[]= "herman";
+static const char O_PHM_ROWLAND_STR[]= "rowland";
+static const char O_PHM_BROWLAND_STR[]= "browland";
+static const char O_PHM_UNITPULSE_STR[]= "unitpulse";
+
+static const char O_INTERP_NEAREST_STR[]= "nearest";
+static const char O_INTERP_LINEAR_STR[]= "linear";
+static const char O_INTERP_BSPLINE_STR[]= "bspline";
+
+static const char O_FILTER_ABS_BANDLIMIT_STR[]= "abs_bandlimit";
+static const char O_FILTER_ABS_SINC_STR[]= "abs_sinc";
+static const char O_FILTER_ABS_COS_STR[]= "abs_cos";
+static const char O_FILTER_ABS_HAMMING_STR[]= "abs_hamming";
+static const char O_FILTER_SHEPP_STR[]= "shepp";
+static const char O_FILTER_BANDLIMIT_STR[]= "bandlimit";
+static const char O_FILTER_SINC_STR[]= "sinc";
+static const char O_FILTER_COS_STR[]= "cos";
+static const char O_FILTER_HAMMING_STR[]= "hamming";
+static const char O_FILTER_TRIANGLE_STR[]= "triangle";
+
+typedef enum {
+ O_BPROJ_TRIG,
+ O_BPROJ_TABLE,
+ O_BPROJ_DIFF,
+ O_BPROJ_DIFF2,
+ O_BPROJ_IDIFF2
+} BackprojType;
+
+static const char O_BPROJ_TRIG_STR[]= "trig";
+static const char O_BPROJ_TABLE_STR[]= "table";
+static const char O_BPROJ_DIFF_STR[]= "diff";
+static const char O_BPROJ_DIFF2_STR[]= "diff2";
+static const char O_BPROJ_IDIFF2_STR[]= "idiff2";
+
+const static int RAYSUM_TRACE_ROW_TITLE=1;
+const static int RAYSUM_TRACE_ROW_TITLE2=2;
+const static int RAYSUM_TRACE_ROW_PHANT_ID=4;
+const static int RAYSUM_TRACE_ROW_CHROMATIC=7;
+const static int RAYSUM_TRACE_ROW_SCATTER=8;
+const static int RAYSUM_TRACE_ROW_PHOT_STAT=9;
+const static int RAYSUM_TRACE_ROW_NDET=12;
+const static int RAYSUM_TRACE_ROW_NVIEW=13;
+const static int RAYSUM_TRACE_ROW_SAMPLES=14;
+const static int RAYSUM_TRACE_ROW_CURR_VIEW=17;
+const static int RAYSUM_TRACE_ROW_ATTEN=18;
+
+
+
+/*************************************************************************
+ * FUNCTION DECLARATIONS
+ ************************************************************************/
+
+/* convolve.cpp */
+double convolve (const double f1[], const double f2[], const double dx, const int n, const int np, const FunctionSymmetry func_type);
+
+/* dialogs.cpp */
+int phm_add_pelm_kb (PHANTOM *phm);
+PHANTOM *phm_select (void);
+int interpolation_select (void);
+int filter_select (double *filter_param);
+
+/* filter.cpp */
+double *filter_generate (const FilterType filt_type, double bw, double xmin, double xmax, int n, double param, const DomainType domain, int numint);
+double filter_spatial_response_calc (int filt_type, double x, double bw, double param, int n);
+double filter_spatial_response_analytic (int filt_type, double x, double bw, double param);
+double filter_frequency_response (int filt_type, double u, double bw, double param);
+double sinc (double x, double mult);
+double integral_abscos(double u, double w);
+
+/* options.cpp */
+int opt_set_trace(const char *optarg);
+const char *name_of_phantom(const int phmid);
+int opt_set_phantom(const char *optarg);
+InterpolationType opt_set_interpolation(const char *optarg);