1 \chapter{The Graphical User Interface}\label{ctsim}\index{ctsim}%
2 \setheader{{\it CHAPTER \thechapter}}{}{}{\ctsimheadtitle}{}{{\it CHAPTER \thechapter}}%
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.
13 \usage \texttt{ctsim [files to open...]}
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.
21 \section{File Types}\index{File types}
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.
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.
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.
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
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.
56 \section{Global Menu Commands}
57 These global commands are present on the menus of all windows.
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:
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.}
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.
76 These filters can be created in their natural frequency domain or in their spatial domain.
79 \twocolitem{\textbf{Filter}}{Selects the filter to generate. The available filters are:
81 \begin{itemize}\itemsep=0pt
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
105 \twocolitem{\textbf{Bandwidth}}{Sets the bandwidth of the filter.}
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}.}
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}.
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.}
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.}
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.
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.
147 \subsection{File - Close}
148 As one would expect, this closes the active window.
150 \subsection{File - Save As}
151 Allows the saving of the contents of a window to any filename.
153 \subsection{Help - Contents}
154 This command displays the online help.
156 \subsection{Help - About}
157 This command shows the version number and operating environment of \ctsim.
160 \section{Phantom Menus}
162 \subsection{Properties}
163 Displays the properties of a phantom which includes:
165 \begin{itemize}\itemsep=0pt
166 \item Overall dimensions of a phantom
167 \item A list of all component phantom elements
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
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)}
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:
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}
197 \twocolitem{\textbf{Number of detectors}}{Sets the number of
198 detectors in the detector array.}
200 \twocolitem{\textbf{Number of views}}{Sets the number of views
203 \twocolitem{\textbf{Samples per detector}}{Sets the number of
204 samples collected for each detector}
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
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}.}
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.}
220 \textbf{Advanced Options}
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
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.}
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).
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:
253 \twocolitem{\textbf{PNG}}{Portable Network Graphics format. This uses 8-bits or
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
259 \twocolitem{\textbf{PGM ASCII}}{ASCII version of PGM.}
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
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.
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.
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
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.}
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.}
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}.}
299 This command resets the intensity scale to the full scale of the image.
302 These commands create a new image based upon the current image,
303 and for some commands, also upon a comparison image.
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.
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.
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:
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.
332 \subsection{Filter}\index{Image!Filter}
333 These commands filter and modify the image
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:
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.}
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.
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.
361 The available frequency-based filtering commards are:
363 \begin{itemize}\itemsep=0pt
371 \item 2D Inverse Fourier
372 \item Shuffle Fourier to Natural Order
373 \item Shuffle Natural to Fourier Order
379 These commands are used for analyzing an image.
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.
387 The available commands are:
388 \begin{itemize}\itemsep=0pt
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.
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.
403 The three distance measures are:
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.
411 The available commands are:
412 \begin{itemize}\itemsep=0pt
418 \section{Projection Menus}
420 \subsection{File - Properties}
421 The displayed properties include:
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.
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:
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.}
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
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:
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
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}
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
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.
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.
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
491 \textbf{Advanced Options}
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
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.
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.
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}
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.}
538 \subsection{File - Properties}
539 The displayed properties include:
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.
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.
552 This command sets the upper and lower limits for the y-axis.
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.
560 The command resets the upper and lower limits of the y-axis to the
561 minimum and maximum values of the curves.