6a72fdace21e5c9dc21af74e2883155b1b396579
[ctsim.git] / doc / ctsim-textui.tex
1 \chapter{The Command Line Interface}\label{ctsimtext}\index{ctsimtext}%
2 \setheader{{\it CHAPTER \thechapter}}{}{}{\ctsimheadtitle}{}{{\it CHAPTER \thechapter}}%
3 \ctsimfooter%
4
5 \ctsimtext\ is a master shell for all of the command-line utilities. The
6 command-line utilities can perform most of the functions of the graphical
7 shell. These command-line utilities are especially appropriate for use on
8 systems without graphics, batch files, and parallel processing in a Beowulf
9 computer cluster.
10
11 \usage \ctsimtext\ can be invoked via three different
12 methods.
13 \begin{enumerate}\itemsep=3pt
14 \item \ctsimtext\ can executed without any parameters. In that case,
15 \ctsimtext\ offers a command-line to enter the function-names and
16 their parameters. The output of the command is displayed. Further
17 commands may be given to \ctsimtext. The shell is exited by the
18 \texttt{quit} command. \ctsimtext\ uses the
19 \urlref{readline}{http://www.gnu.org} library on UNIX and Linux platforms
20 to provide for command history processing.
21
22 \item \ctsimtext\ can also be called to
23 execute a single command. This is especially useful for batch
24 files containing multiple \ctsimtext\ commands. This is invoked by
25 calling\\ \texttt{ctsimtext function-name parameters...}.
26
27 \item Using operating systems that support soft or hard linking of
28 files (such as UNIX and Linux), the executable file \ctsimtext\ can
29 be linked to the function names. This is automatically done by
30 the installation file for Linux. Thus, to use \ctsimtext\ with the
31 function name \texttt{pjrec}, the below command can be executed:\\
32 \texttt{pjrec parameters...} \\
33 as a shortcut rather than the equivalent command \\
34 \texttt{ctsimtext pjrec parameters...}
35
36 \end{enumerate}
37
38 \section{Parallel Processing}
39 \ctsimtext\ can be used to spread it's processing over a cluster. Specifically,
40 \ctsimtext\ supports the \urlref{LAM}{http://www.mpi.nd.edu/lam} version of
41 the MPI environment. On platforms with LAM installed, a parallel version of
42 \ctsimtext\ is created. The name of this program is \texttt{ctsimtext-lam}.
43 The functions that take advantage of the parallel processing are
44 \texttt{phm2if}, \texttt{phm2pj}, \texttt{pjrec}.
45
46 This parallel processing version has been tested with excellent results on
47 a 16-CPU \urlref{Beowulf}{http://www.beowulf.org} cluster.
48
49
50 \section{if1}\label{if1}\index{if1}%
51 Performs math functions on a single image.
52
53 \usage
54 \begin{itemize}\itemsep=0pt
55   \item \doublehyphen{invert}
56   \item \doublehyphen{log}
57   \item \doublehyphen{exp}
58   \item \doublehyphen{sqr}
59   \item \doublehyphen{sqrt}
60 \end{itemize}
61
62 \section{if2}\label{if2}\index{if2}%
63 Performs math functions on a two images.
64
65 \usage
66 \begin{itemize}\itemsep=0pt
67   \item \doublehyphen{add}
68   \item \doublehyphen{sub}
69   \item \doublehyphen{mul}
70   \item \doublehyphen{comp}
71   \item \doublehyphen{column-plot}
72   \item \doublehyphen{row-plot}
73 \end{itemize}
74
75 \section{ifexport}\label{ifexport}\index{ifexport}%
76 Export an image file to a standard graphics file.
77
78 \usage
79 \begin{itemize}\itemsep=0pt
80   \item \doublehyphen{format}
81   \begin{itemize}\itemsep=0pt
82     \item \texttt{gm}
83     \item \texttt{pgmasc}
84     \item \texttt{png}
85     \item \texttt{png16}
86   \end{itemize}
87   \item \doublehyphen{center}
88   \begin{itemize}\itemsep=0pt
89     \item \texttt{median}
90     \item \texttt{mode}
91     \item \texttt{mean}
92   \end{itemize}
93   \item \doublehyphen{auto}
94   \begin{itemize}\itemsep=0pt
95      \item \texttt{full}
96      \item \texttt{std0.1}
97      \item \texttt{std0.5}
98      \item \texttt{std1}
99      \item \texttt{std2}
100      \item \texttt{std3}
101   \end{itemize}
102   \item \doublehyphen{scale}
103   \item \doublehyphen{min}
104   \item \doublehyphen{max}
105 \end{itemize}
106
107 \section{ifinfo}\label{ifinfo}\index{ifinfo}%
108
109 Displays information about an imagefile.
110
111 \usage
112 \begin{itemize}\itemsep=0pt
113   \item \doublehyphen{labels}
114   \item \doublehyphen{no-labels}
115   \item \doublehyphen{stats}
116   \item \doublehyphen{no-stats}
117   \item \doublehyphen{help}
118 \end{itemize}
119
120 \section{phm2pj}\label{phm2pj}\index{phm2pj}%
121 Simulates collection of X-rays data (projections) around a phantom object.
122
123 \usage
124 \texttt{phm2pj projection-file-name number-of-detectors number-of-views [options...]}
125
126 \begin{twocollist}
127 \twocolitem{\doublehyphen{phantom}}{Select a standard phantom.
128 \begin{itemize}\itemsep=0pt
129 \item \texttt{herman}
130 \item \texttt{shepp-logan}
131 \item \texttt{unit-pulse}
132 \end{itemize}
133 }
134 \twocolitem{\doublehyphen{phmfile}}{Load a phantom definition definition}
135
136 \twocolitem{\doublehyphen{geometry}}{
137   \begin{itemize}\itemsep=0pt
138     \item \texttt{parallel}
139     \item \texttt{equiangular}
140     \item \texttt{equilinear}
141   \end{itemize}
142 }
143
144 \twocolitem{\doublehyphen{nray}}{ Number of samples per each detector}
145
146 \twocolitem{\doublehyphen{rotangle}}{Sets the rotation amount as a multiple of pi.
147 For parallel geometries use a rotation angle of \texttt{1} and for equilinear and equiangular
148 geometries use a rotation angle of \texttt{2}. The default is to use to
149 appropriate rotation angle based on the geometry.}
150
151 \twocolitem{\doublehyphen{view-ratio}}{Sets the field of view as a ratio of the diameter of the phantom.
152     For normal scanning, a default value of \texttt{1.0} is optimal.}
153
154 \twocolitem{\doublehyphen{scan-ratio}}{Sets the length of scanning as a ratio of the view diameter.
155     For normal scanning, a value of \texttt{1.0} is optimal.}
156
157 \twocolitem{\doublehyphen{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.
158     For parallel geometries, a value of \texttt{1.0} is optimal. For other
159     geometries, this should be at least \texttt{2.0} to avoid artifacts.}
160 \end{twocollist}
161
162
163 \section{phm2if}\label{phm2if}\index{phm2if}%
164 Converts a geometric phantom object into an imagefile. The size of the
165 imagefile in pixels must be specified as well as the number of samples
166 to average per pixel.
167
168 \usage
169 \begin{twocollist}
170   \twocolitem{\doublehyphen{nsamples}}{Number of samples in x \& y directions per pixel}
171   \twocolitem{\doublehyphen{view-ratio}}{Sets the view ration. For normal scanning,
172   the default value of \texttt{1.0} is optimal.}
173 \end{twocollist}
174
175 \section{pj2if}\label{pj2if}\index{pj2if}%
176 Convert a projection file into an imagefile.
177
178 \usage
179 \texttt{pj2if projection-file-name image-file-name x-size ysize [options...]}
180
181 \begin{twocollist}
182 \twocolitem{\doublehyphen{help}}{Print brief online help}
183 \end{twocollist}
184
185 \section{pjinfo}\label{pjinfo}\index{pjinfo}%
186 Displays information about a projection file.
187
188 \usage
189 \begin{itemize}\itemsep=0pt
190   \item \doublehyphen{binaryheader}
191   \item \doublehyphen{binaryview}
192   \item \doublehyphen{startview}
193   \item \doublehyphen{endview}
194   \item \doublehyphen{dump}
195 \end{itemize}
196
197 \section{pjrec}\label{pjrec}\index{pjrec}%
198 Reconstructs the interior of an object from a projection file.
199
200 \begin{twocollist}
201 \twocolitemruled{\textbf{Parameter}}{\textbf{Options}}
202 \twocolitem{\doublehyphen{filter}}{Selects which filter to apply to
203 each projection. To properly reconstruct an image, this filter
204 should be multiplied by the absolute value of distance from zero
205 frequency.
206 \begin{itemize}\itemsep=0pt
207 \item \texttt{abs\_bandlimit}
208 \item \texttt{abs\_cosine}
209 \item \texttt{abs\_hamming}
210 \end{itemize}
211 } \twocolitem{\doublehyphen{filter-parameter}}{Sets the alpha level
212 for Hamming window. At setting of \texttt{0.54}, this equals
213 the Hanning window.}
214
215 \twocolitem{\doublehyphen{filter-method}}{Selects the filtering
216 method. For large numbers of detectors, \texttt{rfftw} is optimal.
217 For smaller numbers of detectors, \texttt{convolution} might be a
218 bit faster.
219 \begin{itemize}\itemsep=0pt
220 \item \texttt{convolution}
221 \item \texttt{fourier}
222 \item \texttt{fourier-table}
223 \item \texttt{fftw}
224 \item \texttt{rfftw}
225 \item fftw
226 \item rfftw
227 \end{itemize}
228 }
229
230 \twocolitem{\doublehyphen{filter-generation}}{Selects the filter
231 generation. With convolution, \texttt{direct} is the proper method
232 to select. With any of the frequency methods,
233 \texttt{inverse-fourier} is the best method.
234 \begin{itemize}\itemsep=0pt
235 \item direct
236 \item inverse-fourier
237 \end{itemize}
238 }
239
240 \twocolitem{\doublehyphen{interpolation}}{Interpolation technique.
241 \texttt{linear} is optimal.
242 \begin{itemize}\itemsep=0pt
243 \item nearest
244 \item linear
245 \item cubic
246 \end{itemize}
247 }
248
249 \twocolitem{\doublehyphen{backprojection}}{Selects the
250 backprojection technique. A setting of \texttt{idiff} is optimal.
251 \begin{itemize}\itemsep=0pt
252 \item trig
253 \item table
254 \item diff
255 \item idiff
256 \end{itemize}
257 }
258
259 \twocolitem{\doublehyphen{zeropad}}{Zeropad factor. A setting of
260 \texttt{1} is optimal.}
261
262 \end{twocollist}