X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=include%2Fir.h;h=8af85727a19a74f874b3874efcde449ae1038966;hp=7a3ab95ed581d5ce41e349179dedba2341d98c49;hb=f4a23943110823118f35756dd41fbd6707f04511;hpb=0ed0b45e2292346f54ea196825135ccc35536bfe diff --git a/include/ir.h b/include/ir.h index 7a3ab95..8af8572 100644 --- a/include/ir.h +++ b/include/ir.h @@ -1,30 +1,15 @@ /***************************************************************************** -** This is part of the CTSim program -** Copyright (C) 1983-2000 Kevin Rosenberg -** -** $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 -** -** Revision 1.5 2000/05/02 20:00:25 kevin -** *** empty log message *** -** -** Revision 1.4 2000/05/02 15:31:39 kevin -** code cleaning +** FILE IDENTIFICATION ** -** Revision 1.3 2000/04/29 23:24:29 kevin -** *** empty log message *** +** Name: ir.h +** Purpose: Master Image Reconstruction Header +** Programmer: Kevin Rosenberg +** Date Started: July 1, 1984 ** -** Revision 1.2 2000/04/28 14:14:16 kevin -** *** empty log message *** -** -** 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 @@ -40,449 +25,177 @@ ** 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 phm coord */ - char remark[LENREMARK]; /* description of voxel data */ - float calctime; /* time to calculate voxels in seconds */ -}; - -struct phmelem_st { - int type; /* phmelem type (box, ellipse, etc) */ - double atten; /* X-ray attenuation coefficient */ - 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; /* phmelem limits */ - double radius; /* " */ - struct { /* transform matrices */ - 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 phmelem_st *next; /* pointer to next phmelem in phantom */ -}; - -typedef struct phmelem_st PHMELEM; - -struct phm_st { /* Phantom structure */ - PHMELEM *objlist; /* phmelem list */ - int type; - 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_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 */ - -/*----------------------------------------------------------------------*/ -/* 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 */ -}; - -#define DETECTOR_PARALLEL 1 -#define DETECTOR_EQUIANGLE 2 -#define DETECTOR_EQUILINEAR 3 - -struct detect_st { - int geometry; /* Geometry of detectory */ - 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 phm to center of det */ - double phmlen; /* Maximum Length of PHANTOM 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 PHANTOM */ - double det_inc; /* increment between detectors */ - double phmlen; /* Length of PHANTOM edge (phm 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 phmelem 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 Phmelem Coordinates */ -#define PHM_COORD -2 /* User's PHANTOM 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 PHANTOM */ - -#define PERCENT_PHM_SIZE_INCR 0.0 /* Fractional increase in PHANTOM */ - /* limits compared to phmelem size */ -#define N_EXTRA_DETECTORS 4 /* Number of extra detectors */ - /* widths when calculating detlen */ - -#define O_TRACE_NONE_STR "none" -#define O_TRACE_TEXT_STR "text" -#define O_TRACE_PHM_STR "phm" -#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_PHM 2 /* Show PHANTOM */ -#define TRACE_RAYS 3 /* Show all rays */ -#define TRACE_PLOT 4 /* Plot raysums */ -#define TRACE_CLIPPING 5 /* Plot clipping */ - -#define O_PHM_HERMAN 1 /* Herman head phantom */ -#define O_PHM_ROWLAND 2 /* Rowland head phantom */ -#define O_PHM_BROWLAND 3 /* Bordered Rowland head phantom */ -#define O_PHM_UNITPULSE 4 /* Unit pulse phantom */ - -#define O_PHM_HERMAN_STR "herman" -#define O_PHM_ROWLAND_STR "rowland" -#define O_PHM_BROWLAND_STR "browland" -#define O_PHM_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[]); - - - -/* bspline.c */ -int bspline(int samples, int zoom_factor, int spline_order, double input[], double output[]); -/* 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); -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); -/* dialogs.c */ -int phm_add_pelem_kb(PHANTOM *phm); -PHANTOM *phm_select(void); -int interpolation_select(void); -int filter_select(double *filter_param); -/* filter.c */ -double *filter_generate(int filt_type, double bw, double xmin, double xmax, int n, double param, int 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 abscos_int(double u, double w); -/* 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); -void image_filter_response(IMAGE *im, int domain, double bw, int filt_type, double filt_param, int opt_trace); -/* options.c */ -int opt_set_trace(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 */ +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, const char *program); -int opt_set_interpolation(const char *optarg, const char *program); +int opt_set_phantom(const char *optarg); +InterpolationType opt_set_interpolation(const char *optarg); const char *name_of_interpolation(int interp_type); -int opt_set_filter(const char *optarg, const char *program); +FilterType opt_set_filter(const char *optarg); 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); -/* phm.c */ -PHANTOM *phm_create(const int phmid); -PHANTOM *phm_create_from_file(const char *fname); -PHANTOM *phm_init(void); -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 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); -void phm_print(PHANTOM *phm); -#if HAVE_INTERACTIVE_GRAPHICS -void phm_show(const PHANTOM *phm); -void phm_draw(const PHANTOM *phm); -#endif -/* 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 PHMELEM *obj, double x, double y, const int coord_type); -/* phmstd.c */ -void herm_head(PHANTOM *phm); -void row_head(PHANTOM *phm); -void row_bord_head(PHANTOM *phm); -/* ray.c */ -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 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); -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); -void rs_trace_showprm (const char *label, const char *fmt, int row, int color, ...); -/* 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); +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); +/* 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