r548: 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 interface}
7 \ctsim\ is the graphical shell for the CTSim project. This shell uses
8 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 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\cite{HERMAN80} and
25 Shepp-Logan\cite{SHEPP74} phantoms are built-in to \ctsim. Phantom files can be
26 read from and written to 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-valued 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 stored. 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 recording 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 from and written to the disk. They are stored as ASCII
54 files for easy cross-platform support and editing.
55
56 \section{Global Menu Commands}
57 These global commands are present on the menus of all windows.
58
59 \subsection{File - Create Phantom}\label{IDH_DLG_PHANTOM}\index{Dialog!Create phantom}
60 This command brings up a dialog box showing the phantoms that are pre-programmed
61 into \ctsim. After selecting one of these phantoms, the new window with that
62 phantom will be generated. The pre-programmed 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}\label{IDH_DLG_FILTER}\index{Dialog!Create filter}
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
78 \begin{twocollist}
79 \twocolitem{\textbf{Filter}}{Selects the filter to generate. The available filters are:
80
81 \begin{itemize}\itemsep=0pt
82 \item $|w|$ Bandlimit
83 \item $|w|$ Hamming
84 \item $|w|$ Hanning
85 \item $|w|$ Cosine
86 \item $|w|$ Sinc
87 \item Shepp
88 \item Bandlimit
89 \item Sinc
90 \item Hamming
91 \item Hanning
92 \item Cosine
93 \item Triangle
94 \end{itemize}
95 }
96 \twocolitem{\textbf{Domain}}{Selects either the \texttt{Frequency} or \texttt{Spatial} domains. The filters have the
97 frequency domain as their natural domain.}
98 \twocolitem{\textbf{X Size}}{Number of columns in the output image.}
99 \twocolitem{\textbf{Y Size}}{Number of rows in the output image.}
100 \twocolitem{\textbf{Hamming Parameter}}{ This parameter adjusts the smoothing of the Hamming
101 filter and can range from \texttt{0} to \texttt{1}.
102 At a setting of \texttt{1}, the Hamming filter is the same as the bandlimit filter.
103 At a setting of \texttt{0.54}, the Hamming filter is the same as the Hanning
104 window.}
105 \twocolitem{\textbf{Bandwidth}}{Sets the bandwidth of the filter.}
106 \end{twocollist}
107 \begin{twocollist}
108 \twocolitem{\textbf{Axis (input) Scale}}{Sets the scale for the filter input. By default, the input to the filter is
109 the distance in pixels from the center of the image. By changing this value, one can set a scale the input to the filter.
110 For example, if the output image is \texttt{101} by \texttt{101} pixels and thus the center of the image is at \texttt{(50,50)}, then a pixel
111 lying at point \texttt{100,50} would be 50 units from the center of the filter. By applying an \texttt{Axis scale} of
112 \texttt{0.1}, then that point would be scaled to 5 units from the center of the filter.}
113 \twocolitem{\textbf{Filter (output) Scale}}{Multiplies the output of the filter by this amount. By default, the filter has a maximum
114 value of \texttt{1}.}
115 \end{twocollist}
116
117 \subsection{File - Preferences}\label{IDH_DLG_PREFERENCES}\index{Dialog!Preferences}
118 This command displays a dialog box that allows users to control
119 the behavior of \ctsim. These options are saved across \ctsim\ sessions.
120 Under Microsoft Windows environments, they are stored in the registry.
121 On UNIX and Linux environments, they are stored in the user's home
122 directory with the filename of \texttt{.ctsim}.
123
124 \begin{twocollist}
125 \twocolitem{\textbf{Advanced options}}{By default, this is turned off in new installations.
126 These advanced options are not required for normal simulations. When \texttt{Advanced
127 Options} is set, \ctsim\ will display more options during scanning of phantoms and
128 the reconstruction of projections.}
129
130 \twocolitem{\textbf{Ask before deleting new documents}}{By default, this is turned on in
131 new installations. With this option set, \ctsim\ will ask before closing
132 documents that have been modified or never saved on disk. By turning off
133 this option, \ctsim\ will never ask if you want to save a file -- you'll
134 be responsible for saving any files that you create.}
135
136 \end{twocollist}
137
138 \subsection{File - Open}
139 This command opens a file section dialog box. Of special consideration
140 is the \texttt{File Type} combo box on the bottom of the dialog. You need
141 to set the this combo box to the type of file that you wish to open.
142
143 \subsection{File - Save}
144 This command saves the contents of the active window. If the window hasn't
145 been named, a dialog box will open asking for the file name to use.
146
147 \subsection{File - Close}
148 As one would expect, this closes the active window.
149
150 \subsection{File - Save As}
151 Allows the saving of the contents of a window to any filename.
152
153 \subsection{Help - Contents}
154 This command displays the online help.
155
156 \subsection{Help - About}
157 This command shows the version number and operating environment of \ctsim.
158
159
160 \section{Phantom Menus}
161
162 \subsection{Properties}
163 Displays the properties of a phantom which includes:
164
165 \begin{itemize}\itemsep=0pt
166 \item Overall dimensions of a phantom
167 \item A list of all component phantom elements
168 \end{itemize}
169
170 \subsection{Process - Rasterize}\label{IDH_DLG_RASTERIZE}\index{Dialog!Rasterize}
171 This creates an image file from a phantom. Technically, it
172 converts the phantom from a vector (infinite resolution) object
173 into a 2-dimension array of floating-point pixels. The parameters
174 to set are:
175
176 \begin{twocollist}
177 \twocolitem{\textbf{X size}}{Number of columns in image file}
178 \twocolitem{\textbf{Y size}}{Number of rows in image file}
179 \twocolitem{\textbf{Samples per pixel}}{Numbers of samples taken
180 per pixel in both the x and y directions. For example, if the
181 \texttt{Samples per pixel} is set to \texttt{3}, then for every
182 pixel in the image file 9 samples \latexonly{($3\times3$)}\latexignore{(3 x 3)}
183 are averaged.}
184 \end{twocollist}
185
186 \subsection{Process - Projections}\label{IDH_DLG_PROJECTIONS}\index{Dialog!Projections}
187 This creates a projection file from a phantom. The options
188 available when collecting projections are:
189
190 \begin{twocollist}
191 \twocolitem{\textbf{Geometry}}{Selects the scanner geometry.
192   \begin{itemize}\itemsep=0pt
193     \item \texttt{Parallel}
194     \item \texttt{Equiangular}
195     \item \texttt{Equilinear}
196   \end{itemize}}
197 \twocolitem{\textbf{Number of detectors}}{Sets the number of
198 detectors in the detector array.}
199
200 \twocolitem{\textbf{Number of views}}{Sets the number of views
201 collected}
202
203 \twocolitem{\textbf{Samples per detector}}{Sets the number of
204 samples collected for each detector}
205
206 \twocolitem{\textbf{View Ratio}}{Sets the field of view as a ratio
207 of the diameter of the phantom.  For normal scanning, use a value of
208 \texttt{1.0}.}
209
210 \twocolitem{\textbf{Scan Ratio}}{Sets the length of scanning as a
211 ratio of the view diameter. For normal scanning, use a value of \texttt{1.0}.}
212
213 \twocolitem{\textbf{Focal length ratio}}{Sets the distance between the
214 radiation source and the center of the phantom as a
215 ratio of the radius of the phantom. For parallel geometries, a value
216 of \texttt{1.0} is optimal. For other
217 geometries, this should be at least \texttt{2.0} to avoid artifacts.}
218 \end{twocollist}
219
220 \textbf{Advanced Options}
221
222 These options are only visible if \emph{Advanced Options} has been
223 selected in the \texttt{File - Preferences} dialog. These parameters
224 default to optimal settings and don't need to be adjusted except
225 by expert users.
226
227 \begin{twocollist}
228 \twocolitem{\textbf{Rotation Angle}}{Sets the rotation amount as a
229 multiple of \latexonly{$\pi$.}\latexignore{pi.} For parallel geometries use a rotation angle of \texttt{1}
230 and for equilinear and equiangular geometries use a rotation angle
231 of \texttt{2}. Using any other rotation angle will lead to artifacts.}
232 \end{twocollist}
233
234
235
236 \section{Image Menus}
237 \subsection{File - Properties}
238 Properties of image files include
239 \begin{itemize}\itemsep=0pt
240   \item Whether the image is real or complex-valued.
241   \item Numeric statistics (minimum, maximum, mean, median, mode, and standard deviation).
242   \item History labels (text descriptions of the processing for this image).
243 \end{itemize}
244
245 \subsection{File - Export}\label{IDH_DLG_EXPORT}\index{Image!Export}
246 This command allows for exporting image files to a standard
247 graphics file format. This is helpful when you want to take an
248 image and import it into another application. The current
249 \helprefn{intensity scale}{intensityscale} is used when exporting
250 the file. The supported graphic formats are:
251
252 \begin{twocollist}
253 \twocolitem{\textbf{PNG}}{Portable Network Graphics format. This uses 8-bits or
254 256 shades of gray.}
255 \twocolitem{\textbf{PNG-16}}{This is a 16-bit version of PNG which allows for
256 65536 shades of gray.}
257 \twocolitem{\textbf{PGM}}{Portable Graymap format. This is a common format used on
258 UNIX systems.}
259 \twocolitem{\textbf{PGM ASCII}}{ASCII version of PGM.}
260 \end{twocollist}
261
262
263 \subsection{View}\label{intensityscale}\index{Intensity scale}
264 These commands are used change the intensity scale for viewing the image.
265 These commands do not change the image data. When the minimum value is
266 set, then the color pure black is assigned to that image value. Similarly,
267 when the maximum value is set, the the color pure white is assigned to that
268 image value.
269
270 Changing the intensity scale is useful when examining different image features.
271 In clinical medicine, the intensity scale is often changed to examine bone
272 (high value) versus soft-tissue (medium value) features.
273
274 \subsubsection{Set}\label{IDH_DLG_MINMAX}
275 This command displays a dialog box that allows you to set the lower
276 and upper values to display.
277
278 \subsubsection{Auto}\label{IDH_DLG_AUTOSCALE}
279 This command displays a dialog box that allows \ctsim\ to automatically
280 make an intensity scale. The parameters that \ctsim\ needs to make this
281 automatic scale are:
282
283 \begin{twocollist}
284 \twocolitem{\textbf{Center}}{This sets the center of the intensity scale. Currently,
285 \ctsim\ allows you to use either the mean, mode, or median of the image
286 as the center of the intensity scale.}
287
288 \twocolitem{\textbf{Width}}{This sets the half-width of the intensity scale. The width
289 is specified as a ratio of the standard deviation.}
290 \end{twocollist}
291
292 As an example, if \texttt{median} is selected as the center and
293 \texttt{0.5} is selected as the width, the the minimum value will
294 be \latexonly{$median - 0.5 \times standardDeviation$}\latexignore{\emph{median - 0.5 x standardDeviation}}
295 and the maximum value will be \latexonly{$median + 0.5 \times standardDeviation$.}\latexignore{\emph{
296 median + 0.5 x standardDeviation}.}
297
298 \subsubsection{Full}
299 This command resets the intensity scale to the full scale of the image.
300
301 \subsection{Image}
302 These commands create a new image based upon the current image,
303 and for some commands, also upon a comparison image.
304
305 \subsubsection{Add, Subtract, Multiply, Divide}
306 These are simple arithmetic operations. \ctsim\ will display a dialog
307 box showing all of the currently opened image files that are the
308 same size as the active image. After the selection of a compatible image,
309 \ctsim\ will perform the arithmetic operation on the two images and
310 make a new result image.
311
312 \subsubsection{Image Size}
313 This command will generate a new image based on the current image. The new
314 image can be scaled to any size. A dialog
315 appears asking for the size of the new image. Bilinear interpolation
316 is used when calculating the new image.
317
318 \subsubsection{3-D Conversion}
319 This command generates a 3-dimensional view of the current phantom. This view can be
320 rotated in three dimensions. The left and right arrow control the z-axis
321 rotation and the up and down arrows control the x-axis rotation. The y-axis
322 rotation is controlled by the \texttt{T} and \texttt{Y} keys. Other options
323 are presented on the \texttt{View} menu and include:
324
325 \begin{itemize}\itemsep=0pt
326 \item Surface plot versus wireframe plot.
327 \item Smooth shading versus flat shading.
328 \item Lighting on or off.
329 \item Color scale on or off.
330 \end{itemize}
331
332 \subsection{Filter}\index{Image!Filter}
333 These commands filter and modify the image
334
335 \subsubsection{Arithmetic}
336 These commands operate on the image on a pixel-by-pixel basis. The commands
337 support both real and complex-valued images. The available arithmetic commards are:
338
339 \begin{twocollist}
340   \twocolitem{\textbf{Invert}}{Negate pixel values.}
341   \twocolitem{\textbf{Log}}{Take natural logrithm of pixel values.}
342   \twocolitem{\textbf{Exp}}{Take natural exponent of pixel values.}
343   \twocolitem{\textbf{Square}}{Take square of pixel values.}
344   \twocolitem{\textbf{Square root}}{Take square root of pixel values.}
345 \end{twocollist}
346
347
348 \subsubsection{Frequency Based}
349 This commands allow the Fourier and inverse Fourier transformations of
350 images. By default, the transformations will automatically convert
351 images between Fourier to natural orders as expected. For example, \texttt{2-D FFT}
352 will transform the points into natural order after the Fourier transform.
353 Similarly the inverse, \texttt{2-D IFFT}, will reorder the points from
354 natural order to Fourier order before applying the inverse Fourier transformation.
355
356 As you would expect, images that undergo frequency filtering will be complex-valued
357 after than filtering. Normally, only the real component is shown by \ctsim. However, \ctsim\ does
358 have options for converting a complex-valued image into a real-valued image via
359 the \texttt{Magnitude} and \texttt{Phase} filtering commands.
360
361 The available frequency-based filtering commards are:
362
363 \begin{itemize}\itemsep=0pt
364 \item 2D FFT
365 \item 2D IFFT
366 \item FFT Rows
367 \item IFFT Rows
368 \item FFT Columns
369 \item IFFT Columns
370 \item 2D Fourier
371 \item 2D Inverse Fourier
372 \item Shuffle Fourier to Natural Order
373 \item Shuffle Natural to Fourier Order
374 \item Magnitude
375 \item Phase
376 \end{itemize}
377
378 \subsection{Analyze}
379 These commands are used for analyzing an image.
380
381 \subsubsection{Plotting}
382 The commands plot rows and columns of images. There are also commands
383 that perform FFT and IFFT transformations prior to plotting. To select
384 the row or column to plot or compare, click the mouse button over the
385 desired cursor point.
386
387 The available commands are:
388 \begin{itemize}\itemsep=0pt
389 \item Plot Row
390 \item Plot Column
391 \item Plot Histogram
392 \item Plot FFT Row
393 \item Plot FFT Col
394 \end{itemize}
395
396 \subsubsection{Image Comparison}\label{IDH_DLG_COMPARISON}\index{Image!Comparison}
397 This command performs statistical comparisons between two images. An option
398 also exists for generating a difference image from the two input images.
399
400 There are also commands for comparison plotting of rows and columns from two images.
401 This is quite helpful when comparing a phantom to a reconstruction.
402
403 The three distance measures are:
404
405 \begin{itemize}\itemsep=0pt
406 \item[-] \textbf{$d$}\quad The normalized root mean squared distance measure.
407 \item[-] \textbf{$r$}\quad The normalized mean absolute distance measure.
408 \item[-] \textbf{$e$}\quad The worst case distance measure over a \latexonly{$2\times2$}\latexignore{\emph{2 x 2}} pixel area.
409 \end{itemize}
410
411 The available commands are:
412 \begin{itemize}\itemsep=0pt
413 \item Compare Image
414 \item Compare Row
415 \item Compare Column
416 \end{itemize}
417
418 \section{Projection Menus}
419
420 \subsection{File - Properties}
421 The displayed properties include:
422
423 \begin{itemize}\itemsep=0pt
424 \item Number of detectors in the projections.
425 \item Number of views.
426 \item The parameters used when generating the projections from the phantom.
427 \end{itemize}
428
429 \subsection{Process - Convert Polar}\label{IDH_DLG_POLAR}\index{Polar conversion}
430 This command creates an image file with the polar conversion of the projection data.
431 The parameters to set are:
432
433 \begin{twocollist}
434 \twocolitem{\textbf{X Size}}{Number of columns in output image.}
435 \twocolitem{\textbf{Y Ssize}}{Number of rows in output image.}
436 \twocolitem{\textbf{Interpolation}}{Selects the interpolation method.
437 Currently, the \texttt{bilinear} option provides the highest
438 quality interpolation.}
439 \end{twocollist}
440
441 \subsection{Process - Convert FFT Polar}
442 The parameters for this option are the same as the \helprefn{Convert
443 Polar Dialog}{convertpolardialog}. For this command, though, the
444 projections are Fourier transformed prior to conversion to polar
445 image.
446
447 \subsection{Reconstruct - Filtered Backprojection}\label{IDH_DLG_RECONSTRUCTION}\index{Dialog!Reconstruction}
448 This command displays a dialog to set the parameters for reconstructing an image from projections
449 using the filtered backprojection technique. The parameters available are:
450
451 \begin{twocollist}
452 \twocolitem{\textbf{Filter}}{Selects the filter to apply to each
453 projection. To properly reconstruct an image, this filter should
454 consist of the the absolute value of distance from zero
455 frequency optionally multiplied by a smoothing filter. The optimal
456 filters to use are:
457 \begin{itemize}\itemsep=0pt
458 \item \texttt{abs\_bandlimit}
459 \item \texttt{abs\_hamming}
460 \item \texttt{abs\_hanning}
461 \item \texttt{abs\_cosine}
462 \end{itemize}
463 } \twocolitem{\textbf{Hamming parameter}}{Sets the alpha level for
464 Hamming window. This parameter adjusts the smoothing of the Hamming
465 filter and can range from \texttt{0} to \texttt{1}.
466 At a setting of \texttt{1}, the Hamming filter is the same as the bandlimit filter.
467 At a setting of \texttt{0.54}, the Hamming filter is the same as the Hanning
468 window.}
469 \twocolitem{\textbf{Filter Method}}{Selects the filtering method.
470 For large numbers of detectors, the FFT-based filters are preferred whereas for
471 smaller numbers of detectors \texttt{convolution} can be
472 faster. When \emph{Advanced Options} have been turned off, this menu only shows
473 the two basic choices: \texttt{convolution} and \texttt{FFT}. However, when
474 \emph{Advanced Options} have been turned on, additional selections are available as
475 discussed in the next section.
476 }
477 \twocolitem{\textbf{Interpolation}}{Interpolation technique during backprojection.
478 \texttt{cubic} has optimal quality when the
479 data is smooth. Smooth data is obtained by taking many projections and/or
480 using a smoothing filter. In the absence of smooth data, \texttt{linear} gives better results and
481 is also many times faster than cubic interpolation.
482
483 \begin{itemize}\itemsep=0pt
484 \item \texttt{nearest} - No interpolation, selects nearest point
485 \item \texttt{linear} - Uses fast straight line interpolation
486 \item \texttt{cubic} - Uses cubic interpolating polynomial
487 \end{itemize}
488 }
489 \end{twocollist}
490
491 \textbf{Advanced Options}
492
493 These options are only visible if \emph{Advanced Options} has been
494 selected in the \texttt{File - Preferences} dialog. These parameters
495 default to optimal settings and don't need to be adjusted except
496 by expert users.
497
498 \begin{twocollist}
499 \twocolitem{\textbf{Filter Method}}{Selects the filtering method.
500 The general comments about this parameter given the previous section still apply.
501 With \emph{Advanced Options} on, the full set of filter methods are available:
502 \begin{itemize}\itemsep=0pt
503 \item \texttt{convolution}
504 \item \texttt{fourier} - Uses simple Fourier transform.
505 \item \texttt{fourier-table} - Optimizes Fourier transform by precalculating trigometric functions.
506 \item \texttt{fftw} - Uses complex-valued Fourier transform with the \emph{fftw} library.
507 \item \texttt{rfftw} - Uses optimized real/half-complex Fourier transform.
508 \end{itemize}
509 }
510 \twocolitem{\textbf{Backprojection}}{Selects the backprojection
511 technique. A setting of \texttt{idiff} is optimal.
512 \begin{itemize}\itemsep=0pt
513 \item \texttt{trig} - Use trigometric functions at each image point.
514 \item \texttt{table} - Use precalculated trigometric tables.
515 \item \texttt{diff} - Use difference method to iterate within image.
516 \item \texttt{idiff} - Use integer iteration techique.
517 \end{itemize}
518 }
519
520 \twocolitem{\textbf{Filter Generation}}{Selects the filter
521 generation. With convolution, \texttt{direct} is the proper method
522 to select. With any of the frequency methods,
523 \texttt{inverse-fourier} is the best method.
524 \begin{itemize}\itemsep=0pt
525 \item \texttt{direct}
526 \item \texttt{inverse-fourier}
527 \end{itemize}
528 }
529
530 \twocolitem{\textbf{Zeropad}}{Zeropad factor when using
531 frequency-based filtering. A setting of \texttt{1} is optimal whereas
532 a setting of \texttt{0} disables zero padding. Settings greater than \texttt{1}
533 perform larger amounts of zero padding but without any significant benefit.}
534
535 \end{twocollist}
536
537 \section{Plot Menus}
538 \subsection{File - Properties}
539 The displayed properties include:
540
541 \begin{itemize}\itemsep=0pt
542 \item the number of curves in the plot and the number of points per curve.
543 \item the EZPlot commands used to format the plot are displayed.
544 \item history labels from the originating image(s) and the plot function.
545 \end{itemize}
546
547 \subsection{View Menu}
548 These commands set the scaling for the y-axis. They are analogous
549 to the options used for setting the intensity scale for images.
550
551 \subsubsection{Set}
552 This command sets the upper and lower limits for the y-axis.
553
554 \subsubsection{Auto}
555 This command automatically sets the upper and lower limits for the
556 y-axis. Please refer to the \texttt{View - Auto} documentation for
557 image files for the details.
558
559 \subsubsection{Full}
560 The command resets the upper and lower limits of the y-axis to the
561 minimum and maximum values of the curves.