** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: reconstr.cpp,v 1.1 2000/06/19 02:59:34 kevin Exp $
+** $Id: reconstr.cpp,v 1.2 2000/06/20 17:54:51 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
int nview = proj.nView();
double det_inc = proj.detInc();
double detlen = (ndet - 1) * det_inc;
- double *vec_proj = new double [ndet]; // projection data
int n_filtered_proj = ndet;
- double* filtered_proj = new double [n_filtered_proj]; // convolved result
+ double filtered_proj [n_filtered_proj]; // convolved result
#ifdef HAVE_BSPLINE_INTERP
int spline_order = 0, zoom_factor = 0;
double filterBW = 1. / det_inc;
double filterMin = -detlen;
double filterMax = detlen;
- double* vec_filter = filter_generate (filt_type, filterBW, filterMin, filterMax, n_vec_filter, filt_param, D_SPATIAL, 0);
+
+ SignalFilter filter (filt_type, filterBW, filterMin, filterMax, n_vec_filter, filt_param, D_SPATIAL, 0);
#if HAVE_SGP
- double *plot_xaxis = NULL; /* array for plotting */
SGP_ID gid;
- plot_xaxis = new double [n_vec_filter];
+ double plot_xaxis [n_vec_filter]; // array for plotting
if (trace > TRACE_TEXT) {
int i;
for (i = 0, f = filterMin; i < n_vec_filter; i++, f += filterInc)
plot_xaxis[i] = f;
- gid = ezplot (plot_xaxis, vec_filter, n_vec_filter);
+ gid = ezplot (plot_xaxis, filter.getFilter(), n_vec_filter);
cio_put_str ("Press any key to continue");
cio_kb_getc ();
sgp2_close (gid);
DetectorValue* detval = darray.detValues();
for (int j = 0; j < ndet; j++)
- vec_proj[j] = detval[j];
-
- for (int j = 0; j < ndet; j++)
- filtered_proj[j] = convolve (vec_proj, vec_filter, det_inc, j, ndet, FUNC_BOTH);
+ filtered_proj[j] = filter.convolve (detval, det_inc, j, ndet, FUNC_BOTH);
#ifdef HAVE_SGP
if (trace >= TRACE_PLOT) {
ezset ("box.");
ezset ("grid.");
ezset ("ufinish yes.");
- ezplot (vec_proj, plot_xaxis, proj.nDet());
+ ezplot (detval, plot_xaxis, proj.nDet());
ezset ("clear.");
ezset ("xticks major 5.");
ezset ("xlabel ");
}
delete bj;
- delete vec_proj;
- delete filtered_proj;
- delete vec_filter;
-
-#ifdef HAVE_SGP
- delete plot_xaxis;
-#endif
return (im);
}