e76f4457169c4fa1642e8dd033378ae175f6bb24
[ctsim.git] / doc / ctsim-gui.tex
1 \chapter{The Graphical User Interface}\label{ctsim}\index{ctsim}%
2 \setheader{{\it CHAPTER \thechapter}}{}{}{\ctsimheadtitle}{}{{\it CHAPTER \thechapter}}%
3 \ctsimfooter%
4
5
6 \section{Overview}\index{Graphical shell}
7 \ctsim\ is the graphical shell for the CTSim project. It utilizes
8 using the \urlref{wxWindows}{http://www.wxwindows.org} library for
9 cross-platform compatibility. The graphical shell is compatible
10 with Microsoft Windows, \urlref{GTK}{http://www.gtk.org}, and
11 \urlref{Motif}{http://www.openmotif.org} graphical environments.
12
13 \usage \texttt{ctsim [files to open...]}
14
15 You can invoke \ctsim\ by itself on the command line, or include
16 on the command-line any number of files that you want \ctsim\ to
17 automatically open. \ctsim\ can open projection files, image
18 files, phantom files, and plot files.
19
20
21 \section{File Types}\index{File types}
22
23 \subsection{Phantom}
24 Besides loading phantom files from the disk, the Herman and
25 Shepp-Logan phantoms are built-in to \ctsim. Phantom files can be
26 read and stored on the disk. Phantom files are stored in a simple
27 ASCII format. A text editor is required to
28 create and edit these files.
29
30 \subsection{Image}
31 Image files are 2-dimensional files that store 4-byte floating
32 point values. Images files can be either real or complex valued.
33 Typically, all images are real except for images that have been
34 processed by Fourier transforms. As you might expect,
35 complex-valued images are twice the size of real-valued images
36 since both a real and imaginary component need to be store.
37
38 Images files can also store any number of text labels. \ctsim\ uses
39 these labels for storing history information regarding
40 the creation and modifications of images.
41
42 When complex-valued images are viewed on the screen, only the real
43 component is displayed.
44
45 \subsection{Projection}
46 Projection files are created from Phantom files during the
47 projection process. Numerous options are available for the
48 creation of the these files. The files are stored in a binary
49 format with cross-platform compatibility on little and big endian
50 architectures.
51
52 \subsection{Plot}
53 Plot files are created by \ctsim\ during analysis of image files.
54 They can be read and stored on the disk. They are stored as ASCII
55 files for easy cross-platform support.
56
57 \section{Global Menu Commands}
58 These commands are present on the menus of all windows.
59
60 \subsection{File - Create Phantom}\index{Create phantom dialog}
61 This command brings up a dialog box showing the phantoms that are preprogrammed
62 into \ctsim. After selecting one of these phantoms, the new window with that
63 phantom will be generated. The preprogrammed phantoms are:
64
65 \begin{twocollist}
66 \twocolitem{\textbf{Herman}}{The Herman head phantom\cite{HERMAN80}}
67 \twocolitem{\textbf{Shepp-Logan}}{The head phantom of Shepp \& Logan\cite{SHEPP74}}
68 \twocolitem{\textbf{Unit pulse}}{A phantom that has a value of \texttt{1} for the
69 center of the phantom and \texttt{0} everywhere else.}
70 \end{twocollist}
71
72 \subsection{File - Create Filter}\index{Create filter dialog}
73 This command brings up a dialog box showing the pre-programmed filters
74 of \ctsim. This command will create a 2-dimensional image of the selected filter.
75 The center of the filter is at the center of the image.
76
77 These filters can be created in their natural frequency domain or in their spatial domain.
78 \begin{twocollist}
79 \twocolitem{\textbf{Filter}}{Selects the filter to generate.}
80 \twocolitem{\textbf{Domain}}{Selects either the \texttt{Frequency} or \texttt{Spatial} domains. The filters have the
81 frequency domain as their natural domain.}
82 \twocolitem{\textbf{X Size}}{Number of columns in the output image.}
83 \twocolitem{\textbf{Y Size}}{Number of rows in the output image.}
84 \twocolitem{\textbf{Hamming Parameter}}{Sets the parameter for the Hamming filter.}
85 \twocolitem{\textbf{Bandwidth}}{Sets the bandwidth of the filter.}
86 \twocolitem{\textbf{Axis (input) Scale}}{Sets the scale for the filter input. By default, the input to the filter is
87 the distance in pixels from the center of the image. By changing this value, one can set a scale the input to the filter.}
88 \twocolitem{\textbf{Filter (output) Scale)}}{Multiplies the output of the filter by this amount. By default, the filter has a maximum
89 value of \texttt{1}.}
90 \end{twocollist}
91
92 \subsection{File - Preferences}\index{Preferences}
93 This command displays a dialog box that allows users to control
94 the behavior of \ctsim. These options are saved across \ctsim\ sessions.
95 Under Microsoft Windows environments, they are stored in the registry.
96 On UNIX and Linux environments, they are stored in the users home
97 directory with the filename of \texttt{.ctsim}.
98
99 \begin{twocollist}
100 \twocolitem{\textbf{Advanced options}}{By default, this is turned off in new installations.
101 These advanced options are required for normal simulations. When \texttt{Advanced
102 Options} is set, \ctsim\ will display more options during scanning of programs and
103 the reconstruction of projections.}
104
105 \twocolitem{\textbf{Ask before deleting new documents}}{By default, this is turned on in
106 new installations. With this option set, \ctsim\ will ask before closing
107 documents that have been modified or never saved on disk. By turning off
108 this option, \ctsim\ will never ask if you want to save a file -- you'll
109 be responsible for saving any files that you create.}
110
111 \end{twocollist}
112
113 \subsection{File - Open}
114 This command opens a file section dialog box. Of special consideration
115 is the \texttt{File Type} combo box on the bottom of the dialog. You need
116 to select that to the type of file that you wish to open.
117
118 \subsection{File - Save}
119 This command saves the contents of the active window. If the window hasn't
120 been named, a dialog box will open asking for the file name to use.
121
122 \subsection{File - Close}
123 As one would expect, this closes the active window.
124
125 \subsection{File - Save As}
126 Allows the saving of the contents of a window to any filename.
127
128 \subsection{Help - Contents}
129 This command displays the online help.
130
131 \subsection{Help - About}
132 This command shows the version number of \ctsim.
133
134
135 \section{Phantom Menus}
136
137 \subsection{Properties}
138 Displays the properties of a phantom which includes:
139
140 \begin{itemize}\itemsep=0pt
141 \item Overall dimensions of a phantom
142 \item A list of all component phantom elements
143 \end{itemize}
144
145 \subsection{Rasterize Dialog}\index{Rasterize}
146 This creates an image file from a phantom. Technically, it
147 converts the phantom from a vector (infinite resolution) object
148 into a 2-dimension array of floating-point pixels. The parameters
149 to set are:
150
151 \begin{twocollist}
152 \twocolitemruled{\textbf{Parameter}}{\textbf{Options}}
153 \twocolitem{\textbf{X size}}{Number of columns in image file}
154 \twocolitem{\textbf{Y size}}{Number of rows in image file}
155 \twocolitem{\textbf{Samples per pixel}}{Numbers of samples taken
156 per pixel in both the x and y directions. For example, if the
157 \texttt{Samples per pixel} is set to \texttt{3}, then for every
158 pixel in the image file 9 samples ($3\times3$) are averaged.}
159 \end{twocollist}
160
161 \subsection{Projection Dialog}\index{Projection collection}
162 This creates a projection file from a phantom. The options
163 available when collecting projections are:
164
165 \begin{twocollist}
166 \twocolitem{\textbf{Geometry}}{Selects the scanner geometry.
167   \begin{itemize}\itemsep=0pt
168     \item \texttt{Parallel}
169     \item \texttt{Equiangular}
170     \item \texttt{Equilinear}
171   \end{itemize}}
172 \twocolitem{\textbf{Number of detectors}}{Sets the number of
173 detectors in the detector array.}
174
175 \twocolitem{\textbf{Number of views}}{Sets the number of views
176 collected}
177
178 \twocolitem{\textbf{Samples per detector}}{Sets the number of
179 samples collected for each detector}
180
181 \twocolitem{\textbf{View Ratio}}{Sets the field of view as a ratio
182 of the diameter of the phantom.  For normal scanning, use a value of
183 \texttt{1.0}.}
184
185 \twocolitem{\textbf{Scan Ratio}}{Sets the length of scanning as a
186 ratio of the view diameter. For normal scanning, use a value of \texttt{1.0}.}
187
188 \twocolitem{\textbf{Focal length ratio}}{Sets the distance of the
189 radiation source and detectors from the center of the object as a
190 ratio of the radius of the object.
191
192 For parallel geometries, use a value of \texttt{1.0}. For other
193 geometries, this should be at least \texttt{2.0} to avoid artifacts.}
194 \end{twocollist}
195
196 \subsection{Advanced Options}
197 \begin{twocollist}
198 \twocolitem{\textbf{Rotation Angle}}{Sets the rotation amount as a
199 multiple of pi. For parallel geometries use a rotation angle of \texttt{1}
200 and for equilinear and equiangular geometries use a rotation angle
201 of \texttt{2}. Using any other rotation angle will lead to artifacts.}
202 \end{twocollist}
203
204
205
206 \section{Image Menus}
207 \subsection{File - Properties}
208 Properties of image files include
209 \begin{itemize}\itemsep=0pt
210   \item Whether the image is real or complex valued
211   \item Numeric statistics
212   \item Image file labels
213 \end{itemize}
214
215 \subsection{File - Export}\index{Image export}
216 This command allows for exporting image files to a standard
217 graphics file format. This is helpful when you want to take an
218 image and import it into another application. The current
219 \helprefn{intensity scale}{intensityscale} is used when exporting
220 the file. The support file formats are:
221
222 \begin{twocollist}
223 \twocolitem{\textbf{PNG}}{Portable Network Graphics format. This uses 8-bits or
224 256 shades of gray.}
225 \twocolitem{\textbf{PNG-16}}{This is a 16-bit version of PNG which allows for
226 65536 shades of gray.}
227 \twocolitem{\textbf{PGM}}{Portable Graymap format. This is a common format used on
228 UNIX systems.}
229 \twocolitem{\textbf{PGM}}{ASCII version of PGM.}
230 \end{twocollist}
231
232
233 \subsection{View}\label{intensityscale}
234 These options are for change the intensity scale for viewing the image.
235 They do not change the image data.
236 \subsubsection{Set}
237 This command brings up a dialog box that allows you to set the lower
238 and upper intensities to display.
239
240 \subsubsection{Auto}
241 This command brings up a dialog box that allows \ctsim\ to automatically
242 make an intensity scale. The options that \ctsim\ needs to make this
243 automatic scale are:
244
245 \begin{twocollist}
246 \twocolitem{\textbf{Center}}{This sets the center of the intensity scale. Currently,
247 \ctsim\ allows you to use either the mean, mode, or median of the image
248 as the center of the intensity scale.}
249
250 \twocolitem{\textbf{Width}}{This sets the half-width of the intensity scale. The width
251 is specified as a ratio of the standard deviation.}
252 \end{twocollist}
253
254 As an example, if \texttt{median} is selected as the center and
255 \texttt{0.5} is selected as the width, the the minimum intensity will
256 be \texttt{median - 0.5 x standard deviation} and the maximum will be
257 \texttt{median + 0.5 x standard deviation}.
258
259 \subsubsection{Full}
260 This resets the intensity scale to the full scale of the image.
261
262 \subsection{Image}
263 These commands create a new image based upon the current image,
264 and for some commands, also a comparison image.
265
266 \subsubsection{Add, Subtract, Multiply, Divide}
267 These are simple arithmetic operations. \ctsim\ will display a dialog
268 box showing all of the currently opened image files that are the
269 same size of the active image. After selecting a compatible image,
270 \ctsim\ will perform the arithmetic operation on the two images and
271 make a new result image.
272
273 \subsubsection{Image Size}
274 This command will generate a new window with the current image scaled to
275 any size. Currently, \texttt{bilinear} interpolation provides the best
276 image quality.
277
278 \subsubsection{3-D Conversion}
279 Generates a 3-dimensional view of the current phantom. This view can be
280 rotated in three dimensions. The left and right arrow control the z-axis
281 rotation, the up and down arrows control the x-axis rotation. The y-axis
282 rotation is controlled by the \texttt{T} and \texttt{Y} keys. Other options
283 include:
284
285 \begin{itemize}
286 \item Surface plot
287 \item Smooth shading
288 \item Lighting on or off
289 \item Color scale
290 \end{itemize}
291
292 \subsection{Filter}\index{Image filter}
293 These commands filter and modify the image.
294
295 \subsubsection{Arithmetic}
296 These are simple arithmetic functions that should be self explanatory.
297
298 \subsubsection{Frequency Based}
299 This commands allow the Fourier and inverse Fourier transformations of
300 images. By default, the transformations will automatically convert
301 images from Fourier to natural order as expected. For example, \texttt{2-D FFT}
302 will transform the points into natural order after the Fourier transform.
303 Similarly the inverse, \texttt{2-D IFFT}, will reorder the points from
304 natural order to Fourier order before applying the inverse Fourier transformation.
305
306 As you would expect, images that undergo frequency filtering will be complex-valued
307 images. Normally, only the real component is shown by \ctsim. However, \ctsim\ does
308 have options for converting a complex-valued image into a real-valued image via
309 the \texttt{Magnitude} and \texttt{Phase} filtering commands.
310
311 \subsection{Analyze}
312 These commands are used for analyzing an image.
313
314 \subsubsection{Plotting}
315 The commands plot rows and columns of images. There are also commands
316 that perform FFT and IFFT transformations prior to plotting.
317
318 \subsubsection{Image Comparison}
319 This command performs statistical comparisons between two images. An option
320 also exists for generating a difference image from the two input images.
321
322 There are also commands for plotting rows and columns from two images on
323 a single plot. This is quite helpful when comparing a phantom to a reconstruction.
324
325 \section{Projection Menus}
326
327 \subsection{File - Properties}
328 The displayed properties include:
329
330 \begin{itemize}
331 \item Number of detectors in the projections
332 \item Number of views
333 \item The variables used when generating the projections from the phantom
334 \end{itemize}
335
336 \subsection{Process - Convert Polar Dialog}\label{convertpolardialog}\index{Polar conversion}
337 Creates an image file with the polar conversion of the projection data. The options to set are:
338
339 \begin{twocollist}
340 \twocolitem{\textbf{xsize}}{Number of columns in output image.}
341 \twocolitem{\textbf{ysize}}{Number of rows in output image.}
342 \twocolitem{\textbf{interpolation}}{Selects the interpolation method.
343 Currently, the \texttt{bilinear} option provides the highest
344 quality interpolation.}
345 \end{twocollist}
346
347 \subsection{Process - Convert FFT Polar Dialog}
348 The parameters for this option are the same as \helprefn{Convert
349 Polar Dialog}{convertpolardialog}. For this command, though, the
350 projections are Fourier transformed prior to conversion to polar
351 image.
352
353 \subsection{Reconstruct - Filtered Backprojection Dialog}\index{Reconstruction dialog}
354 This dialog sets the parameters for reconstructing an image from projections
355 using the Filtered Backprojection technique.
356
357
358 \begin{twocollist}
359 \twocolitemruled{\textbf{Parameter}}{\textbf{Options}}
360 \twocolitem{\textbf{Filter}}{Selects which filter to apply to each
361 projection. To properly reconstruct an image, this filter should
362 be multiplied by the absolute value of distance from zero
363 frequency.
364 \begin{itemize}\itemsep=0pt
365 \item \texttt{abs\_bandlimit}
366 \item \texttt{abs\_cosine}
367 \item \texttt{abs\_hamming}
368 \end{itemize}
369 } \twocolitem{\textbf{Hamming parameter}}{Sets the alpha level for
370 Hamming   window. At setting of 0.54, this equals the Hanning
371 window.}
372
373 \twocolitem{\textbf{Filter Method}}{Selects the filtering method.
374 For large numbers of detectors, \texttt{rfftw} is optimal. For
375 smaller numbers of detectors, \texttt{convolution} might be a bit
376 faster.
377 \begin{itemize}\itemsep=0pt
378 \item \texttt{convolution}
379 \item \texttt{fourier}
380 \item \texttt{fourier-table}
381 \item \texttt{fftw}
382 \item \texttt{rfftw}
383 \end{itemize}
384 }
385
386 \twocolitem{\textbf{Interpolation}}{Interpolation technique.
387 \texttt{cubic} is optimal when many projections are taken and the
388 data is smooth. Otherwise, \texttt{linear} gives better results.
389 Linear is also much faster than cubic interpolation.
390
391 \begin{itemize}\itemsep=0pt
392 \item nearest
393 \item linear
394 \item cubic
395 \end{itemize}
396 }
397 \end{twocollist}
398
399 \subsection{Advanced Options}
400
401 These options are only visible if \emph{Advanced Options} has been
402 selected in the \texttt{File/Preferences} dialog. These parameters
403 default to optimal settings and don't need to be adjusted except
404 by expert users.
405
406 \begin{twocollist}
407 \twocolitem{\textbf{Backprojection}}{Selects the backprojection
408 technique. A setting of \texttt{idiff} is optimal.
409 \begin{itemize}\itemsep=0pt
410 \item \texttt{trig} - Uses trigometric functions at each image point
411 \item \texttt{table} - Uses precalculated trigometric tables
412 \item \texttt{diff} - Uses difference method to step along image
413 \item \texttt{idiff} - Uses integer difference method
414 \end{itemize}
415 }
416
417 \twocolitem{\textbf{Filter Generation}}{Selects the filter
418 generation. With convolution, \texttt{direct} is the proper method
419 to select. With any of the frequency methods,
420 \texttt{inverse-fourier} is the best method.
421 \begin{itemize}\itemsep=0pt
422 \item \texttt{direct}
423 \item \texttt{inverse-fourier}
424 \end{itemize}
425 }
426
427 \twocolitem{\textbf{Zeropad}}{Zeropad factor when using
428 frequency-based filtering. A setting of \texttt{1} is optimal.}
429
430 \end{twocollist}
431
432 \section{Plot Menus}
433 \subsection{File - Properties}
434 The displayed properties include the number of curves in the plot
435 and the number of points per curve. Additionally, the EZPlot
436 commands used to format the plot are displayed.
437
438 \subsection{View Menu}
439 These commands set the scaling for the y-axis. They are analogous
440 to the options used for setting the intensity scale for images.
441
442 \subsubsection{Set}
443 This command sets the upper and lower limits for the y-axis.
444
445 \subsubsection{Auto}
446 This command automatically sets the upper and lower limits for the
447 y-axis. Please refer to the \texttt{View - Auto} documentation for
448 image files for the details.
449
450 \subsubsection{Full}
451 The command resets the upper and lower limits of the y-axis to the
452 minimum and maximum values of the curves.