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 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.
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.
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.
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 and stored on 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 preprogrammed
61 into \ctsim. After selecting one of these phantoms, the new window with that
62 phantom will be generated. The preprogrammed 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.}
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}}{ This parameter adjusts the smoothing of the Hamming
85 filter and can range from \texttt{0} to \texttt{1}.
86 At a setting of \texttt{1}, the Hamming filter is the same as the bandlimit filter.
87 At a setting of \texttt{0.54}, the Hamming filter is the same as the Hanning
89 \twocolitem{\textbf{Bandwidth}}{Sets the bandwidth of the filter.}
90 \twocolitem{\textbf{Axis (input) Scale}}{Sets the scale for the filter input. By default, the input to the filter is
91 the distance in pixels from the center of the image. By changing this value, one can set a scale the input to the filter.
92 For example, if the output image is \texttt{101} pixels and thus the center of the image is at \texttt{(50,50)}, then a pixel
93 lying at point \texttt{100,50} would be 50 units from the center of the filter. By applying an \texttt{Axis scale} of
94 \texttt{0.1}, then that point would be scaled to 5 units from the center of the filter.}
95 \twocolitem{\textbf{Filter (output) Scale}}{Multiplies the output of the filter by this amount. By default, the filter has a maximum
99 \subsection{File - Preferences}\label{IDH_DLG_PREFERENCES}\index{Dialog!Preferences}
100 This command displays a dialog box that allows users to control
101 the behavior of \ctsim. These options are saved across \ctsim\ sessions.
102 Under Microsoft Windows environments, they are stored in the registry.
103 On UNIX and Linux environments, they are stored in the user's home
104 directory with the filename of \texttt{.ctsim}.
107 \twocolitem{\textbf{Advanced options}}{By default, this is turned off in new installations.
108 These advanced options are not required for normal simulations. When \texttt{Advanced
109 Options} is set, \ctsim\ will display more options during scanning of phantoms and
110 the reconstruction of projections.}
112 \twocolitem{\textbf{Ask before deleting new documents}}{By default, this is turned on in
113 new installations. With this option set, \ctsim\ will ask before closing
114 documents that have been modified or never saved on disk. By turning off
115 this option, \ctsim\ will never ask if you want to save a file -- you'll
116 be responsible for saving any files that you create.}
120 \subsection{File - Open}
121 This command opens a file section dialog box. Of special consideration
122 is the \texttt{File Type} combo box on the bottom of the dialog. You need
123 to set the \texttt{File Type} combo box to to the type of file that you wish to open.
125 \subsection{File - Save}
126 This command saves the contents of the active window. If the window hasn't
127 been named, a dialog box will open asking for the file name to use.
129 \subsection{File - Close}
130 As one would expect, this closes the active window.
132 \subsection{File - Save As}
133 Allows the saving of the contents of a window to any filename.
135 \subsection{Help - Contents}
136 This command displays the online help.
138 \subsection{Help - About}
139 This command shows the version number of \ctsim.
142 \section{Phantom Menus}
144 \subsection{Properties}
145 Displays the properties of a phantom which includes:
147 \begin{itemize}\itemsep=0pt
148 \item Overall dimensions of a phantom
149 \item A list of all component phantom elements
152 \subsection{Rasterize Dialog}\label{IDH_DLG_RASTERIZE}\index{Dialog!Rasterize}
153 This creates an image file from a phantom. Technically, it
154 converts the phantom from a vector (infinite resolution) object
155 into a 2-dimension array of floating-point pixels. The parameters
159 \twocolitem{\textbf{X size}}{Number of columns in image file}
160 \twocolitem{\textbf{Y size}}{Number of rows in image file}
161 \twocolitem{\textbf{Samples per pixel}}{Numbers of samples taken
162 per pixel in both the x and y directions. For example, if the
163 \texttt{Samples per pixel} is set to \texttt{3}, then for every
164 pixel in the image file 9 samples \latexonly{($3\times3$)}\latexignore{(3 x 3)}
168 \subsection{Projection Dialog}\label{IDH_DLG_PROJECTIONS}\index{Dialog!Projections}
169 This creates a projection file from a phantom. The options
170 available when collecting projections are:
173 \twocolitem{\textbf{Geometry}}{Selects the scanner geometry.
174 \begin{itemize}\itemsep=0pt
175 \item \texttt{Parallel}
176 \item \texttt{Equiangular}
177 \item \texttt{Equilinear}
179 \twocolitem{\textbf{Number of detectors}}{Sets the number of
180 detectors in the detector array.}
182 \twocolitem{\textbf{Number of views}}{Sets the number of views
185 \twocolitem{\textbf{Samples per detector}}{Sets the number of
186 samples collected for each detector}
188 \twocolitem{\textbf{View Ratio}}{Sets the field of view as a ratio
189 of the diameter of the phantom. For normal scanning, use a value of
192 \twocolitem{\textbf{Scan Ratio}}{Sets the length of scanning as a
193 ratio of the view diameter. For normal scanning, use a value of \texttt{1.0}.}
195 \twocolitem{\textbf{Focal length ratio}}{Sets the distance between the
196 radiation source and the center of the phantom as a
197 ratio of the radius of the phantom. For parallel geometries, a value
198 of \texttt{1.0} is optimal. For other
199 geometries, this should be at least \texttt{2.0} to avoid artifacts.}
202 \textbf{Advanced Options}
205 \twocolitem{\textbf{Rotation Angle}}{Sets the rotation amount as a
206 multiple of \latexonly{$\pi$.}\latexignore{pi.} For parallel geometries use a rotation angle of \texttt{1}
207 and for equilinear and equiangular geometries use a rotation angle
208 of \texttt{2}. Using any other rotation angle will lead to artifacts.}
213 \section{Image Menus}
214 \subsection{File - Properties}
215 Properties of image files include
216 \begin{itemize}\itemsep=0pt
217 \item Whether the image is real or complex valued
218 \item Numeric statistics (minimum, maximum, mean, median, mode, and standard deviation)
219 \item History labels (text descriptions of the processing for this image)
222 \subsection{File - Export}\label{IDH_DLG_EXPORT}\index{Image!Export}
223 This command allows for exporting image files to a standard
224 graphics file format. This is helpful when you want to take an
225 image and import it into another application. The current
226 \helprefn{intensity scale}{intensityscale} is used when exporting
227 the file. The supported graphic formats are:
230 \twocolitem{\textbf{PNG}}{Portable Network Graphics format. This uses 8-bits or
232 \twocolitem{\textbf{PNG-16}}{This is a 16-bit version of PNG which allows for
233 65536 shades of gray.}
234 \twocolitem{\textbf{PGM}}{Portable Graymap format. This is a common format used on
236 \twocolitem{\textbf{PGM}}{ASCII version of PGM.}
240 \subsection{View}\label{intensityscale}\index{Intensity scale}
241 These commands are used change the intensity scale for viewing the image.
242 These commands do not change the image data. When the minimum intensity is
243 set, then the color pure black is assigned to that image intensity. Similarly,
244 when the maximum intensity is set, the the color pure white is assigned to that
247 Changing the intensity scale is useful when examining different image features.
248 In clinical medicine, the intensity scale is often changed to examine bone
249 (high intensity) verses soft-tissue (medium intensity) features.
251 \subsubsection{Set}\label{IDH_DLG_MINMAX}
252 This command displays a dialog box that allows you to set the lower
253 and upper intensities to display.
255 \subsubsection{Auto}\label{IDH_DLG_AUTOSCALE}
256 This command displays a dialog box that allows \ctsim\ to automatically
257 make an intensity scale. The parameters that \ctsim\ needs to make this
261 \twocolitem{\textbf{Center}}{This sets the center of the intensity scale. Currently,
262 \ctsim\ allows you to use either the mean, mode, or median of the image
263 as the center of the intensity scale.}
265 \twocolitem{\textbf{Width}}{This sets the half-width of the intensity scale. The width
266 is specified as a ratio of the standard deviation.}
269 As an example, if \texttt{median} is selected as the center and
270 \texttt{0.5} is selected as the width, the the minimum intensity will
271 be \latexonly{$median - 0.5 \times standardDeviation$}\latexignore{\emph{median - 0.5 x standardDeviation}}
272 and the maximum will be \latexonly{$median + 0.5 \times standardDeviation$.}\latexignore{\emph{
273 median + 0.5 x standardDeviation}.}
276 This command resets the intensity scale to the full scale of the image.
279 These commands create a new image based upon the current image,
280 and for some commands, also upon a comparison image.
282 \subsubsection{Add, Subtract, Multiply, Divide}
283 These are simple arithmetic operations. \ctsim\ will display a dialog
284 box showing all of the currently opened image files that are the
285 same size as the active image. After the selection of a compatible image,
286 \ctsim\ will perform the arithmetic operation on the two images and
287 make a new result image.
289 \subsubsection{Image Size}
290 This command will generate a new image based on the current image. The new
291 image can be scaled to any size. A dialog
292 appears asking for the size of the new image. Bilinear interpolation
293 is used when calculating the new image.
295 \subsubsection{3-D Conversion}
296 Generates a 3-dimensional view of the current phantom. This view can be
297 rotated in three dimensions. The left and right arrow control the z-axis
298 rotation, the up and down arrows control the x-axis rotation. The y-axis
299 rotation is controlled by the \texttt{T} and \texttt{Y} keys. Other options
300 are presented on the \texttt{View} menu and include:
303 \item Surface plot versus wireframe plot.
304 \item Smooth shading versus flat shading.
305 \item Lighting on or off.
306 \item Color scale on or off.
309 \subsection{Filter}\index{Image!Filter}
310 These commands filter and modify the image
312 \subsubsection{Arithmetic}
313 These commands operate on the image on a pixel-by-pixel basis. The commands
314 support both real and complex-valued images. The available arithmetic commards are:
317 \twocolitem{\textbf{Invert}}{Negate pixel values.}
318 \twocolitem{\textbf{Log}}{Take natural logrithm of pixel values.}
319 \twocolitem{\textbf{Exp}}{Take natural exponent of pixel values.}
320 \twocolitem{\textbf{Square}}{Take square of pixel values.}
321 \twocolitem{\textbf{Square root}}{Take square root of pixel values.}
325 \subsubsection{Frequency Based}
326 This commands allow the Fourier and inverse Fourier transformations of
327 images. By default, the transformations will automatically convert
328 images between Fourier to natural orders as expected. For example, \texttt{2-D FFT}
329 will transform the points into natural order after the Fourier transform.
330 Similarly the inverse, \texttt{2-D IFFT}, will reorder the points from
331 natural order to Fourier order before applying the inverse Fourier transformation.
333 As you would expect, images that undergo frequency filtering will be complex-valued
334 images. Normally, only the real component is shown by \ctsim. However, \ctsim\ does
335 have options for converting a complex-valued image into a real-valued image via
336 the \texttt{Magnitude} and \texttt{Phase} filtering commands.
340 These commands are used for analyzing an image.
342 \subsubsection{Plotting}
343 The commands plot rows and columns of images. There are also commands
344 that perform FFT and IFFT transformations prior to plotting.
346 \subsubsection{Image Comparison}\label{IDH_DLG_COMPARISON}\index{Image!Comparison}
347 This command performs statistical comparisons between two images. An option
348 also exists for generating a difference image from the two input images.
350 There are also commands for comparison plotting of rows and columns from two images.
351 This is quite helpful when comparing a phantom to a reconstruction.
353 The three distance measures are:
356 \twocolitem{\textbf{$d$}}{The normalized root mean squared distance measure.}
357 \twocolitem{\textbf{$r$}}{The normalized mean absolute distance measure.}
358 \twocolitem{\textbf{$e$}}{The worst case distance measure over a \latexonly{$2\times2$}\latexignore{\emph{2 x 2}} pixel area.}
361 \section{Projection Menus}
363 \subsection{File - Properties}
364 The displayed properties include:
367 \item Number of detectors in the projections.
368 \item Number of views.
369 \item The variables used when generating the projections from the phantom.
372 \subsection{Process - Convert Polar Dialog}\label{IDH_DLG_POLAR}\index{Polar conversion}
373 Creates an image file with the polar conversion of the projection data. The options to set are:
376 \twocolitem{\textbf{X Size}}{Number of columns in output image.}
377 \twocolitem{\textbf{Y Ssize}}{Number of rows in output image.}
378 \twocolitem{\textbf{Interpolation}}{Selects the interpolation method.
379 Currently, the \texttt{bilinear} option provides the highest
380 quality interpolation.}
383 \subsection{Process - Convert FFT Polar Dialog}
384 The parameters for this option are the same as the \helprefn{Convert
385 Polar Dialog}{convertpolardialog}. For this command, though, the
386 projections are Fourier transformed prior to conversion to polar
389 \subsection{Reconstruct - Filtered Backprojection Dialog}\label{IDH_DLG_RECONSTRUCTION}\index{Dialog!Reconstruction}
390 This dialog sets the parameters for reconstructing an image from projections
391 using the filtered backprojection technique. The parameters available are:
394 \twocolitem{\textbf{Filter}}{Selects which filter to apply to each
395 projection. To properly reconstruct an image, this filter should
396 be consist of the the absolute value of distance from zero
397 frequency optionally multiplied by a smoothing filter. The optimal
399 \begin{itemize}\itemsep=0pt
400 \item \texttt{abs\_bandlimit}
401 \item \texttt{abs\_cosine}
402 \item \texttt{abs\_hamming}
403 \item \texttt{abs\_hanning}
405 } \twocolitem{\textbf{Hamming parameter}}{Sets the alpha level for
406 Hamming window. This parameter adjusts the smoothing of the Hamming
407 filter and can range from \texttt{0} to \texttt{1}.
408 At a setting of \texttt{1}, the Hamming filter is the same as the bandlimit filter.
409 At a setting of \texttt{0.54}, the Hamming filter is the same as the Hanning
411 \twocolitem{\textbf{Filter Method}}{Selects the filtering method.
412 For large numbers of detectors, the FFT-based filters are preferred whereas for
413 smaller numbers of detectors \texttt{convolution} can be
414 faster. When \emph{Advanced Options} have been turned off, this menu only shows
415 the two basic choices: \texttt{convolution} and \texttt{FFT}. However, when
416 \emph{Advanced Options} have been turned on, additional selections are available as
417 discussed in the next section.
419 \twocolitem{\textbf{Interpolation}}{Interpolation technique.
420 \texttt{cubic} is optimal when the
421 data is smooth. Smooth data is obtained by taking many projections and/or
422 using a smoothing filter. In the absence of smooth data, \texttt{linear} gives better results and
423 is also many times faster than cubic interpolation.
425 \begin{itemize}\itemsep=0pt
433 \textbf{Advanced Options}
435 These options are only visible if \emph{Advanced Options} has been
436 selected in the \texttt{File - Preferences} dialog. These parameters
437 default to optimal settings and don't need to be adjusted except
441 \twocolitem{\textbf{Filter Method}}{Selects the filtering method.
442 The general comments about this parameter given the previous section still apply.
443 With \emph{Advanced Options} on, the full set of filter methods are available:
444 \begin{itemize}\itemsep=0pt
445 \item \texttt{convolution}
446 \item \texttt{fourier} - Uses simple Fourier transform.
447 \item \texttt{fourier-table} - Optimizes Fourier transform by precalculating trigometric functions.
448 \item \texttt{fftw} - Uses complex-valued Fourier transform with the \emph{fftw} library.
449 \item \texttt{rfftw} - Uses optimized real/half-complex Fourier transform.
452 \twocolitem{\textbf{Backprojection}}{Selects the backprojection
453 technique. A setting of \texttt{idiff} is optimal.
454 \begin{itemize}\itemsep=0pt
455 \item \texttt{trig} - Use trigometric functions at each image point.
456 \item \texttt{table} - Use precalculated trigometric tables.
457 \item \texttt{diff} - Use difference method to iterate within image.
458 \item \texttt{idiff} - Use integer iteration techique.
462 \twocolitem{\textbf{Filter Generation}}{Selects the filter
463 generation. With convolution, \texttt{direct} is the proper method
464 to select. With any of the frequency methods,
465 \texttt{inverse-fourier} is the best method.
466 \begin{itemize}\itemsep=0pt
467 \item \texttt{direct}
468 \item \texttt{inverse-fourier}
472 \twocolitem{\textbf{Zeropad}}{Zeropad factor when using
473 frequency-based filtering. A setting of \texttt{1} is optimal whereas
474 a setting of \texttt{0} disables zero padding. Settings greater than \texttt{1}
475 perform larger amounts of zero padding but without any significant benefit.}
480 \subsection{File - Properties}
481 The displayed properties include:
483 \begin{itemize}\itemsep=0pt
484 \item the number of curves in the plot and the number of points per curve.
485 \item the EZPlot commands used to format the plot are displayed.
486 \item history labels from the originating image(s) and the plot function.
489 \subsection{View Menu}
490 These commands set the scaling for the y-axis. They are analogous
491 to the options used for setting the intensity scale for images.
494 This command sets the upper and lower limits for the y-axis.
497 This command automatically sets the upper and lower limits for the
498 y-axis. Please refer to the \texttt{View - Auto} documentation for
499 image files for the details.
502 The command resets the upper and lower limits of the y-axis to the
503 minimum and maximum values of the curves.