X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=doc%2Fctsim-concepts.tex;h=c7c3ffd39350bd3a66b965e2c8aa25e2b5dcc8c9;hb=3fe1c8e09462c4b44908fec9d309aa41908889c8;hp=9653a120ead80b7343711c9699b6a87b9dc600f9;hpb=dc60803b173bcf8719862fbed7e8652883e23f96;p=ctsim.git diff --git a/doc/ctsim-concepts.tex b/doc/ctsim-concepts.tex index 9653a12..c7c3ffd 100644 --- a/doc/ctsim-concepts.tex +++ b/doc/ctsim-concepts.tex @@ -1,8 +1,8 @@ \chapter{Concepts}\index{Concepts}% -\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}% +\setheader{{\it CHAPTER \thechapter}}{}{}{\ctsimheadtitle}{}{{\it CHAPTER \thechapter}}% \ctsimfooter% -\section{Overview}\label{conceptoverview}\index{Concepts,Overview}% +\section{Overview}\label{conceptoverview}\index{Conceptual Overview}% The operation of \ctsim\ begins with the phantom object. A phantom object consists of geometric elements. A scanner is specified and the collection of x-ray data, or projections, is @@ -16,8 +16,8 @@ and the approach taken is required. \ctsim\ deals with a variety of object, but the two objects we need to be concerned with are the \emph{phantom} and the \emph{scanner}. -\section{Phantoms}\label{conceptphantom}\index{Concepts,Phantoms}% -\subsection{Overview}\label{phantomoverview}\index{Concepts,Phantoms,Overview}% +\section{Phantoms}\label{conceptphantom} +\subsection{Overview}\label{phantomoverview}\index{Phantom Overview}% \ctsim\ uses geometrical objects to describe the object being scanned. A phantom is composed a one or more phantom elements. @@ -32,14 +32,14 @@ user-defined phantoms. The types of phantom elements and their definitions are taken with permission from G.T. Herman's 1980 book\cite{HERMAN80}. -\subsection{Phantom File}\label{phantomfile}\index{Concepts,Phantoms,File} +\subsection{Phantom File}\label{phantomfile}\index{Phantom file syntax} Each line in the text file describes an element of the phantom. Each line contains seven entries, in the following form: \begin{verbatim} element-type cx cy dx dy r a \end{verbatim} The first entry defines the type of the element, either -\rtfsp\texttt{rectangle}, \texttt{}, \texttt{triangle}, +\rtfsp\texttt{rectangle}, \texttt{ellipse}, \texttt{triangle}, \rtfsp\texttt{sector}, or \texttt{segment}. \texttt{cx}, \rtfsp\texttt{cy}, \texttt{dx} and \texttt{dy} have different meanings depending on the element type. @@ -50,7 +50,7 @@ coefficient of the object. Where objects overlap, the attenuations of the overlapped objects are summed. -\subsection{Phantom Elements}\label{phantomelements}\index{Concepts,Phantoms,Elements} +\subsection{Phantom Elements}\label{phantomelements}\index{Phantom elements} \subsubsection{ellipse} Ellipses use \texttt{dx} and \texttt{dy} to define the semi-major and @@ -88,14 +88,14 @@ The perimeter of the circle is then draw between those two points below the x-axis. The sector is then rotated and translated the same as a segment. -\subsection{Phantom Size} +\subsection{Phantom Size}\index{Phantom size} The overall dimensions of the phantom are increased by 1\% above the specified sizes to avoid clipping due to round-off errors from sampling the polygons of the phantom elements. So, if the phantom is defined as a rectangle of size 0.1 by 0.1, the actual phantom has extent 0.101 in each direction. -\section{Scanner}\label{conceptscanner}\index{Concepts,Scanner}% +\section{Scanner}\label{conceptscanner}\index{Scanner concepts}% \subsection{Dimensions} Understanding the scanning geometry is the most complicated aspect of using \ctsim. For real-world CT simulators, this is actually quite @@ -114,32 +114,31 @@ variable is the diameter of the circle surround the phantom, or the \emph{phantom diameter}. Remember, as mentioned above, the phantom dimensions are also padded by 1\%. -The other important geometry variables for scanning objects are the -\emph{view ratio}, \emph{scan ratio}, and \emph{focal length ratio}. -These variables are all input into \ctsim\ in terms of ratios rather -than absolute values. +The other important geometry variables for scanning phantoms are +the \emph{view diameter}, \emph{scan diameter}, and \emph{focal +length}. These variables are all input into \ctsim\ in terms of +ratios rather than absolute values. -\subsubsection{Phantom Diameter} +\subsubsection{Phantom Diameter}\index{Phantom diameter} \begin{figure} $$\image{5cm;0cm}{scangeometry.eps}$$ -\caption{Phantom Geometry} +\caption{\label{phantomgeomfig} Phantom Geometry} \end{figure} -The phantom diameter is automatically calculated by \ctsim\ from the -phantom definition. The maximum of the phantom length and height is -used to define the square that completely surrounds the phantom. Let -\latexonly{$p_l$}\latexignore{\emph{Pl}} -be the width and height of this square. The diameter of this boundary box, -\latexonly{$p_d$,}\latexignore{\emph{Pd},} -\rtfsp is then -\latexignore{\\$$\emph{Pl x sqrt(2)}$$\\} -\latexonly{$$p_d = p_l \sqrt{2}$$} -CT scanners actually collect projections around a circle rather than a -square. The diameter of this circle is also the diameter of the boundary -square -\latexonly{$p_d$.}\latexignore{\rtfsp\emph{Pd}.} -These relationships are diagrammed in figure 2.1. - -\subsubsection{View Diameter} +The phantom diameter is automatically calculated by \ctsim\ from +the phantom definition. The maximum of the phantom length and +height is used to define the square that completely surrounds the +phantom. Let \latexonly{$p_l$}\latexignore{\emph{Pl}} be the width +and height of this square. The diameter of this boundary box, +\latexonly{$p_d$,}\latexignore{\emph{Pd},} \rtfsp is then +\latexignore{\\$$\emph{Pl x sqrt(2)}$$\\} \latexonly{$$p_d = p_l +\sqrt{2}$$} CT scanners actually collect projections around a +circle rather than a square. The diameter of this circle is also +the diameter of the boundary square +\latexonly{$p_d$. These +relationships are diagrammed in figure~\ref{phantomgeomfig}.} +\latexignore{emph{Pd}.} + +\subsubsection{View Diameter}\index{View diameter} The \emph{view diameter} is the area that is being processed during scanning of phantoms as well as during rasterization of phantoms. By default, the \emph{view diameter} \rtfsp is set equal @@ -160,12 +159,12 @@ This will lead to significant artifacts. Physically, this would be impossible and is analagous to inserting an object into the CT scanner that is larger than the scanner itself! -\subsubsection{Scan Diameter} +\subsubsection{Scan Diameter}\index{Scan diameter} By default, the entire \emph{view diameter} is scanned. For experimental purposes, it may be desirable to scan an area either larger or smaller than the \emph{view diameter}. Thus, the concept of \emph{scan ratio}, \latexonly{$s_r$,}\latexignore{\emph{SR},} -is born. The scan diameter +is arises. The scan diameter \latexonly{$s_d$}\latexignore{\emph{Sd}} is the diameter over which x-rays are collected and is defined as \latexonly{$$s_d = v_d s_r$$}\latexignore{\\$$\emph{Sd = Vd x SR}$$\\} By default and @@ -173,7 +172,7 @@ for all ordinary scanning, the \emph{scan ratio} is to \texttt{1}. If the \emph{scan ratio} is less than \texttt{1}, you can expect significant artifacts. -\subsubsection{Focal Length} +\subsubsection{Focal Length}\index{Focal length} The \emph{focal length}, \latexonly{$f$,}\latexignore{\emph{F},} is the distance of the X-ray source to the center of @@ -191,7 +190,7 @@ physically impossible and it analagous to have having the x-ray source inside of the \emph{view diameter}. -\subsection{Parallel Geometry}\label{geometryparallel}\index{Concepts,Scanner,Geometries,Parallel} +\subsection{Parallel Geometry}\label{geometryparallel}\index{Parallel Geometry} As mentioned above, the focal length is not used in this simple geometry. The detector array is set to be the same size as the @@ -203,7 +202,7 @@ values of less than \texttt{1} are used for these two variables, significant distortions will occur. -\subsection{Divergent Geometries}\label{geometrydivergent}\index{Concepts,Scanner,Geometries,Divergent} +\subsection{Divergent Geometries}\label{geometrydivergent}\index{Divergent geometry} \subsubsection{Overview} Next consider the case of equilinear (second generation) and equiangular (third, fourth, and fifth generation) geometries. In these cases, @@ -211,10 +210,10 @@ the x-ray beams diverge from a single source to a detector array. In the equilinear mode, a single source produces a fan beam which is read by a linear array of detectors. If the detectors occupy an arc of a circle, then the geometry is equiangular. -See figure 2.2. +\latexonly{See figure~\ref{divergentfig}.} \begin{figure} \image{10cm;0cm}{divergent.eps} -\caption{Equilinear and equiangular geometries.} +\caption{\label{divergentfig} Equilinear and equiangular geometries.} \end{figure} @@ -226,10 +225,11 @@ at the time of manufacture. \ctsim, however, calculates the the \emph{focal length} \latexignore{\\$$\emph{alpha = 2 x asin ( (Sd / 2) / f)}$$\\} \latexonly{\begin{equation}\label{alphacalc}\alpha = 2 \sin^{-1} -((s_d / 2) / f)\end{equation}} This is illustrated in figure 2.3. +((s_d / 2) / f)\end{equation} + This is illustrated in figure~\ref{alphacalcfig}.} \begin{figure} \image{10cm;0cm}{alphacalc.eps} -\caption{Calculation of $\alpha$} +\caption{\label{alphacalcfig} Calculation of $\alpha$} \end{figure} @@ -260,9 +260,9 @@ Since in normal scanning $s_r$ = 1, $\alpha$ depends only upon the \subsubsection{Detector Array Size} In general, you do not need to be concerned with the detector -array size. It is automatically calculated by \ctsim. For those -interested, this section explains how the detector array size is -calculated. +array size. It is automatically calculated by \ctsim. For the +particularly interested, this section explains how the detector +array size is calculated. For parallel geometry, the detector length is equal to the scan diameter. @@ -276,10 +276,11 @@ For equiangular geometry, the detectors are spaced around a circle covering an angular distance of \latexonly{$2\,\alpha$.}\latexignore{\emph{2 \alpha}.} The dotted circle in -\begin{figure}\label{equiangularfig} -\image{10cm;0cm}{equiangular.eps} \caption{Equiangular geometry} +\begin{figure} +\image{10cm;0cm}{equiangular.eps} +\caption{\label{equiangularfig}Equiangular geometry} \end{figure} -figure 2.4 indicates the positions of the detectors in this case. +figure~\ref{equiangularfig} indicates the positions of the detectors in this case. For equilinear geometry, the detectors are space along a straight line. The length of the line depends upon @@ -288,15 +289,15 @@ length}. It is calculated as \latexonly{$4\,f \tan (\alpha / 2)$} \latexignore{\emph{4 x F x tan(\alpha/2)}} \begin{figure}\label{equilinearfig} \image{10cm;0cm}{equilinear.eps} -\caption{Equilinear geometry} +\caption{\label{equilinearfig} Equilinear geometry} \end{figure} -This geometry is shown in figure~2.5. +\latexonly{This geometry is shown in figure~\ref{equilinearfig}.} \subsubsection{Examples of Geometry Settings} -\section{Reconstruction}\label{conceptreconstruction}\index{Concepts,Reconstruction}% +\section{Reconstruction}\label{conceptreconstruction}\index{Reconstruction Overview}% \subsection{Overview} \subsection{Direct Inverse Fourier} This method is not currently implemented in \ctsim, however it is @@ -305,7 +306,7 @@ accurate as filtered backprojection. The difference is due primarily because interpolation occurs in the frequency domain rather than the spatial domain. -\subsection{Filtered Backprojection} +\subsection{Filtered Backprojection}\index{Filtered backprojection} The technique is comprised of two sequential steps: filtering projections and then backprojecting the filtered projections. Though these two steps are sequential, each view position can be processed individually. @@ -336,3 +337,23 @@ multiple filters for this purpose. Backprojection is the process of ``smearing'' the filtered projections over the reconstructing image. Various levels of interpolation can be specified. + +\section{Image Comparison}\index{Image comparison} +Images can be compared statistically. Three measurements can be calculated +by \ctsim. They are taken from the standard measurements used by +Herman\cite{HERMAN80}. +$d$ is the standard error, $e$ is the maximum error, and +$r$ is the maximum error of a 2 by 2 pixel area. + +To compare two images, $A$ and $B$, each of which has $n$ columns and $m$ rows, +these values are calculated as below. + + +\latexonly{ +\begin{equation} +d = \frac{\sum_{i=0}^{n}{\sum_{j=0}^{m}{(A_{ij} - B_{ij})^2}}}{m n} +\end{equation} +\begin{equation} +r = \max(|A_{ij} - B{ij}|) +\end{equation} +}