\section{Simple Graphics Package}\index{Simple Graphics Package}%
\subsection{Overview}%
-Simple Graphics Package was creates in 1983 by Kevin Rosenberg and is modelled after the graphics library in Foley and van Dam\cite{FOLEY82}.
+Simple Graphics Package was created in 1980 by Kevin Rosenberg and
+is modelled after the graphics library in Foley and van
+Dam\cite{FOLEY82}.
\begin{verbatim}
+------------------------+
\subsection{Functions}%
-\subsubsection{World Coordinate Level}%
- initgrf2 () Initialize 2 dimensional graphics\\
- termgrf2 () Terminate 2 dimensional graphics\\
- Window (xmin, ymin, xmax, ymax) Set window for world coordinates\\
- Viewport (xmin, ymin, xmax, ymax) Viewport for window in NDC\\
- MoveAbs (x, y) Move graphics cursor\\
- MoveRel (dx, dy)\\
- PointAbs (x, y) Plot point at current position\\
- PointRel (dx, dy)\\
- LineAbs2 (x, y) Draw line from current point to point\\
- LineRel2 (dx, dy)\\
- MarkerAbs2 (x, y) Draw marker at current position\\
- MarkerRel2 (dx, dy)\\
- PolylineAbs (x[], y[], n) Draw a set of lines\\
- PolylineRel (dx[]. dy[]. n)\\
- wc\_to\_ndc (xwc, ywc, xndc, yndc) Convert from world coord to NDC\\
- ndc\_to\_wc (xndc, yndc, xwc, ywc) Convert from NDC to world coord\\
- DrawText (str) Draw text string at current positon\\
+\subsubsection{World Coordinate Level}
+\begin{twocollist}
+\twocolitem{initgrf2}{Initialize 2 dimensional graphics}
+\twocolitem{termgrf2}{Terminate 2 dimensional graphics}
+\twocolitem{setColor(color)}{Set current drawing color}
+\twocolitem{setLinestyle (style)}{Set current line style}
+\twocolitem{setLinewidth (width)}{Set current line width}
+\twocolitem{setTextColor (foreground, background)}{If back=-1,
+then transparent} \twocolitem{setMarker (type, color)}{Set marker
+attibutes}
+\end{twocollist}
- INTERNAL:\\
- calc\_map () Calculate wc to ndc factors\\
- clip(rectangle[4], x1, y1, x2, y2) Clip a line againt rectangle\\
+\subsubsection{State Commands}
+\begin{twocollist}
+\twocolitem{Window(xmin, ymin, xmax, ymax)}{Set window for world
+coordinates} \twocolitem{MoveAbs(x, y)}{Move graphics cursor}
+\twocolitem{MoveRel(dx, dy)}{} \twocolitem{PointAbs (x, y)}{Plot
+point at current position} \twocolitem{PointRel (dx, dy)}{}
+\twocolitem{LineAbs2 (x, y)}{Draw line from current point to
+point} \twocolitem{LineRel2 (dx, dy)}{} \twocolitem{MarkerAbs2 (x,
+y)}{Draw marker at current position} \twocolitem{MarkerRel2 (dx,
+dy)}{} \twocolitem{PolylineAbs (x[], y[], n)}{Draw a set of lines}
+\twocolitem{PolylineRel (dx[], dy[], n)}{}
+\twocolitem{wc\_to\_ndc(xwc, ywc, xndc, yndc)}{Convert from world
+coord to NDC} \twocolitem{ndc\_to\_wc(xndc, yndc, xwc,
+ywc)}{Convert from NDC to world coord} \twocolitem{DrawText
+(str)}{Draw text string at current positon}
+\end{twocollist}
\subsubsection{Normalized Coordinate level}%
- stylus (x, y, beam) Draw a line from current position\\
- setColor (color) Set current drawing color\\
- setLinestyle (style) Set current line style\\
- setLinewidth (width) Set current line width\\
- setTextColor (foreground, background) If back=-1, then transparent \\
+\begin{twocollist}
+\twocolitem{Viewport (xmin, ymin, xmax, ymax)}{Viewport for window
+in NDC} \twocolitem{stylus (x, y, beam)}{Draw a line from current
+position} \twocolitem{markerNDC(xndc, yndc)}{Draw marker at NDC
+position}
+\end{twocollist}
- setMarker (type, color) Set marker attibutes\\
- markerNDC (xndc, yndc) Draw marker at NDC position\\
-\subsection{Coordinate Mapping}%
+\subsection{Coordinate Mapping}
\subsubsection{Mapping from world coordinates to physical device coordinates}%
-Window (World Coordinates): xwmin, xwmax, ywmin, ywmax \\
-Viewport (Normalized Device Coordinates): xvmin, xvmax, yvmin, yvmax\\
-Physical (Physicial Device Coordinates): xpmax, ypmax\\
+Window (World Coordinates): $X_{wmin}, X_{wmax}, Y_{wmin}, Y_{wmax}$ \\
+Viewport (Normalized Device Coordinates): $X_{vmin}, X_{vmax}, Y_{vmin}, Y_{vmax}$\\
+Physical (Physicial Device Coordinates): $X_{pmax}, Y_{pmax}$\\
To convert from WC to NDC:\\
\begin{equation}
- X_{ndc} = X_vmin + (X_wc - X_wmin) / (X_wmax - X_wmin)
+ X_{ndc} = X_{vmin} + (X_{vmax} - X_{vmin}) (X_{wc} - X_{wmin}) / (X_{wmax} - X_{wmin})
\end{equation}
\begin{equation}
- Y_{ndc} = Y_vmin + (Y_wc - Y_wmin) / (Y_wmax - Y_wmin)
+ Y_{ndc} = Y_{vmin} + (Y_{vmax} - Y_{vmin}) (Y_{wc} - Y_{wmin}) / (Y_{wmax} - Y_{wmin})
\end{equation}
+
To convert from NDC to PDC:
\begin{equation}
X_{pdc} = X_{ndc} X_{pmax}
\begin{equation}
Y_{pdc} = X_{ndc} Y_{pmax}
\end{equation}
-
-So, for each device set up the following composite transformation:\\
-\begin{equation}
- x_{pdc} = x_{pmax} (x_{vmin} + (x_{wc} - x_{wmin}) / (x_{wmax} - x_{wmin}))
-\end{equation}
-\begin{equation}
- y_{pdc} = y_{pmax} (y_{vmin} + (y_{wc} - y_{wmin}) / (y_{wmax} - y_{wmin}))
-\end{equation}
-\begin{equation}
- X_{pdc} = X_{pmax} X_{vmin} + ((X_{wc} \- X_{wmin}) X_{pmax})/(X_{wmax} \- X_{wmin}))
-\end{equation}
-\begin{equation}
- X_{pdc} = X_{add} + (X_wc - X_{sub}) X_{fract}
-\end{equation}
great image processing and visualization features.
\ctsim\ can open projection files, image files, phantom files, and
-plotfiles.
+plot files.
-\usage \texttt{ctsim [files to open...]
+\usage \texttt{ctsim [files to open...]}
You can invoke \ctsim\ by itself on the command line, or include
-any number of files that you want \ctsim\ to automatically open.
+on the command-line any number of files that you want \ctsim\ to
+automatically open.
\section{File Types Support}
Phantom and plot files are stored as ASCII text. In contrast,
-image and projection files are stored in binary format. \ctsim\
+image and projection files are stored in binary format. \ctsim
incorporates logic so that binary files are cross-platform
compatible between both little and big endian architectures.
complex-valued images are twice the size of real-valued images
since both a real and imaginary component need to be store.
+Images files can also store any number of text labels. \ctsim\ uses
+these labels for storing history information regarding
+the creation and modifications of images.
+
+When complex-valued images are viewed on the screen, only the real
+component is displayed.
+
\subsection{Projection}
-Projection files are created from Phantom files during the projection process.
-Numerous options are available for creation of the these files.
+Projection files are created from Phantom files during the
+projection process. Numerous options are available for the
+creation of the these files. The files are stored in a binary
+format with cross-platform compatibility on little and big endian
+architectures.
\subsection{Plot}
Plot files are created by \ctsim\ during analysis of image files.
\section{Phantom Menus}
+\subsection{Properties}
+Displays the properties of a phantom which includes:
+
+\begin{itemize}\itemsep=0pt
+\item Overall dimensions of a phantom
+\item A list of all component phantom elements
+\end{itemize}
+
\subsection{Rasterize Dialog}
This creates an image file from a phantom. Technically, it
converts the phantom from a vector (infinite resolution) object
to set are:
\begin{twocollist}
-%\twocolitemruled{\textbf{Parameter}}{\textbf{Options}}
+\twocolitemruled{\textbf{Parameter}}{\textbf{Options}}
\twocolitem{\texttt{X size}}{Number of columns in image file}
\twocolitem{\texttt{Y size}}{Number of rows in image file}
\twocolitem{\texttt{Samples per pixel}}{Numbers of samples taken
\end{twocollist}
\subsection{Projection Dialog}
-This creates a projection file from a phantom.
+This creates a projection file from a phantom. The options
+available when collecting projections are:
+
+\begin{twocollist}
+\twocolitem{\textbf{Geometry}}{
+ \begin{itemize}\itemsep=0pt
+ \item Parallel
+ \item Equiangular
+ \item Equilinear
+ \end{itemize}}
+\twocolitem{\textbf{Number of detectors}}{Sets the number of
+detectors in the detector array.}
+
+\twocolitem{\textbf{Number of views}}{Sets the number of views
+collected}
+
+\twocolitem{\textbf{Samples per detector}}{Sets the number of
+samples collected for each detector}
+
+\twocolitem{\textbf{View Ratio}}{Sets the field of view as a ratio
+of the diameter of the phantom. For normal scanning, a value of
+1.0 is fine.}
+
+\twocolitem{\textbf{Scan Ratio}}{Sets the length of scanning as a
+ratio of the view diameter. For normal scanning, a value of 1.0 is
+fine.}
+
+\twocolitem{\textbf{Focal length ratio}}{Sets the distance of the
+radiation source and detectors from the center of the object as a
+ratio of the radius of the object.
+
+For parallel geometries, a value of 1.0 is fine. For other
+geometries, this should be at least 2.0 to avoid artifacts.}
+\end{twocollist}
+
+\subsection{Advanced Options}
+\begin{twocollist}
+\twocolitem{\textbf{Rotation Angle}}{Sets the rotation amount as a
+multiple of pi. For parallel geometries use a rotation angle of 1
+and for equilinear and equiangular geometries use a rotation angle
+of 2. Using any other rotation angle will lead to artifacts.}
+\end{twocollist}
+
+
\section{Image Menus}
\subsection{File - Properties}
\item Image file labels
\end{itemize}
-\subsection{View}
+\subsection{File - Export}
+This command allows for exporting image files to a standard
+graphics file format. This is helpful when you want to take an
+image and import it into another application. The current
+\helprefn{intensity scale}{intensityscale} is used when exporting
+the file. The support file formats are:
+
+\begin{description}\itemsep=0pt
+\item[PNG]Portable Network Graphics format. This uses 8-bits or
+256 shades of gray.
+
+\item[PNG-16]This is a 16-bit version of PNG which allows for
+65536 shades of gray.
+\item[PGM]Portable Graymap format. This is a common format used on
+UNIX systems.
+\item[PGM]ASCII version of PGM.
+\end{description}
+
+
+\subsection{View}\label{intensityscale}
These options are for change the intensity scale for viewing the image.
They do not change the image data.
+\subsubsection{Set}
+\subsubsection{Auto}
+\subsubsection{Full}
+This resets the intensity scale to the full scale of the image.
\subsection{Image}
These commands create a new image based upon the current image,
and for some commands, also a comparison image.
+\subsubsection{Add, Subtract, Multiply, Divide}
+
+\subsubsection{Image Size}
+
+\subsubsection{3-D Conversion}
+Generates a 3-dimensional view of the current phantom.
+
\subsection{Filter}
-These commands filter image.
+These commands filter and modify the image.
-\subsection{Anaylze}
+\subsubsection{Arithmetic}
+
+\subsubsection{Frequency Based}
+
+\subsection{Analyze}
These commands are used for analyzing an image.
+\subsubsection{Plotting}
+
+\subsubsection{Image Comparison}
+
\section{Projection Menus}
+
+\subsection{File - Properties}
+
\subsection{Process - Convert Polar Dialog}\label{convertpolardialog}
The parameters are \texttt{xsize}, \texttt{ysize}, and \texttt{interpolation}.
The \texttt{xsize} and \texttt{ysize} parameters set the size of the
the highest quality interpolation.
\subsection{Process - Convert FFT Polar Dialog}
-The parameters for this option are the same as
-\helprefn{convertpolardialog}{Convert Polar Dialog}. For this
-command, though, the projections are Fourier transformed prior to
-conversion to polar image.
+The parameters for this option are the same as \helprefn{Convert
+Polar Dialog}{convertpolardialog}. For this command, though, the
+projections are Fourier transformed prior to conversion to polar
+image.
\subsection{Reconstruct - Filtered Backprojection Dialog}
This dialog sets the parameters for reconstructing an image from projections
\ctsimtext\ is a master shell for all of the command-line utilities.
-\usage
-\ctsimtext\ can be executed without any parameters. In that case, \ctsimtext\
-offers a command-line to enter the function-names and their parameters. The output of the command is displayed. Further commands may be given to \ctsimtext. The shell is exited by the \texttt{quit} command.
-
-\ctsimtext\ can also be called to execute a single command. This is especially useful for batch files containing multiple \ctsimtext\ commands. This is invoked by calling \par
-\texttt{ctsimtext function-name parameters...}.
+\usage \ctsimtext\ can be invoked via three different
+methods.
+\begin{itemize}\itemsep=0pt
+\item \ctsimtext\ can executed without any parameters. In that case,
+\ctsimtext\ offers a command-line to enter the function-names and
+their parameters. The output of the command is displayed. Further
+commands may be given to \ctsimtext. The shell is exited by the
+\texttt{quit} command.
+
+\item \ctsimtext\ can also be called to
+execute a single command. This is especially useful for batch
+files containing multiple \ctsimtext\ commands. This is invoked by
+calling\\ \texttt{ctsimtext function-name parameters...}.
+
+\item Using operating systems that support soft or hard linking of
+files (such as UNIX and Linux), the executable file \ctsimtext\ can
+be linked to the function names. This is automatically done by
+the installation file for Linux. Thus, to use \ctsimtext\ with the
+function name \texttt{pjrec}, the below command can be executed:\\
+\texttt{pjrec parameters...}
-The available functions are:
+\end{itemize}
\section{if1}\label{if1}\index{ctsimtext,if1}%
Perfoms math functions on a single image.
\item -\,-rotangle
Sets the rotation amount as a multiple of pi. For parallel geometries use
-a rotation angle of 1 and for equilinear and equiangular geometries use a rotation angle of 2.
+a rotation angle of 1 and for equilinear and equiangular
+geometries use a rotation angle of 2. The default is to use to
+appropriate rotation angle based on the geometry.
+
+ \item -\,-view-ratio
+ Sets the field of view as a ratio of the diameter of the phantom.
+ For normal scanning, a value of 1.0 is fine.
- \item -\,-field-of-view
- Sets the field of view as a ratio of the diameter of the phantom. For parallel geometries, using a value of 1.0 is fine. For other geometies, this should be at least 1.3 to avoid artifacts.
+ \item -\,-scan-ratio
+ Sets the length of scanning as a ratio of the view diameter.
+ For normal scanning, a value of 1.0 is fine.
\item -\,-focal-length
- Sets the distance of the radiation source and detectors from the center of the object as a ratio of the radius of the object. For parallel geometries, a value of 1.0 is fine. For other geometries, this should be at least 2.0 to avoid artifacts.
+ Sets the distance of the radiation source and detectors from the center of the object as a ratio of the radius of the object.
+ For parallel geometries, a value of 1.0 is fine. For other geometries, this should be at least 2.0 to avoid artifacts.
\end{itemize}
The Herman phantom is taken with permission from Gabor Hermans 1980 book\cite{HERMAN80}. The Shepp-Logan phantom was published in 1974\cite{SHEPP74}.
\usage
\begin{itemize}\itemsep=0pt
\item -\,-nsamples
+ \item -\,-view-ratio
\end{itemize}
\section{pj2if}\label{pj2if}\index{ctsimtext,pj2if}%
\section{pjrec}\label{pjrec}\index{ctsimtext,pjrec}%
Reconstructs the interior of an object from a projection file.
-\usage
\begin{twocollist}
\twocolitemruled{\textbf{Parameter}}{\textbf{Options}}
\twocolitem{\textbf{-\,-filter}}{Selects which filter to apply to
\item direct
\item inverse-fourier
\end{itemize}
-
-\end{twocollist}
}
+\end{twocollist}
\setfooter{\thepage}{}{}{}{}{\thepage}%
\section{Overview}\index{Web Interface,Overview}%
-The CGI program \texttt{ctsim.cgi} takes projections of a standard
-phantom object, performs reconstruction, and then compares the
-rasterized phantom object with the reconstruction. The comparison is
-performed both visually by an image subtraction as well as by standard
-statistics as described by Herman\cite{HERMAN80}.
+\ctsim\ can also be executed via a web browser. The CGI program
+\texttt{ctsim.cgi} takes projections of a standard phantom object,
+performs reconstruction, and then compares the rasterized phantom
+object with the reconstruction. The comparison is performed both
+visually by an image subtraction as well as by standard statistics
+as described by Herman\cite{HERMAN80}.
\section{Requirements}\index{Web Interface,Requirements}%
\begin{itemize}\itemsep=0pt
\item A client web browser than can display PNG files. Most
current web browsers support PNG.
+
+ \item A knowledgable system administrator. It is beyond the
+ scope of this manual to explain the installation of the CGI
+ interfact.
\end{itemize}
\usepackage{fancyhea}
%\usepackage{mysober}
\usepackage{mytitle}
-%\usepackage{verbatim}
+\usepackage{verbatim}
\usepackage{makeidx}
%\usepackage{times}
\usepackage{hyperref}
\setfooter{\thepage}{}{}{}{}{\thepage} %
\printindex %
-\end{document}%
+\end{document}
\newcommand{\helpref}[2]{{\it #1} (section \ref{#2}) }
% Type text with URL in verbatim mode
-\newcommand{\urlref}[2]{#1 (\verb$#2$)}
+%\newcommand{\urlref}[2]{#1 (\verb$#2$)}
+\newcommand{\urlref}[2]{#1 ($#2$)}
+%\newcommand{\urlref}[2]{#1 \begin{verbatim}(#2)\end{verbatim}}
% Don't typeset section number in LaTeX
\newcommand{\helprefn}[2]{{\it #1}}
+++ /dev/null
-/*****************************************************************************
-** This is part of the CTSim program
-** Copyright (c) 1983-2001 Kevin Rosenberg
-**
-** $Id: cubicinterp.h,v 1.1 2001/02/09 01:54:20 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
-** published by the Free Software Foundation.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-******************************************************************************/
-
-class CubicInterpolator {
-private:
- double *m_pdY2; // second differential of y data
-
- const double* const m_pdY;
- const int m_n;
-
-public:
- CubicInterpolator (const double* const y, int n);
-
- ~CubicInterpolator ();
-
- double interpolate (double x);
-};
-
--- /dev/null
+/*****************************************************************************
+** This is part of the CTSim program
+** Copyright (c) 1983-2001 Kevin Rosenberg
+**
+** $Id: interpolator.h,v 1.1 2001/02/11 21:57:08 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
+** published by the Free Software Foundation.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+******************************************************************************/
+
+
+class CubicSplineInterpolator {
+private:
+ double *m_pdY2; // second differential of y data
+
+ const double* const m_pdY;
+ const int m_n;
+
+public:
+ CubicSplineInterpolator (const double* const y, int n);
+
+ ~CubicSplineInterpolator ();
+
+ double interpolate (double x);
+};
+
+class CubicPolyInterpolator {
+private:
+ const double* const m_pdY;
+ const int m_n;
+
+public:
+ CubicPolyInterpolator (const double* const y, int n);
+
+ ~CubicPolyInterpolator ();
+
+ double interpolate (double x);
+};
+
+++ /dev/null
-/*****************************************************************************
-** This is part of the CTSim program
-** Copyright (c) 1983-2001 Kevin Rosenberg
-**
-** $Id: cubicinterp.cpp,v 1.4 2001/02/09 21:27: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
-** published by the Free Software Foundation.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-******************************************************************************/
-
-
-#include "ctsupport.h"
-#include "cubicinterp.h"
-
-
-CubicInterpolator::CubicInterpolator (const double* const y, const int n)
- : m_pdY(y), m_n(n)
-{
- // Precalculate 2nd derivative of y and put in m_pdY2
- // Calculated by solving set of simultaneous cubic spline equations
- // Only n-2 cubic spline equations, but able to make two more
- // equations by setting second derivative to 0 at ends
-
- m_pdY2 = new double [n];
- m_pdY2[0] = 0; // second deriviative = 0 at beginning and end
- m_pdY2[n-1] = 0;
-
- double* temp = new double [n - 1];
- temp[0] = 0;
- int i;
- for (i = 1; i < n - 1; i++) {
- double t = 2 + (0.5 * m_pdY2[i-1]);
- temp[i] = y[i+1] + y[i-1] - y[i] - y[i];
- temp[i] = (3 * temp[i] - 0.5 * temp[i-1]) / t;
- m_pdY2[i] = -0.5 / t;
- }
-
- for (i = n - 2; i >= 0; i--)
- m_pdY2[i] = temp[i] + m_pdY2[i] * m_pdY2[i + 1];
-
- delete temp;
-}
-
-CubicInterpolator::~CubicInterpolator ()
-{
- delete m_pdY2;
-}
-
-
-double
-CubicInterpolator::interpolate (double x)
-{
- const static double oneSixth = (1. / 6.);
- int lo = static_cast<int>(floor(x));
- int hi = lo + 1;
-
- if (lo < 0 || hi >= m_n) {
- sys_error (ERR_SEVERE, "X range out of bounds [CubicInterpolator::interpolate]");
- return (0);
- }
-
- double loFr = hi - x;
- double hiFr = 1 - loFr;
- double y = loFr * m_pdY[lo] + hiFr * m_pdY[hi];
- y += oneSixth * ((loFr*loFr*loFr - loFr) * m_pdY2[lo] + (hiFr*hiFr*hiFr - hiFr) * m_pdY2[hi]);
-
- return y;
-}
-
-
-
--- /dev/null
+/*****************************************************************************
+** This is part of the CTSim program
+** Copyright (c) 1983-2001 Kevin Rosenberg
+**
+** $Id: interpolator.cpp,v 1.1 2001/02/11 21:57:08 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
+** published by the Free Software Foundation.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+******************************************************************************/
+
+
+#include "ctsupport.h"
+#include "interpolator.h"
+
+
+CubicPolyInterpolator::CubicPolyInterpolator (const double* const y, const int n)
+ : m_pdY(y), m_n(n)
+{
+ if (m_n < 2)
+ sys_error (ERR_SEVERE, "Too few points (%d) in CubicPolyInterpolator", m_n);
+}
+
+CubicPolyInterpolator::~CubicPolyInterpolator ()
+{
+}
+
+
+double
+CubicPolyInterpolator::interpolate (double x)
+{
+ int lo = static_cast<int>(floor(x)) - 1;
+ int hi = lo + 3;
+
+ if (lo < -1) {
+ sys_error (ERR_WARNING, "x=%f, out of range [CubicPolyInterpolator]", x);
+ return (0);
+ } else if (lo == -1) // linear interpolate at between x = 0 & 1
+ return m_pdY[0] + x * (m_pdY[1] - m_pdY[0]);
+
+ if (hi > m_n) {
+ sys_error (ERR_WARNING, "x=%f, out of range [CubicPolyInterpolator]", x);
+ return (0);
+ } else if (hi == m_n) {// linear interpolate between x = (n-2) and (n-1)
+ double frac = x - (lo + 1);
+ return m_pdY[m_n - 2] + frac * (m_pdY[m_n - 1] - m_pdY[m_n - 2]);
+ }
+
+ // Lagrange formula for N=4 (cubic)
+
+ double xd_0 = x - lo;
+ double xd_1 = x - (lo + 1);
+ double xd_2 = x - (lo + 2);
+ double xd_3 = x - (lo + 3);
+
+ static double oneSixth = (1. / 6.);
+
+ double y = xd_1 * xd_2 * xd_3 * -oneSixth * m_pdY[lo];
+ y += xd_0 * xd_2 * xd_3 * 0.5 * m_pdY[lo+1];
+ y += xd_0 * xd_1 * xd_3 * -0.5 * m_pdY[lo+2];
+ y += xd_0 * xd_1 * xd_2 * oneSixth * m_pdY[lo+3];
+
+ return (y);
+}
+
+
+
+CubicSplineInterpolator::CubicSplineInterpolator (const double* const y, const int n)
+ : m_pdY(y), m_n(n)
+{
+ // Precalculate 2nd derivative of y and put in m_pdY2
+ // Calculated by solving set of simultaneous CubicSpline spline equations
+ // Only n-2 CubicSpline spline equations, but able to make two more
+ // equations by setting second derivative to 0 at ends
+
+ m_pdY2 = new double [n];
+ m_pdY2[0] = 0; // second deriviative = 0 at beginning and end
+ m_pdY2[n-1] = 0;
+
+ double* temp = new double [n - 1];
+ temp[0] = 0;
+ int i;
+ for (i = 1; i < n - 1; i++) {
+ double t = 2 + (0.5 * m_pdY2[i-1]);
+ temp[i] = y[i+1] + y[i-1] - y[i] - y[i];
+ temp[i] = (3 * temp[i] - 0.5 * temp[i-1]) / t;
+ m_pdY2[i] = -0.5 / t;
+ }
+
+ for (i = n - 2; i >= 0; i--)
+ m_pdY2[i] = temp[i] + m_pdY2[i] * m_pdY2[i + 1];
+
+ delete temp;
+}
+
+CubicSplineInterpolator::~CubicSplineInterpolator ()
+{
+ delete m_pdY2;
+}
+
+
+double
+CubicSplineInterpolator::interpolate (double x)
+{
+ const static double oneSixth = (1. / 6.);
+ int lo = static_cast<int>(floor(x));
+ int hi = lo + 1;
+
+ if (lo < 0 || hi >= m_n) {
+ sys_error (ERR_SEVERE, "X range out of bounds [CubicSplineInterpolator::interpolate]");
+ return (0);
+ }
+
+ double loFr = hi - x;
+ double hiFr = 1 - loFr;
+ double y = loFr * m_pdY[lo] + hiFr * m_pdY[hi];
+ y += oneSixth * ((loFr*loFr*loFr - loFr) * m_pdY2[lo] + (hiFr*hiFr*hiFr - hiFr) * m_pdY2[hi]);
+
+ return y;
+}
+
+
+
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
-# ADD LINK32 kernel32.lib user32.lib wsock32.lib comctl32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tiff.lib jpeg.lib png.lib zlib.lib xpm.lib opengl32.lib glu32.lib /nologo /subsystem:windows /machine:I386 /libpath:"\wx2.2.5\lib"
+# ADD LINK32 wsock32.lib tiff.lib jpeg.lib png.lib zlib.lib xpm.lib comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib htmlhelp.lib /nologo /subsystem:windows /machine:I386 /libpath:"\wx2.2.5\lib"
!ELSEIF "$(CFG)" == "ctsim - Win32 Debug"
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 comctl32.lib winmm.lib rpcrt4.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../libctsim/Debug/libctsim.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libcmtd.lib ..\..\..\fftw-2.1.3\Win32\FFTW2st\Debug\FFTW2st.lib ..\..\..\fftw-2.1.3\Win32\RFFTW2st\Debug\RFFTW2st.lib wxd.lib xpmd.lib tiffd.lib zlibd.lib pngd.lib opengl32.lib glu32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"\wx2.2.5\lib"
+# ADD LINK32 winmm.lib rpcrt4.lib ws2_32.lib ../libctsim/Debug/libctsim.lib libcmtd.lib ..\..\..\fftw-2.1.3\Win32\FFTW2st\Debug\FFTW2st.lib ..\..\..\fftw-2.1.3\Win32\RFFTW2st\Debug\RFFTW2st.lib wxd.lib xpmd.lib tiffd.lib zlibd.lib pngd.lib comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib htmlhelp.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"\wx2.2.5\lib"
# SUBTRACT LINK32 /nodefaultlib
!ENDIF
!IF "$(CFG)" == "ctsim - Win32 Release"
-# ADD CPP /I "..\..\..\fftw-2.1.3\fftw" /D CTSIMVERSION=\"3.0.0alpha5\"
+# ADD CPP /D CTSIMVERSION=\"3.0.0alpha5\"
# SUBTRACT CPP /D CTSIMVERSION=\"3.0.0beta1\"
!ELSEIF "$(CFG)" == "ctsim - Win32 Debug"
!IF "$(CFG)" == "ctsim - Win32 Release"
-# ADD CPP /I "..\..\..\fftw-2.1.3\fftw" /D CTSIMVERSION=\"3.0.0alpha5\"
+# ADD CPP /D CTSIMVERSION=\"3.0.0alpha5\"
# SUBTRACT CPP /D CTSIMVERSION=\"3.0.0beta1\"
!ELSEIF "$(CFG)" == "ctsim - Win32 Debug"
!IF "$(CFG)" == "ctsim - Win32 Release"
-# ADD CPP /I "..\..\..\fftw-2.1.3\fftw" /D CTSIMVERSION=\"3.0.0alpha5\"
+# ADD CPP /D CTSIMVERSION=\"3.0.0alpha5\"
# SUBTRACT CPP /D CTSIMVERSION=\"3.0.0beta1\"
!ELSEIF "$(CFG)" == "ctsim - Win32 Debug"
!IF "$(CFG)" == "ctsim - Win32 Release"
-# ADD CPP /I "..\..\..\fftw-2.1.3\fftw" /D CTSIMVERSION=\"3.0.0alpha5\"
+# ADD CPP /D CTSIMVERSION=\"3.0.0alpha5\"
# SUBTRACT CPP /D CTSIMVERSION=\"3.0.0beta1\"
!ELSEIF "$(CFG)" == "ctsim - Win32 Debug"
!IF "$(CFG)" == "ctsim - Win32 Release"
-# ADD CPP /I "..\..\..\fftw-2.1.3\fftw" /D CTSIMVERSION=\"3.0.0alpha5\"
+# ADD CPP /D CTSIMVERSION=\"3.0.0alpha5\"
# SUBTRACT CPP /D CTSIMVERSION=\"3.0.0beta1\"
!ELSEIF "$(CFG)" == "ctsim - Win32 Debug"
!IF "$(CFG)" == "ctsim - Win32 Release"
-# ADD CPP /I "..\..\..\fftw-2.1.3\fftw"
-
!ELSEIF "$(CFG)" == "ctsim - Win32 Debug"
!ENDIF
!IF "$(CFG)" == "ctsim - Win32 Release"
-# ADD CPP /I "..\..\..\fftw-2.1.3\fftw" /D CTSIMVERSION=\"3.0.0alpha5\"
+# ADD CPP /D CTSIMVERSION=\"3.0.0alpha5\"
# SUBTRACT CPP /D CTSIMVERSION=\"3.0.0beta1\"
!ELSEIF "$(CFG)" == "ctsim - Win32 Debug"
<pre>
<h1>Build Log</h1>
<h3>
---------------------Configuration: ctsim - Win32 Debug--------------------
+--------------------Configuration: ctsim - Win32 Release--------------------
</h3>
<h3>Command Lines</h3>
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP299.tmp" with contents
-[
-/nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "\wx2.2.5\include" /I "..\..\..\fftw-2.1.3\fftw" /I "\wx2.2.5\src\png" /I "\wx2.2.5\src\zlib" /I "..\..\include" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\rfftw" /D VERSION=\"3.0.0beta1\" /D "_DEBUG" /D "__WXMSW__" /D "HAVE_SGP" /D "HAVE_PNG" /D "HAVE_WXWINDOWS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "HAVE_STRING_H" /D "HAVE_FFTW" /D "HAVE_RFFTW" /D "HAVE_GETOPT_H" /D "MSVC" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D CTSIMVERSION=\"3.0.0alpha5\" /FR"Debug/" /Fp"Debug/ctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
-"C:\ctsim\src\dialogs.cpp"
-]
-Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP299.tmp"
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP29A.tmp" with contents
-[
-winmm.lib rpcrt4.lib ws2_32.lib ../libctsim/Debug/libctsim.lib libcmtd.lib ..\..\..\fftw-2.1.3\Win32\FFTW2st\Debug\FFTW2st.lib ..\..\..\fftw-2.1.3\Win32\RFFTW2st\Debug\RFFTW2st.lib wxd.lib xpmd.lib tiffd.lib zlibd.lib pngd.lib comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib htmlhelp.lib /nologo /subsystem:windows /incremental:yes /pdb:"Debug/ctsim.pdb" /debug /machine:I386 /out:"Debug/ctsim.exe" /pdbtype:sept /libpath:"\wx2.2.5\lib"
-.\Debug\ctsim.obj
-.\Debug\dialogs.obj
-.\Debug\dlgprojections.obj
-.\Debug\dlgreconstruct.obj
-.\Debug\docs.obj
-.\Debug\graph3dview.obj
-.\Debug\views.obj
-.\Debug\ctsim.res
-\ctsim\msvc\libctsim\Debug\libctsim.lib
-"\fftw-2.1.3\Win32\FFTW2st\Debug\FFTW2st.lib"
-"\fftw-2.1.3\Win32\RFFTW2st\Debug\RFFTW2st.lib"
-\wx2.2.5\lib\jpegd.lib
-\wx2.2.5\lib\pngd.lib
-\wx2.2.5\lib\wxd.lib
-\wx2.2.5\lib\xpmd.lib
-\wx2.2.5\lib\zlibd.lib
-\wx2.2.5\lib\tiffd.lib
-]
-Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP29A.tmp"
-<h3>Output Window</h3>
-Compiling...
-dialogs.cpp
-Linking...
# End Source File
# Begin Source File
-SOURCE=..\..\libctsupport\cubicinterp.cpp
-# End Source File
-# Begin Source File
-
SOURCE=..\..\libctgraphics\dlgezplot.cpp
# End Source File
# Begin Source File
# End Source File
# Begin Source File
+SOURCE=..\..\libctsupport\interpolator.cpp
+# End Source File
+# Begin Source File
+
SOURCE=..\..\libctsupport\mathfuncs.cpp
# End Source File
# Begin Source File
# End Source File
# Begin Source File
-SOURCE=..\..\include\cubicinterp.h
-# End Source File
-# Begin Source File
-
SOURCE=..\..\include\dlgezplot.h
# End Source File
# Begin Source File
# End Source File
# Begin Source File
+SOURCE=..\..\include\interpolator.h
+# End Source File
+# Begin Source File
+
SOURCE=..\..\include\mpiworld.h
# End Source File
# Begin Source File
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: ctsim.cpp,v 1.74 2001/02/11 04:56:38 kevin Exp $
+** $Id: ctsim.cpp,v 1.75 2001/02/11 21:57:08 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
#endif
#endif
-static const char* rcsindent = "$Id: ctsim.cpp,v 1.74 2001/02/11 04:56:38 kevin Exp $";
+static const char* rcsindent = "$Id: ctsim.cpp,v 1.75 2001/02/11 21:57:08 kevin Exp $";
struct option CTSimApp::ctsimOptions[] =
{
IMPLEMENT_APP(CTSimApp)
CTSimApp::CTSimApp()
-: m_docManager(NULL), m_pFrame(NULL), m_pLog(0), m_pLogDoc(0), m_bAdvancedOptions(false)
+: m_docManager(NULL), m_pFrame(NULL), m_pLog(0), m_pLogDoc(0), m_pConfig(0),
+ m_bAdvancedOptions(false), m_bSetModifyNewDocs(true)
{
theApp = this;
}
setpriority (PRIO_PROCESS, 0, 15); // set to low scheduling priority
#endif
- m_pConfig = new wxConfig("ctsim", _T(""), ".ctsim", "", wxCONFIG_USE_LOCAL_FILE);
- wxConfigBase::Set(m_pConfig);
+ openConfig();
g_bRunningWXWindows = true;
// process options
#endif
wxLog::SetActiveTarget (new wxLogTextCtrl(m_pLog));
-#ifdef CTSIM_WINHELP
- if (! m_pFrame->getWinHelpController().Initialize("ctsim"))
- *m_pLog << "Cannot initialize the Windows Help system" << "\n";
-#endif
wxString helpDir;
if (! m_pConfig->Read("HelpDir", &helpDir))
helpDir = ::wxGetCwd();
+#ifdef CTSIM_WINHELP
+ if (! m_pFrame->getWinHelpController().Initialize(helpDir + "/ctsim"))
+ *m_pLog << "Cannot initialize the Windows Help system" << "\n";
+#else
if (! m_pFrame->getHtmlHelpController().Initialize(helpDir + "/ctsim") &&
! m_pFrame->getHtmlHelpController().Initialize("/usr/local/man/ctsim"))
*m_pLog << "Cannot initialize the HTML Help system" << "\n";
m_pFrame->getHtmlHelpController().SetTempDir(_T("/tmp"));
m_pFrame->getHtmlHelpController().UseConfig (m_pConfig);
}
+#endif
for (int i = optind + 1; i <= argc; i++) {
wxString filename = argv [i - 1];
int
CTSimApp::OnExit()
{
- delete m_pConfig;
+ closeConfig();
#ifdef HAVE_DMALLOC
dmalloc_shutdown();
return 0;
}
+void
+CTSimApp::openConfig()
+{
+#ifdef MSVC
+ m_pConfig = new wxConfig("ctsim", "Kevin Rosenberg", "", "", wxCONFIG_USE_LOCAL_FILE);
+#else
+ m_pConfig = new wxConfig("ctsim", "Kevin Rosenberg", ".ctsim", "", wxCONFIG_USE_LOCAL_FILE);
+#endif
+
+ wxConfigBase::Set(m_pConfig);
+ m_pConfig->Read ("AdvancedOptions", &m_bAdvancedOptions);
+ m_pConfig->Read ("SetModifyNewDocs", &m_bSetModifyNewDocs);
+}
+
+void
+CTSimApp::closeConfig()
+{
+ m_pConfig->Write ("AdvancedOptions", m_bAdvancedOptions);
+ m_pConfig->Write ("SetModifyNewDocs", m_bSetModifyNewDocs);
+ delete m_pConfig;
+}
+
+
wxString
CTSimApp::getUntitledFilename()
{
void
MainFrame::OnPreferences (wxCommandEvent& WXUNUSED(event) )
{
- theApp->setAdvancedOptions (! theApp->getAdvancedOptions());
+ DialogPreferences dlg (this, "CTSim Preferences", theApp->getAdvancedOptions(),
+ theApp->getAskDeleteNewDocs());
+ if (dlg.ShowModal() == wxID_OK) {
+ theApp->setAdvancedOptions (dlg.getAdvancedOptions());
+ theApp->setAskDeleteNewDocs (dlg.getAskDeleteNewDocs());
+ }
}
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: ctsim.h,v 1.43 2001/02/11 04:56:38 kevin Exp $
+** $Id: ctsim.h,v 1.44 2001/02/11 21:57:08 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 "dlgezplot.h"
-#if defined(__WXMSW__)
+#if defined(__WXMSW__) || defined (MSVC)
#define CTSIM_WINHELP 1
#endif
static struct option ctsimOptions[];
bool m_bAdvancedOptions;
+ bool m_bSetModifyNewDocs;
+
wxDocManager* m_docManager;
MainFrame* m_pFrame;
wxConfig* m_pConfig;
TextFileDocument* m_pLogDoc;
void usage (const char* program);
-
+ void openConfig();
+ void closeConfig();
+
public:
CTSimApp();
bool OnInit();
void setIconForFrame (wxFrame* pFrame);
wxConfig* getConfig()
{ return m_pConfig; }
+ bool getAskDeleteNewDocs() const { return m_bSetModifyNewDocs; }
+ void setAskDeleteNewDocs(bool bAsk) { m_bSetModifyNewDocs = bAsk; }
wxDocTemplate* getDocTemplImage() { return m_pDocTemplImage; }
wxDocTemplate* getDocTemplProjection() { return m_pDocTemplProjection; }
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: dialogs.cpp,v 1.29 2001/02/11 04:56:38 kevin Exp $
+** $Id: dialogs.cpp,v 1.30 2001/02/11 21:57:08 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
}
+/////////////////////////////////////////////////////////////////////
+// CLASS DiaglogPreferences Implementation
+/////////////////////////////////////////////////////////////////////
+
+DialogPreferences::DialogPreferences (wxWindow* pParent, const char* const pszTitle,
+ bool bAdvancedOptions, bool bAskDeleteNewDocs)
+: wxDialog (pParent, -1, pszTitle, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
+{
+ wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
+
+ pTopSizer->Add (new wxStaticText (this, -1, pszTitle), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5);
+
+ pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
+
+ m_pCBAdvancedOptions = new wxCheckBox (this, -1, "", wxDefaultPosition, wxSize(100, 25), 0);
+ m_pCBAdvancedOptions->SetValue (bAdvancedOptions);
+
+ m_pCBAskDeleteNewDocs = new wxCheckBox (this, -1, "", wxDefaultPosition, wxSize(100, 25), 0);
+ m_pCBAskDeleteNewDocs->SetValue (bAskDeleteNewDocs);
+
+ wxFlexGridSizer *pGridSizer = new wxFlexGridSizer (2);
+ pGridSizer->Add (m_pCBAdvancedOptions, 0, wxALIGN_CENTER_VERTICAL);
+ pGridSizer->Add (new wxStaticText (this, -1, "Show Advanced Options"), 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
+ pGridSizer->Add (m_pCBAskDeleteNewDocs, 0, wxALIGN_CENTER_VERTICAL);
+ pGridSizer->Add (new wxStaticText (this, -1, "Ask Save New Documents Before Closing"), 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
+ pTopSizer->Add (pGridSizer, 1, wxALL, 10);
+
+ pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
+
+ wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
+ wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
+ wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
+ pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
+ pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
+
+ pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
+
+ SetAutoLayout (true);
+ SetSizer (pTopSizer);
+ pTopSizer->Fit (this);
+ pTopSizer->SetSizeHints (this);
+}
+
+DialogPreferences::~DialogPreferences ()
+{
+}
+
+bool
+DialogPreferences::getAdvancedOptions ()
+{
+ return static_cast<bool>(m_pCBAdvancedOptions->GetValue());
+}
+
+bool
+DialogPreferences::getAskDeleteNewDocs ()
+{
+ return static_cast<bool>(m_pCBAskDeleteNewDocs->GetValue());
+}
+
+
/////////////////////////////////////////////////////////////////////
// CLASS DiaglogGetMinMax Implementation
/////////////////////////////////////////////////////////////////////
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: dialogs.h,v 1.24 2001/02/11 04:56:38 kevin Exp $
+** $Id: dialogs.h,v 1.25 2001/02/11 21:57:08 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
};
+class DialogPreferences : public wxDialog
+{
+ public:
+ DialogPreferences (wxWindow* pParent, const char* const pszTitle, bool bAdvanced, bool bAskNewDocs);
+ virtual ~DialogPreferences ();
+
+ bool getAdvancedOptions ();
+ bool getAskDeleteNewDocs ();
+
+ private:
+ wxCheckBox* m_pCBAdvancedOptions;
+ wxCheckBox* m_pCBAskDeleteNewDocs;
+};
+
+
class ImageFile;
class DialogGetMinMax : public wxDialog
{
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: views.cpp,v 1.102 2001/02/11 04:56:38 kevin Exp $
+** $Id: views.cpp,v 1.103 2001/02/11 21:57:08 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
<< " and " << pCompareDoc->GetFirstView()->GetFrame()->GetTitle().c_str() << ": "
<< os.str().c_str();
pDifferenceImage->labelAdd (os.str().c_str());
- pDifferenceDoc->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ pDifferenceDoc->Modify (true);
pDifferenceDoc->UpdateAllViews (this);
pDifferenceDoc->getView()->OnUpdate (this, NULL);
pDifferenceDoc->getView()->getFrame()->Show(true);
ImageFile& rIF = GetDocument()->getImageFile();
rIF.invertPixelValues (rIF);
rIF.labelAdd ("Invert Pixel Values");
- GetDocument()->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ GetDocument()->Modify (true);
GetDocument()->UpdateAllViews (this);
}
ImageFile& rIF = GetDocument()->getImageFile();
rIF.square (rIF);
rIF.labelAdd ("Square Pixel Values");
- GetDocument()->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ GetDocument()->Modify (true);
GetDocument()->UpdateAllViews (this);
}
ImageFile& rIF = GetDocument()->getImageFile();
rIF.sqrt (rIF);
rIF.labelAdd ("Square-root Pixel Values");
- GetDocument()->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ GetDocument()->Modify (true);
GetDocument()->UpdateAllViews (this);
}
ImageFile& rIF = GetDocument()->getImageFile();
rIF.log (rIF);
rIF.labelAdd ("Logrithm base-e Pixel Values");
- GetDocument()->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ GetDocument()->Modify (true);
GetDocument()->UpdateAllViews (this);
}
ImageFile& rIF = GetDocument()->getImageFile();
rIF.exp (rIF);
rIF.labelAdd ("Exponent base-e Pixel Values");
- GetDocument()->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ GetDocument()->Modify (true);
GetDocument()->UpdateAllViews (this);
}
newImage.labelsCopy (rRHSIF, s.c_str());
newImage.labelAdd (os.str().c_str());
*theApp->getLog() << os.str().c_str() << "\n";
- pNewDoc->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ pNewDoc->Modify (true);
pNewDoc->UpdateAllViews (this);
pNewDoc->getView()->OnUpdate (this, NULL);
pNewDoc->getView()->getFrame()->Show(true);
newImage.labelsCopy (rRHSIF, s.c_str());
newImage.labelAdd (os.str().c_str());
*theApp->getLog() << os.str().c_str() << "\n";
- pNewDoc->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ pNewDoc->Modify (true);
pNewDoc->UpdateAllViews (this);
pNewDoc->getView()->OnUpdate (this, NULL);
pNewDoc->getView()->getFrame()->Show(true);
newImage.labelsCopy (rRHSIF, s.c_str());
newImage.labelAdd (os.str().c_str());
*theApp->getLog() << os.str().c_str() << "\n";
- pNewDoc->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ pNewDoc->Modify (true);
pNewDoc->UpdateAllViews (this);
pNewDoc->getView()->OnUpdate (this, NULL);
pNewDoc->getView()->getFrame()->Show(true);
newImage.labelsCopy (rRHSIF, s.c_str());
newImage.labelAdd (os.str().c_str());
*theApp->getLog() << os.str().c_str() << "\n";
- pNewDoc->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ pNewDoc->Modify (true);
pNewDoc->UpdateAllViews (this);
pNewDoc->getView()->OnUpdate (this, NULL);
pNewDoc->getView()->getFrame()->Show(true);
rIF.labelAdd ("FFT Image");
m_bMinSpecified = false;
m_bMaxSpecified = false;
- GetDocument()->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ GetDocument()->Modify (true);
GetDocument()->UpdateAllViews (this);
}
rIF.labelAdd ("IFFT Image");
m_bMinSpecified = false;
m_bMaxSpecified = false;
- GetDocument()->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ GetDocument()->Modify (true);
GetDocument()->UpdateAllViews (this);
}
rIF.labelAdd ("FFT Rows");
m_bMinSpecified = false;
m_bMaxSpecified = false;
- GetDocument()->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ GetDocument()->Modify (true);
GetDocument()->UpdateAllViews (this);
}
rIF.labelAdd ("IFFT Rows");
m_bMinSpecified = false;
m_bMaxSpecified = false;
- GetDocument()->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ GetDocument()->Modify (true);
GetDocument()->UpdateAllViews (this);
}
rIF.labelAdd ("FFT Columns");
m_bMinSpecified = false;
m_bMaxSpecified = false;
- GetDocument()->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ GetDocument()->Modify (true);
GetDocument()->UpdateAllViews (this);
}
rIF.labelAdd ("IFFT Columns");
m_bMinSpecified = false;
m_bMaxSpecified = false;
- GetDocument()->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ GetDocument()->Modify (true);
GetDocument()->UpdateAllViews (this);
}
#endif
rIF.labelAdd ("Fourier Image");
m_bMinSpecified = false;
m_bMaxSpecified = false;
- GetDocument()->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ GetDocument()->Modify (true);
GetDocument()->UpdateAllViews (this);
}
rIF.labelAdd ("Inverse Fourier Image");
m_bMinSpecified = false;
m_bMaxSpecified = false;
- GetDocument()->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ GetDocument()->Modify (true);
GetDocument()->UpdateAllViews (this);
}
rIF.labelAdd ("Shuffle Natural To Fourier Order");
m_bMinSpecified = false;
m_bMaxSpecified = false;
- GetDocument()->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ GetDocument()->Modify (true);
GetDocument()->UpdateAllViews (this);
}
rIF.labelAdd ("Shuffle Fourier To Natural Order");
m_bMinSpecified = false;
m_bMaxSpecified = false;
- GetDocument()->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ GetDocument()->Modify (true);
GetDocument()->UpdateAllViews (this);
}
rIF.labelAdd ("Magnitude of complex-image");
m_bMinSpecified = false;
m_bMaxSpecified = false;
- GetDocument()->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ GetDocument()->Modify (true);
GetDocument()->UpdateAllViews (this);
}
}
rIF.labelAdd ("Phase of complex-image");
m_bMinSpecified = false;
m_bMaxSpecified = false;
- GetDocument()->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ GetDocument()->Modify (true);
GetDocument()->UpdateAllViews (this);
}
}
rScaledIF.labelAdd (os.str().c_str());
rIF.scaleImage (rScaledIF);
*theApp->getLog() << os.str().c_str() << "\n";
- pScaledDoc->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ pScaledDoc->Modify (true);
pScaledDoc->UpdateAllViews (this);
pScaledDoc->getView()->OnUpdate (this, NULL);
pScaledDoc->getView()->getFrame()->Show(true);
delete pYImag;
delete pYMag;
}
- pPlotDoc->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ pPlotDoc->Modify (true);
pPlotDoc->UpdateAllViews ();
pPlotDoc->getView()->OnUpdate (this, NULL);
pPlotDoc->getView()->getFrame()->Show(true);
delete pYImag;
delete pYMag;
}
- pPlotDoc->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ pPlotDoc->Modify (true);
pPlotDoc->UpdateAllViews ();
pPlotDoc->getView()->OnUpdate (this, NULL);
pPlotDoc->getView()->getFrame()->Show(true);
delete pYMag;
delete [] pcIn;
- pPlotDoc->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ pPlotDoc->Modify (true);
pPlotDoc->UpdateAllViews ();
pPlotDoc->getView()->OnUpdate (this, NULL);
pPlotDoc->getView()->getFrame()->Show(true);
delete pdTemp;
delete [] pcIn;
- pPlotDoc->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ pPlotDoc->Modify (true);
pPlotDoc->UpdateAllViews ();
pPlotDoc->getView()->OnUpdate (this, NULL);
pPlotDoc->getView()->getFrame()->Show(true);
delete pX;
delete pY1;
delete pY2;
- pPlotDoc->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ pPlotDoc->Modify (true);
pPlotDoc->UpdateAllViews ();
pPlotDoc->getView()->OnUpdate (this, NULL);
pPlotDoc->getView()->getFrame()->Show(true);
delete pX;
delete pY1;
delete pY2;
- pPlotDoc->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ pPlotDoc->Modify (true);
pPlotDoc->UpdateAllViews ();
pPlotDoc->getView()->OnUpdate (this, NULL);
pPlotDoc->getView()->getFrame()->Show(true);
rPlotFile.addDescription (os.str().c_str());
delete pX;
delete pY;
- pPlotDoc->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ pPlotDoc->Modify (true);
pPlotDoc->UpdateAllViews ();
pPlotDoc->getView()->OnUpdate (this, NULL);
pPlotDoc->getView()->getFrame()->Show(true);
GetDocumentManager()->ActivateView (projView, true, false);
}
::wxYield();
- pProjectionDoc-> Modify(true);
+ if (theApp->getAskDeleteNewDocs())
+ pProjectionDoc-> Modify(true);
pProjectionDoc->UpdateAllViews (this);
}
}
}
pRasterDoc->setImageFile (pImageFile);
- pRasterDoc->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ pRasterDoc->Modify (true);
pRasterDoc->UpdateAllViews (this);
pRasterDoc->getView()->getFrame()->Show(true);
std::ostringstream os;
<< strInterpolation.c_str();
*theApp->getLog() << os.str().c_str() << "\n";
rIF.labelAdd (os.str().c_str());
- pPolarDoc->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ pPolarDoc->Modify (true);
pPolarDoc->UpdateAllViews ();
pPolarDoc->getView()->OnUpdate (this, NULL);
pPolarDoc->getView()->getFrame()->Show(true);
<< strInterpolation.c_str() << ", zeropad=" << m_iDefaultPolarZeropad;
*theApp->getLog() << os.str().c_str() << "\n";
rIF.labelAdd (os.str().c_str());
- pPolarDoc->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ pPolarDoc->Modify (true);
pPolarDoc->UpdateAllViews ();
pPolarDoc->getView()->OnUpdate (this, NULL);
pPolarDoc->getView()->getFrame()->Show(true);
return;
}
pReconDoc->setImageFile (pImageFile);
- pReconDoc->Modify (true);
+ if (theApp->getAskDeleteNewDocs())
+ pReconDoc->Modify (true);
pReconDoc->UpdateAllViews (this);
if (ImageFileView* rasterView = pReconDoc->getView()) {
rasterView->OnUpdate (rasterView, NULL);
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: pjrec.cpp,v 1.22 2001/02/09 14:34:16 kevin Exp $
+** $Id: pjrec.cpp,v 1.23 2001/02/11 21:57:08 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
{0, 0, 0, 0}
};
-static const char* g_szIdStr = "$Id: pjrec.cpp,v 1.22 2001/02/09 14:34:16 kevin Exp $";
+static const char* g_szIdStr = "$Id: pjrec.cpp,v 1.23 2001/02/11 21:57:08 kevin Exp $";
void
pjrec_usage (const char *program)
std::string sOptFilterMethodName (ProcessSignal::convertFilterMethodIDToName (ProcessSignal::FILTER_METHOD_CONVOLUTION));
std::string sOptFilterGenerationName (ProcessSignal::convertFilterGenerationIDToName (ProcessSignal::FILTER_GENERATION_DIRECT));
std::string sOptInterpName (Backprojector::convertInterpIDToName (Backprojector::INTERP_LINEAR));
- std::string sOptBackprojectName (Backprojector::convertBackprojectIDToName (Backprojector::BPROJ_IDIFF3));
+ std::string sOptBackprojectName (Backprojector::convertBackprojectIDToName (Backprojector::BPROJ_IDIFF));
int iOptPreinterpolationFactor = 1;
int nx, ny;
char *endptr;