bda68add4cf7f23b94f18d75ef755520966da7b9
[ctsim.git] / doc / tex2rtf / ctsim.tex
1 \documentclass[11pt]{report}%
2 %\input{psbox.tex}
3 \usepackage{texhelp}
4 \usepackage{fancyheadings}
5 \usepackage{mysober}
6 \usepackage{mytitle}
7 \usepackage{verbatim}
8 \usepackage{makeidx}
9 \usepackage{times}
10 \usepackage{hyperref}
11
12 \newcommand{\ctsim}{{\tt CTSim}}
13 \newcommand{\ctsimtext}{{\tt CTSimText}}
14 \newcommand{\usage}{{\bf Usage}{\par}}
15
16 \newcommand{\commandref}[2]{\helpref{{\tt $\backslash$#1}}{#2}}%
17 \newcommand{\commandrefn}[2]{\helprefn{{\tt $\backslash$#1}}{#2}\index{#1}}%
18 \newcommand{\commandpageref}[2]{\latexignore{\helprefn{{\tt $\backslash$#1}}{#2}}\latexonly{{\tt $\backslash$#1} {\it page \pageref{#2}}}\index{#1}}%
19 \newcommand{\indexit}[1]{#1\index{#1}}%
20 \newcommand{\inioption}[1]{{\bf {\tt #1}}\index{#1}}%
21 \parskip=10pt%
22 \parindent=0pt%
23 %\backgroundcolour{255;255;255}\textcolour{0;0;0}% Has an effect in HTML only
24 \winhelpignore{\title{Manual for CTSim 3.0}%
25 \author{Kevin Rosenberg, M.D.}%
26 \date{January 2001}%
27 }%
28 \winhelponly{\title{Manual for CTSim 3.0}%
29 \author{by Kevin Rosenberg, M.D.\\$$\image{3cm;3cm}{logo-huge.bmp}$$}%
30 }%
31 \makeindex%
32 \begin{document}%
33 \maketitle%
34 \pagestyle{fancyplain}%
35 \bibliographystyle{plain}%
36 \pagenumbering{roman}%
37
38 \setheader{{\it CONTENTS}}{}{}{}{}{{\it CONTENTS}}%
39 \setfooter{\thepage}{}{}{}{}{\thepage}%
40 \tableofcontents%
41
42 \chapter*{Copyright notice}%
43 \setheader{{\it COPYRIGHT}}{}{}{}{}{{\it COPYRIGHT}}%
44 \setfooter{\thepage}{}{}{}{}{\thepage}%
45
46 Copyright (c) 1983-2001 Kevin Rosenberg, M.D.
47
48 Permission to use, copy, modify, and distribute this software and its
49 documentation for any purpose is hereby granted without fee, provided that the
50 above copyright notice, author statement and this permission notice appear in
51 all copies of this software and related documentation.
52
53 THE SOFTWARE IS PROVIDED ``AS-IS'' AND WITHOUT WARRANTY OF ANY KIND, EXPRESS,
54 IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
55 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
56
57 IN NO EVENT SHALL KEVIN ROSENBERG BE LIABLE FOR ANY
58 SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR
59 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
60 WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY
61 OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
62 PERFORMANCE OF THIS SOFTWARE.
63
64 \chapter{Introduction}\label{introduction}%
65 \pagenumbering{arabic}%
66 \setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}%
67 \setfooter{\thepage}{}{}{}{}{\thepage}%
68
69 \winhelponly{$$\image{3cm;3cm}{logo-huge}$$}%
70 \htmlonly{$$\image{3cm;3cm}{logo-huge.gif}$$}%
71 Computed Tomography is a technique for estimating the interior of an object 
72 from measurement of radiation collected around the object. This radiation 
73 can be either projected through or emitted from the object.
74 \rtfsp\ctsim simulates the process of projecting X-rays through a phantom object.
75 \rtfsp\ctsim can then reconstruct the interior of the object from the projections
76 collected around the phantom object.
77
78 The \ctsim package has two executable files: the graphical \helprefn{ctsim}{ctsim} and text \helprefn{ctsimtext}{ctsimtext} programs.
79
80 \include{ctsim-concepts}
81
82 \chapter{Installation}\index{Installation}%
83 \setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}%
84 \setfooter{\thepage}{}{}{}{}{\thepage}%
85
86 \section{Download}\label{download}\index{Installation,Download}%
87
88 The latest version of CTSim, plus source code, can be accessed from:
89
90 \begin{verbatim}
91 http://www.ctsim.org
92 ftp://ftp.ctsim.org
93 \end{verbatim}
94
95 It is available in Windows 95/NT/2000 and Linux GUI versions and non-GUI versions.
96
97 \section{Installing Linux RPM}\index{Installation,Linux}%
98
99 \section{Installing Windows Binary}\index{Installation,Windows}%
100
101 \section{Build From Sources}\label{build}\index{Installation,Build}%
102
103 See the INSTALL file included in the source distribution for instructions.
104
105 \section{Web Requirements}\label{installreq}\index{Installation,Requirements}%
106   \begin{itemize}\itemsep=0pt
107   \item zlib Library (optional)
108         \par Used for PNG file export.
109
110   \item libpng Library (optional)
111         \par Used for PNG file export.
112         \par www.libpng.org
113
114   \item FFTW library (optional)
115         \par Used for frequency-based filtering and fourier transformations of images.
116         \par www.fftw.org
117
118   \item readline library (optional)
119         \par Used for \ctsimtext interactive shell.
120
121   \item dmalloc library (optional)
122         \par Used for debugging memory allocation
123         \par www.dmalloc.com
124
125   \item wxWindows library (optional) 
126   \par Used for platform-independent graphical interface. The graphical-shell
127   program \ctsim requires this library.  
128   \par www.wxwindows.org
129 \end{itemize}
130
131 \chapter{ctsim - the Graphical User Interface}\label{ctsim}\index{ctsim}% 
132 \setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}%
133 \setfooter{\thepage}{}{}{}{}{\thepage}%
134
135 \ctsim is the graphical shell for the CTSim project. It is
136 written using the wxLibrary for cross-platform compatibility with GTK,
137 Motif, and Microsoft Windows. It includes all of the functionality of
138 the command-line tool {\tt ctsimtext} as well as image processing and visualization features.
139
140 \ctsim can open projection files, image files, phantom definition files, and plotfiles.
141
142 \usage
143 ctsim [OPTIONS] [files to open...]
144
145 \chapter{ctsimtext}\label{ctsimtext}\index{ctsimtext}%
146 \setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}%
147 \setfooter{\thepage}{}{}{}{}{\thepage}%
148
149 \ctsimtext is a master shell for all of the command-line utilities. 
150
151 \usage
152 \ctsimtext can be executed without any parameters. In that case, \ctsimtext
153 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 {\tt quit} command.
154
155 \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
156 {\tt ctsimtext function-name parameters...}.
157
158 The available functions are:
159
160 \section{if1}\label{if1}\index{ctsimtext,if1}%
161 Perfoms math functions on a single image.
162
163 \usage
164 \begin{itemize}\itemsep=0pt
165   \item --invert
166   \item --log
167   \item --exp
168   \item --sqr
169   \item --sqrt
170 \end{itemize}
171
172 \section{if2}\label{if2}\index{ctsimtext,if2}%
173 Perfoms math functions on a two images.
174
175 \usage
176 \begin{itemize}\itemsep=0pt
177   \item --add
178   \item --sub
179   \item --mul
180   \item --comp
181   \item --column-plot
182   \item --row-plot
183 \end{itemize}
184
185 \section{ifexport}\label{ifexport}\index{ctsimtext,ifexport}%
186 Export an imagefile to a standard graphics file.
187
188 \usage
189 \begin{itemize}\itemsep=0pt
190   \item --format
191   \begin{itemize}\itemsep=0pt
192     \item --pgm
193     \item --pgmasc
194     \item --png
195     \item --png16
196   \end{itemize}
197   \item --center
198   \begin{itemize}\itemsep=0pt
199     \item median
200     \item mode
201     \item mean
202   \end{itemize}
203   \item --auto
204   \begin{itemize}\itemsep=0pt
205      \item --full
206      \item --std0.1
207      \item --std0.5
208      \item --std1
209      \item --std2
210      \item --std3
211   \end{itemize}
212   \item --scale
213   \item --min
214   \item --max
215 \end{itemize}
216
217 \section{ifinfo}\label{ifinfo}\index{ctsimtext,ifinfo}%
218
219 Displays information about an imagefile.
220
221 \usage
222 \begin{itemize}\itemsep=0pt
223   \item --labels
224   \item --no-labels
225   \item --stats
226   \item --no-stats
227   \item --help
228 \end{itemize}
229
230 \section{phm2pj}\label{phm2pj}\index{ctsimtext,phm2pj}%
231 Simulates collection of X-rays data (projections) around a phantom object.
232
233 \usage
234 phm2pj projection-file-name number-of-detectors number-of-views [options...]
235 \begin{itemize}\itemsep=0pt
236   \item --phantom
237   Select a standard phantom 
238   \begin{itemize}\itemsep=0pt
239     \item herman
240     \item herman-b
241     \item shepp-logan
242     \item shepp-logan-b
243   \end{itemize}
244
245   \item --phmfile
246   Load a phantom definition definition
247
248   \item --geometry
249   \begin{itemize}\itemsep=0pt
250     \item parallel
251     \item equiangular
252     \item equilinear
253   \end{itemize}
254
255   \item --nray
256     Number of samples per each detector
257
258   \item --rotangle
259     Sets the rotation amount as a multiple of pi. For parallel geometries use
260 a rotation angle of 1 and for equilinear and equiangular geometries use a rotation angle of 2.
261
262   \item --field-of-view
263     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.
264
265   \item --focal-length
266     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.
267 \end{itemize}
268
269 The Herman phantom is taken with permission from Gabor Hermans 1980 book\cite{HERMAN80}. The Shepp-Logan phantom was published in 1974\cite{SHEPP74}.
270
271 \section{phm2if}\label{phm2if}\index{ctsimtext,phm2if}%
272 Converts a geometric phantom object into an imagefile. The size of the
273 imagefile in pixels must be specified as well as the number of samples
274 to average per pixel.
275
276 \usage
277 \begin{itemize}\itemsep=0pt
278   \item --nsamples
279 \end{itemize}
280
281 \section{pj2if}\label{pj2if}\index{ctsimtext,pj2if}%
282 Convert a projection file into an imagefile.
283
284 \usage
285 \begin{itemize}\itemsep=0pt
286 \item --help    Print brief online help
287 \end{itemize}
288
289 \section{pjinfo}\label{pjinfo}\index{ctsimtext,pjinfo}%
290 Displays information about a projection file.
291
292 \usage
293 \begin{itemize}\itemsep=0pt
294   \item --binaryheader
295   \item --binaryview
296   \item --startview
297   \item --endview
298   \item --dump
299 \end{itemize}
300
301 \section{pjrec}\label{pjrec}\index{ctsimtext,pjrec}%
302 Reconstructs the interior of an object from a projection file.
303
304 \usage
305 \begin{twocollist}
306 \twocolitemruled{{\bf Parameter}}{{\bf Options}}
307 \twocolitem{{\bf --filter}}
308 {Selects which filter to apply to each projection. To properly reconstruct an image, this filter should be multiplied 
309 by the absolute value of distance from zero frequency.
310 \begin{itemize}\itemsep=0pt
311 \item abs\_bandlimit
312 \item abs\_cosine
313 \item abs\_hamming
314 \end{itemize}
315 }
316 \twocolitem{{\bf --filter-parameter}}{Sets the alpha level for Hamming
317   window. At setting of 0.54, this equals the Hanning window.}
318
319 \twocolitem{{\bf --filter-method}}{Selects the filtering method. For large numbers of detectors, {\tt rfftw} is optimal. For smaller numbers of detectors, {\tt convolution} might be a bit faster. 
320 \begin{itemize}\itemsep=0pt
321 \item convolution
322 \item fourier
323 \item fourier\_table
324 \item fftw
325 \item rfftw
326 \end{itemize}
327 }
328
329 \twocolitem{{\bf --filter-generation}}{Selects the filter generation. With convolution, {\tt direct} is the proper method to select. With any of the frequency methods, {\tt inverse-fourier} is the best method.
330 \begin{itemize}\itemsep=0pt
331 \item direct
332 \item inverse-fourier
333 \end{itemize}
334 }
335 \twocolitem{{\bf --interpolation}}{Interpolation technique. {\tt linear} is optimal.
336 \begin{itemize}\itemsep=0pt
337 \item nearest
338 \item linear
339 \end{itemize}
340 }    
341   \twocolitem{{\bf -backprojection}}{Selects the backprojection technique. A setting of {\tt idiff3} is optimal.
342 \begin{itemize}\itemsep=0pt
343 \item trig
344 \item table
345 \item diff
346 \item diff2
347 \item idiff2
348 \item idiff3
349 \end{itemize}
350 }
351 \twocolitem{{\bf --zeropad}}{ Zeropad factor. A setting of {\tt 1} is optimal.}
352
353 \twocolitem{{\bf --preinterpolate}}{Selects preinterpolation interpolation technique and sets the preinterpolation factor. Currently, this is experimental and does not work well.}
354 \end{twocollist}
355
356 \chapter{The Web Browser CGI Interface}\label{webinterface}\index{Web Interface}%
357 \setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}%
358 \setfooter{\thepage}{}{}{}{}{\thepage}%
359
360 \section{Overview}\index{Web Interface,Overview}%
361 The CGI program {\tt ctsim.cgi} takes projections of a standard
362 phantom object, performs reconstruction, and then compares the
363 rasterized phantom object with the reconstruction. The comparison is
364 performed both visually by an image subtraction as well as by standard
365 statistics as described by Herman\cite{HERMAN80}.
366
367 \section{Requirements}\index{Web Interface,Requirements}%
368    \begin{itemize}\itemsep=0pt
369       \item Apache or other CGI compatible web server
370
371       \item Perl (version 4.0 or higher)
372
373       \item A client web browser than can display PNG files. Most
374       current web browsers support PNG.
375   \end{itemize}
376
377 \newpage
378
379 \bibliographystyle{plain}
380 \bibliography{ctsim}
381 \addcontentsline{toc}{chapter}{Bibliography}
382 \setheader{{\it REFERENCES}}{}{}{}{}{{\it REFERENCES}}%
383 \setfooter{\thepage}{}{}{}{}{\thepage}%
384
385 \addcontentsline{toc}{chapter}{Index}
386 \setheader{{\it INDEX}}{}{}{}{}{{\it INDEX}} %
387 \setfooter{\thepage}{}{}{}{}{\thepage} %
388 \printindex %
389
390 \end{document}%
391