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