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