r117: *** empty log message ***
[ctsim.git] / include / ct.h
1 /*****************************************************************************
2 ** FILE IDENTIFICATION
3 **
4 **   Name:          ct.h
5 **   Purpose:       Master header file for CTSim
6 **   Programmer:    Kevin Rosenberg
7 **   Date Started:  Aug 1984
8 **
9 **  This is part of the CTSim program
10 **  Copyright (C) 1983-2000 Kevin Rosenberg
11 **
12 **  $Id: ct.h,v 1.21 2000/06/22 10:17:28 kevin Exp $
13 **
14 **  This program is free software; you can redistribute it and/or modify
15 **  it under the terms of the GNU General Public License (version 2) as
16 **  published by the Free Software Foundation.
17 **
18 **  This program is distributed in the hope that it will be useful,
19 **  but WITHOUT ANY WARRANTY; without even the implied warranty of
20 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 **  GNU General Public License for more details.
22 **
23 **  You should have received a copy of the GNU General Public License
24 **  along with this program; if not, write to the Free Software
25 **  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26 ******************************************************************************/
27
28 #ifndef CT_H
29 #define CT_H
30
31 #ifdef _WIN32
32   typedef long off_t;
33   #define HAVE_STRING_H 1
34   #include <fcntl.h>
35   #define snprintf _snprintf
36   #define vsnprintf _vsnprintf
37   #define strcasecmp stricmp
38   #define strncasecmp strnicmp
39 #endif
40
41 #ifdef HAVE_CONFIG_H
42   #include <config.h>
43 #endif
44 #ifdef HAVE_PNG
45   #include "png.h"
46 #endif
47 #ifdef HAVE_G2_H
48 extern "C" { 
49 #include "g2.h" 
50 }
51 #ifdef HAVE_X11
52 extern "C" {
53 #include "g2_X11.h"
54 }
55 #endif
56 #endif
57 #ifdef HAVE_STDIO_H
58 #include <stdio.h>
59 #endif
60 #ifdef HAVE_STRING_H
61 #include <string.h>
62 #endif
63 #ifdef HAVE_STDDEF_H
64 #include <stddef.h>
65 #endif
66 #ifdef HAVE_STDLIB_H
67 #include <stdlib.h>
68 #endif
69 #ifdef HAVE_STDARG_H
70 #include <stdarg.h>
71 #endif
72 #ifdef  HAVE_SYS_TYPES_H
73 #include <sys/types.h>
74 #endif
75 #ifdef HAVE_SYS_STAT_H
76 #include <sys/stat.h>
77 #endif
78 #ifdef HAVE_CTYPE_H
79 #include <ctype.h>
80 #endif
81 #ifdef HAVE_MATH_H
82 #include <math.h>
83 #endif
84 #ifdef HAVE_SYS_FCNTL_H
85 #include <sys/fcntl.h>
86 #endif
87 #ifdef HAVE_FCNTL_H
88 #include <fcntl.h>
89 #endif
90 #if defined(HAVE_GETOPT_H) || defined(HAVE_GETOPT_LONG)
91 #include <getopt.h>
92 #endif
93 #ifdef HAVE_UNISTD_H
94 #include <unistd.h>
95 #endif
96 #ifdef HAVE_SETJMP_H
97 #include <setjmp.h>
98 #endif
99 #ifdef HAVE_SYS_PARAM_H
100 #include <sys/param.h>          /* for htonl on FreeBSD */
101 #endif
102 #ifdef HAVE_NETINET_IN_H
103 #include <netinet/in.h>         /* for htonl on Linux/Solaris */
104 #endif
105 #ifdef HAVE_INTTYPES_H
106 #include <inttypes.h>           /* for htonl on Solaris */
107 #endif
108 #ifdef HAVE_STDINT_H
109 #include <stdint.h>             /* Standard ints on Linux */
110 #endif
111
112 #include <fstream>
113 #include <iostream>
114 #include <sstream>
115 #include <string>
116 #include <iterator>
117 #include <algorithm>
118 #include <exception>
119 #include <stdexcept>
120 #include <memory>
121
122 using namespace std;
123
124 #ifdef HAVE_MPI
125 #include "mpi++.h"
126 #include "mpiworld.h"
127 #endif
128
129 #include "ctsupport.h"
130 #include "fnetorderstream.h"
131
132 #ifdef HAVE_SGP
133   #include "ezplot.h"
134   #include "sgp.h"
135 #endif
136
137 #include "array2d.h"
138 #include "fnetorderstream.h"
139 #include "imagefile.h"
140 #include "phantom.h"
141 #include "scanner.h"
142 #include "backprojectors.h"
143 #include "filter.h"
144 #include "projections.h"
145
146 //----------------------------------------------------------------------//
147 //                              USER SYMBOLS                            //
148 //----------------------------------------------------------------------//
149
150 // Trace levels
151 static const char O_TRACE_NONE_STR[]=     "none";
152 static const char O_TRACE_TEXT_STR[]=     "text";
153 static const char O_TRACE_PHM_STR[]=      "phm";
154 static const char O_TRACE_RAYS_STR[]=     "rays";
155 static const char O_TRACE_PLOT_STR[]=     "plot";
156 static const char O_TRACE_CLIPPING_STR[]= "clipping";
157
158 enum {
159   TRACE_NONE,           /* No tracing */
160   TRACE_TEXT,           /* Minimal status */
161   TRACE_PHM,            /* Show phantom */
162   TRACE_RAYS,           /* Show all rays */
163   TRACE_PLOT,           /* Plot raysums */
164   TRACE_CLIPPING        /* Plot clipping */
165 };
166
167
168 /*************************************************************************
169  *  FUNCTION DECLARATIONS
170  ************************************************************************/
171
172 // dialogs.cpp 
173 bool phm_add_pelem_kb (Phantom& phm);
174 const Phantom& phm_select (Phantom& phm);
175 int interpolation_select (void);
176 int filter_select (double *filter_param);
177
178 // options.cpp 
179 int opt_set_trace(const char *optarg);
180
181 // imagefile.cpp 
182 void image_filter_response (ImageFile& im, const char* const domainName, double bw, const char* const filterName, double filt_param, const int opt_trace);
183 int image_display (const ImageFile& im);
184 int image_display_scale (const ImageFile& im, const int scale, const double pmin, const double pmax);
185
186
187 #endif
188