/*****************************************************************************
-** This is part of the CTSim program
-** Copyright (C) 1983-2000 Kevin Rosenberg
-**
-** $Id: ir.h,v 1.3 2000/04/29 23:24:29 kevin Exp $
-** $Log: ir.h,v $
-** Revision 1.3 2000/04/29 23:24:29 kevin
-** *** empty log message ***
+** FILE IDENTIFICATION
**
-** Revision 1.2 2000/04/28 14:14:16 kevin
-** *** empty log message ***
+** Name: ir.h
+** Purpose: Master Image Reconstruction Header
+** Programmer: Kevin Rosenberg
+** Date Started: July 1, 1984
**
-** Revision 1.1.1.1 2000/04/28 13:02:43 kevin
-** Initial CVS import for first public release
+** This is part of the CTSim program
+** Copyright (C) 1983-2000 Kevin Rosenberg
**
+** $Id: ir.h,v 1.28 2000/06/17 20:12:14 kevin Exp $
**
**
** This program is free software; you can redistribute it and/or modify
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
******************************************************************************/
-/* FILE IDENTIFICATION
- *
- * Name: ir.h Header File for Image Reconstruction System
- * Programmer: Kevin Rosenberg
- * Date Started: 7-1-84
- * Last Change: 1-20-85
- */
#ifndef IR_H
#define IR_H
-#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;
-
-/*---------------------------------------------------------------------------*/
-
-#define POINTS_PER_CIRCLE 36
-
-#define MAXREMARK 99
-#define LENREMARK (MAXREMARK+1)
-#define IMAGE_VAL FMTX_2D /* use 2d floating point matrix */
-#define IMAGE_ELEM_TYPE DT_FLOAT /* use floats for images */
-typedef float IMAGE_ELEM_VAL; /* use floats for image storing */
-
-struct image_st {
- IMAGE_VAL 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 pic coord */
- char remark[LENREMARK]; /* description of voxel data */
- float calctime; /* time to calculate voxels in seconds */
-};
-
-struct object_st {
- int type; /* object 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 *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 radius; /* " */
- struct { /* transform matrices */
- GRFMTX_2D p_to_o; /* map from pic to standard obj coords */
- GRFMTX_2D o_to_p; /* map from std object coords to pic coords */
- } xform;
- struct object_st *next; /* pointer to next object in picture */
-};
-
-typedef struct object_st OBJECT;
-
-struct pic_st { /* Picture structure */
- OBJECT *objlist; /* object list */
- int type;
- int numobj; /* number of objects in picture */
- double xmin, xmax, ymin, ymax; /* extent of objects in object coordinates */
- double radius; /* " " */
-};
-
-typedef struct image_st IMAGE;
-typedef struct pic_st PICTURE;
-
-#define P_OBJECTS 0 /* Picture made of objects */
-#define P_UNIT_PULSE 1 /* Special picture, not made of objects */
-#define P_FILTER 9 /* defined only by a type */
-
-/*----------------------------------------------------------------------*/
-/* RAYSUM SYMBOLS */
-/*----------------------------------------------------------------------*/
-
-/* Ray sums are collected along an array of ndet detectors. The data
- * for these detectors is stored in the structure DETECTARRAY
- */
-
-#define DETECT_TYPE float
-
-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 */
-};
-
-struct detect_st {
- 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 pic to center of det */
- double piclen; /* Maximum Length of picture 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;
-};
-
-struct raysum_st {
- int fd;
- int file_mode;
- int header_size;
- struct detarray_st **view; /* Pointer to array of detarray_st pointers */
-
- char remark[LENREMARK]; /* 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 picture */
- double det_inc; /* increment between detectors */
- double piclen; /* Length of picture edge (pic is square) */
-};
-typedef struct detarray_st DETARRAY;
-typedef struct detect_st DETECTOR;
-typedef struct raysum_st RAYSUM;
+#include "phantom.h"
+#include "scanner.h"
+#include "projections.h"
/*----------------------------------------------------------------------*/
/* USER SYMBOLS */
/*----------------------------------------------------------------------*/
-/* codes for object types, passed to add_obj() */
-
-#define O_RECTANGLE 1
-#define O_TRIANGLE 2
-#define O_ELLIPSE 3
-#define O_SECTOR 4
-#define O_SEGMENT 5
-
-/* Codes for Coordinate Types */
-/* Defines coords for inside_obj() */
-
-#define OBJ_COORD -1 /* Normalized Object Coordinates */
-#define PIC_COORD -2 /* User's Picture Coordinates */
-
/* Codes for Filter types */
-#define W_BANDLIMIT 1 /* filter types for genfilter() */
-#define W_SINC 2
-#define W_G_HAMMING 3
-#define W_COSINE 4
-#define W_TRIANGLE 5
-
-#define W_A_BANDLIMIT 11 /* filters times abs() of function */
-#define W_A_SINC 12
-#define W_AG_HAMMING 13
-#define W_A_COSINE 14
-
-#define W_SHEPP 21
+typedef enum { /* filter types for filter_generate() */
+ FILTER_BANDLIMIT,
+ FILTER_SINC,
+ FILTER_G_HAMMING,
+ FILTER_COSINE,
+ FILTER_TRIANGLE,
+ FILTER_ABS_BANDLIMIT, /* filter times |x| */
+ FILTER_ABS_SINC,
+ FILTER_ABS_G_HAMMING,
+ FILTER_ABS_COSINE,
+ FILTER_SHEPP
+} FilterType;
/* function domains */
-#define O_FREQ_STR "freq"
-#define O_SPATIAL_STR "spatial"
+static const char D_FREQ_STR[]= "freq";
+static const char D_SPATIAL_STR[]= "spatial";
-#define D_FREQ 1 /* Domain names */
-#define D_SPATIAL 2
-
-/* function symmetry */
+typedef enum {
+ D_FREQ = 1,
+ D_SPATIAL
+} DomainType;
-#define FUNC_EVEN 1 /* function types, f[-n] = f[n] */
-#define FUNC_ODD 2 /* f[-n] = -f[n] */
-#define FUNC_BOTH 3 /* function has both odd & even components */
+typedef enum {
+ FUNC_EVEN = 1, /* function types, f[-n] = f[n] */
+ FUNC_ODD, /* f[-n] = -f[n] */
+ FUNC_BOTH /* function has both odd & even components */
+} FunctionSymmetry;
/* interpolation methods */
-
-#define I_NEAREST 1 /* Interpolation methods */
-#define I_LINEAR 2 /* Linear interpolation */
-#define I_BSPLINE 3
-#define I_1BSPLINE 3 /* 1st order B-Spline */
-#define I_2BSPLINE 4
-#define I_3BSPLINE 5
-
-/* Constants for sizing picture */
-
-#define PERCENT_PIC_SIZE_INCR 0.0 /* Fractional increase in picture */
- /* limits compared to object 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_PIC_STR "pic"
-#define O_TRACE_RAYS_STR "rays"
-#define O_TRACE_PLOT_STR "plot"
-#define O_TRACE_CLIPPING_STR "clipping"
-
-
-#define TRACE_NONE 0 /* No tracing */
-#define TRACE_TEXT 1 /* Minimal status */
-#define TRACE_PIC 2 /* Show picture */
-#define TRACE_RAYS 3 /* Show all rays */
-#define TRACE_PLOT 4 /* Plot raysums */
-#define TRACE_CLIPPING 5 /* Plot clipping */
-
-#define O_PIC_HERMAN 1 /* Herman head phantom */
-#define O_PIC_ROWLAND 2 /* Rowland head phantom */
-#define O_PIC_BROWLAND 3 /* Bordered Rowland head phantom */
-#define O_PIC_UNITPULSE 4 /* Unit pulse phantom */
-
-#define O_PIC_HERMAN_STR "herman"
-#define O_PIC_ROWLAND_STR "rowland"
-#define O_PIC_BROWLAND_STR "browland"
-#define O_PIC_UNITPULSE_STR "unitpulse"
-
-#define O_INTERP_NEAREST_STR "nearest"
-#define O_INTERP_LINEAR_STR "linear"
-#define O_INTERP_BSPLINE_STR "bspline"
-
-#define O_FILTER_ABS_BANDLIMIT_STR "abs_bandlimit"
-#define O_FILTER_ABS_SINC_STR "abs_sinc"
-#define O_FILTER_ABS_COS_STR "abs_cos"
-#define O_FILTER_ABS_HAMMING_STR "abs_hamming"
-#define O_FILTER_SHEPP_STR "shepp"
-#define O_FILTER_BANDLIMIT_STR "bandlimit"
-#define O_FILTER_SINC_STR "sinc"
-#define O_FILTER_COS_STR "cos"
-#define O_FILTER_HAMMING_STR "hamming"
-#define O_FILTER_TRIANGLE_STR "triangle"
-
-#define O_BPROJ_TRIG 1
-#define O_BPROJ_TABLE 2
-#define O_BPROJ_DIFF 3
-#define O_BPROJ_DIFF2 4
-#define O_BPROJ_IDIFF2 5
-
-#define O_BPROJ_TRIG_STR "trig"
-#define O_BPROJ_TABLE_STR "table"
-#define O_BPROJ_DIFF_STR "diff"
-#define O_BPROJ_DIFF2_STR "diff2"
-#define O_BPROJ_IDIFF2_STR "idiff2"
-
-#define RS_TRACE_ROW_TITLE 1
-#define RS_TRACE_ROW_TITLE2 2
-#define RS_TRACE_ROW_PHANT_ID 4
-#define RS_TRACE_ROW_CHROMATIC 7
-#define RS_TRACE_ROW_SCATTER 8
-#define RS_TRACE_ROW_PHOT_STAT 9
-#define RS_TRACE_ROW_NDET 12
-#define RS_TRACE_ROW_NVIEW 13
-#define RS_TRACE_ROW_SAMPLES 14
-#define RS_TRACE_ROW_CURR_VIEW 17
-#define RS_TRACE_ROW_ATTEN 18
-
-
-/*----------------------------------------------------------------------*/
-/* GRAY SCALE STRUCTURES */
-/*----------------------------------------------------------------------*/
-
-#define GS_MAX_CELL_SIZE 4
-
-typedef int GS_BITMASK[4][4];
-
-struct greyscale_st {
- int dev; /* Device to output to */
- int (*dotfunc)(int x, int y, int color); /* Pointer to dot function for device */
- int cur_x, cur_y; /* Current cell location */
- int nxcell, nycell; /* size of cell in pixels */
- int xmin, ymin; /* starting position of grey scale */
- int num_color; /* Number of primary colors available */
- int num_intens; /* Number of intensities available */
- int max_level; /* gs levels range from 0 to max_level */
- char *fg_color_tbl; /* Hold foreground color for each level */
- char *bg_color_tbl; /* Holds background color */
- char *level_sub_tbl; /* Holds value to subtract for level */
- /* before accessing bit mask */
- GS_BITMASK *bm; /* Holds grey-scale bit mask */
- struct greyscale_st *next_dev; /* Pointer to next open device */
- /* == NULL when no more devices */
+#undef HAVE_BSPLINE_INTERP
+typedef enum { /* Interpolation methods */
+ I_NEAREST = 1, /* Nearest neighbor */
+#if HAVE_BSPLINE_INTERP
+ I_BSPLINE,
+ I_1BSPLINE, /* 1st order B-Spline */
+ I_2BSPLINE,
+ I_3BSPLINE,
+#endif
+ I_LINEAR /* Linear interpolation */
+} InterpolationType;
+
+static const char O_TRACE_NONE_STR[]= "none";
+static const char O_TRACE_TEXT_STR[]= "text";
+static const char O_TRACE_PHM_STR[]= "phm";
+static const char O_TRACE_RAYS_STR[]= "rays";
+static const char O_TRACE_PLOT_STR[]= "plot";
+static const char O_TRACE_CLIPPING_STR[]= "clipping";
+
+enum {
+ TRACE_NONE, /* No tracing */
+ TRACE_TEXT, /* Minimal status */
+ TRACE_PHM, /* Show phantom */
+ TRACE_RAYS, /* Show all rays */
+ TRACE_PLOT, /* Plot raysums */
+ TRACE_CLIPPING /* Plot clipping */
};
-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[]);
+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 */
+bool phm_add_pelem_kb (Phantom& phm);
+const Phantom& phm_select (Phantom& phm);
+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);
+const char *name_of_interpolation(int interp_type);
+FilterType opt_set_filter(const char *optarg);
+const char *name_of_filter(const int filter);
+DomainType opt_set_filter_domain(const char *optarg);
+const char *name_of_filter_domain(const DomainType domain);
+BackprojType opt_set_backproj(const char *optarg);
+const char *name_of_backproj(const BackprojType backproj);
+/* From phm2image.cpp */
+void phm_to_imagefile (const Phantom& phm, ImageFile& im, const int col_start, const int col_count, const int nsample, const int trace);
+/* image.cpp */
+void image_filter_response(ImageFile& im, const DomainType domain, double bw, const FilterType filt_type, double filt_param, const int opt_trace);
+int image_display (const ImageFile& im);
+int image_display_scale (const ImageFile& im, const int scale, const double pmin, const double pmax);
-/* 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 */
-OBJECT *alloc_obj(int n);
-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 */
-const char *interp_name_of(int interp_type);
-const char *filter_name_of(int filt_type);
-int interp_select(void);
-int filter_select(double *filt_param);
-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);
-int opt_set_filter(const char *optarg, const char *program);
-const char *name_of_filter(const int filter);
-int opt_set_filter_domain(const char *optarg, const char *program);
-const char *name_of_filter_domain(const int domain);
-int opt_set_backproj(const char *optarg, const char *program);
-const char *name_of_backproj(const int backproj);
-/* pic.c */
-PICTURE *select_pic(void);
-PICTURE *create_pic_from_file(const char *fname);
-PICTURE *create_pic(const int picnum);
-PICTURE *init_pic(void);
-int add_objs_kb(PICTURE *pic);
-int add_objs_file(PICTURE *pic, const char *fname);
-void addobject(PICTURE *pic, 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);
-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);
-void prt_pic(PICTURE *pic);
-void show_pic(const PICTURE *pic);
-void draw_pic(const PICTURE *pic);
-/* pic2image.c */
-void pic_to_image(const PICTURE *pic, IMAGE *im, const int col_start, const int col_count,
- const int nsample, const int trace);
-/* ray.c */
-void rs_trace_showprm (const char *label, const char *fmt, int row, int color, ...);
-DETECTOR *detect_create(const PICTURE *pic, int ndet, int nview, int nsample, const double rot_anglen);
-void detect_free(DETECTOR *det);
-int raysum_collect(RAYSUM *rs, const DETECTOR *det, const PICTURE *pic, const int start_view,
- const int trace, const int unit_pulse);
-void rayview(const PICTURE *pic, 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 calc_rsum(const PICTURE *pic, 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);
-/* rayio.c */
-RAYSUM *raysum_create(const char *fname, const int nview, const int ndet);
-RAYSUM *raysum_create_from_det(const char *fname, const DETECTOR *det);
-RAYSUM *raysum_open(const char *filename);
-void raysum_alloc_views(RAYSUM *rs);
-void raysum_free(RAYSUM *rs);
-int raysum_is_open(RAYSUM *rs);
-int raysum_close(RAYSUM *rs);
-int raysum_read_header(RAYSUM *rs);
-int raysum_write_header(RAYSUM *rs);
-int raysum_read(RAYSUM *rs);
-int raysum_write(RAYSUM *rs);
-DETARRAY *detarray_alloc(const int n);
-void detarray_free(DETARRAY *darray);
-int detarray_read(RAYSUM *rs, DETARRAY *darray, const int view_num);
-int detarray_write(RAYSUM *rs, const DETARRAY *darray, const int view_num);
-int raysum_print(const RAYSUM *rs);
-/* phantom.c */
-void herm_head(PICTURE *pic);
-void row_head(PICTURE *pic);
-void row_bord_head(PICTURE *pic);
-/* xform.c */
-void indent_mtx2(GRFMTX_2D m);
-void xlat_mtx2(GRFMTX_2D m, const double x, const double y);
-void scale_mtx2(GRFMTX_2D m, const double sx, const double sy);
-void rot_mtx2(GRFMTX_2D m, const double theta);
-void mult_mtx2(GRFMTX_2D m1, GRFMTX_2D m2, GRFMTX_2D result);
-void xform_mtx2(GRFMTX_2D m, double *x, double *y);
+/* From reconstr.cpp */
+ImageFile& proj_reconst (ImageFile& im, Projections& rs, const FilterType filt_type, double filt_param, InterpolationType interp_type, int interp_param, const BackprojType backproj_type, int const ir_trace);
#endif