From: Kevin M. Rosenberg Date: Thu, 22 Jun 2000 10:42:39 +0000 (+0000) Subject: r118: *** empty log message *** X-Git-Tag: debian-4.5.3-3~899 X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=commitdiff_plain;h=7ef485116d6859eb1e31753b3e3a89de44985272 r118: *** empty log message *** --- diff --git a/include/ct.h b/include/ct.h index ead95ad..10f7feb 100644 --- a/include/ct.h +++ b/include/ct.h @@ -9,7 +9,7 @@ ** 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 @@ -142,46 +142,7 @@ using namespace std; #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 diff --git a/include/imagefile.h b/include/imagefile.h index 607f716..3b1882f 100644 --- a/include/imagefile.h +++ b/include/imagefile.h @@ -692,6 +692,13 @@ typedef kfloat32* ImageFileColumn; 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 diff --git a/include/trace.h b/include/trace.h index d302d3c..20e3186 100644 --- a/include/trace.h +++ b/include/trace.h @@ -1,14 +1,6 @@ #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 */ @@ -18,29 +10,51 @@ enum { 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); } diff --git a/libctsim/dialogs.cpp b/libctsim/dialogs.cpp index de12d98..e73f6e1 100644 --- a/libctsim/dialogs.cpp +++ b/libctsim/dialogs.cpp @@ -2,7 +2,7 @@ ** 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 @@ -20,6 +20,16 @@ #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