** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: ct.h,v 1.21 2000/06/22 10:17:28 kevin Exp $
+** $Id: ct.h,v 1.22 2000/06/22 10:42:39 kevin Exp $
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
#include "backprojectors.h"
#include "filter.h"
#include "projections.h"
-
-//----------------------------------------------------------------------//
-// USER SYMBOLS //
-//----------------------------------------------------------------------//
-
-// Trace levels
-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 */
-};
-
-
-/*************************************************************************
- * FUNCTION DECLARATIONS
- ************************************************************************/
-
-// 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);
-
-// options.cpp
-int opt_set_trace(const char *optarg);
-
-// imagefile.cpp
-void image_filter_response (ImageFile& im, const char* const domainName, double bw, const char* const filterName, 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);
+#include "trace.h"
#endif
typedef kfloat32** ImageFileArray;
#endif
+
+// imagefile.cpp
+void image_filter_response (ImageFile& im, const char* const domainName, double bw, const char* const filterName, 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);
+
+
#endif
#ifndef TRACE_H
#define TRACE_H
-// Trace levels
-static const char TRACE_NONE_STR[]= "none";
-static const char TRACE_TEXT_STR[]= "text";
-static const char TRACE_PHM_STR[]= "phm";
-static const char TRACE_RAYS_STR[]= "rays";
-static const char TRACE_PLOT_STR[]= "plot";
-static const char TRACE_CLIPPING_STR[]= "clipping";
-
enum {
TRACE_NONE, /* No tracing */
TRACE_TEXT, /* Minimal status */
TRACE_CLIPPING /* Plot clipping */
};
+static const char TRACE_NONE_STR[]= "none";
+static const char TRACE_TEXT_STR[]= "text";
+static const char TRACE_PHM_STR[]= "phm";
+static const char TRACE_RAYS_STR[]= "rays";
+static const char TRACE_PLOT_STR[]= "plot";
+static const char TRACE_CLIPPING_STR[]= "clipping";
+
+class TraceLevel
+{
+ public:
+ TraceLevel (const char* const traceString);
+
+ addTrace (const char* const traceString);
+
+ bool isTrace (const char* const traceQuery) const;
+
+ private:
+
+ bool addTraceElements (const char* const traceString);
+};
+
+
inline int
-opt_set_trace (const char *optarg)
+opt_set_trace (const char *traceString)
{
- int opt;
-
- if (strcmp(optarg, TRACE_NONE_STR) == 0)
- opt = TRACE_NONE;
- else if (strcmp(optarg, TRACE_TEXT_STR) == 0)
- opt = TRACE_TEXT;
- else if (strcmp(optarg, TRACE_PHM_STR) == 0)
- opt = TRACE_PHM;
- else if (strcmp(optarg, TRACE_PLOT_STR) == 0)
- opt = TRACE_PLOT;
- else if (strcmp(optarg, TRACE_CLIPPING_STR) == 0)
- opt = TRACE_CLIPPING;
- else if (strcmp(optarg, TRACE_RAYS_STR) == 0)
- opt = TRACE_RAYS;
+ int traceID;
+
+ if (strcasecmp (traceString, TRACE_NONE_STR) == 0)
+ traceID = TRACE_NONE;
+ else if (strcasecmp (traceString, TRACE_TEXT_STR) == 0)
+ traceID = TRACE_TEXT;
+ else if (strcasecmp (traceString, TRACE_PHM_STR) == 0)
+ traceID = TRACE_PHM;
+ else if (strcasecmp (traceString, TRACE_PLOT_STR) == 0)
+ traceID = TRACE_PLOT;
+ else if (strcasecmp (traceString, TRACE_CLIPPING_STR) == 0)
+ traceID = TRACE_CLIPPING;
+ else if (strcasecmp (traceString, TRACE_RAYS_STR) == 0)
+ traceID = TRACE_RAYS;
else {
- sys_error(ERR_WARNING,"Invalid trace option %s\n", optarg);
- opt = -1;
+ sys_error(ERR_WARNING,"Invalid trace option %s\n", traceString);
+ traceID = -1;
}
- return (opt);
+ return (traceID);
}
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: dialogs.cpp,v 1.1 2000/06/19 02:59:34 kevin Exp $
+** $Id: dialogs.cpp,v 1.2 2000/06/22 10:42:39 kevin Exp $
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
#include "ct.h"
+/*************************************************************************
+ * FUNCTION DECLARATIONS
+ ************************************************************************/
+
+// 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);
+
/* NAME
* phm_add_pelem_kb Let user specify pelem, and add it to the pic