r497: no message
[ctsim.git] / doc / ctsim-concepts.tex
index 135c835cb57d4c330b586120302be1a4b8f5dfeb..da62712d98c3a1d3c68382982fda75a10dff2aea 100644 (file)
@@ -81,80 +81,113 @@ translated and then rotated (???).
 Also note that the overall dimensions of the phantom are increased by 1\%
 above the specified sizes to avoid clipping due to round-off errors.  
 So, if the phantom is defined as
-a rectangle of size 0.1 by 0.1, the actual phantom has extent $\pm$0.101 in
-each direction.
+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}%
-\subsection{Geometries}
-This is where things get tricky.  There are two possible approaches.  The
-simple approach would be to define the size of a phantom which is put at
-the centre of the scanner.  The scanner would have it's bore size defined,
-or perhaps better, the field of view defined. Here, field of view would be
-the radius or diameter of the circular area from which data is collected
-and an image reconstructed.  In a real CT scanner, if the object being
-scanned is larger than the field of view, you get image artifacts.  And of
-course you can't stuff an object into a scanner if the object is larger
-than the bore!  In this model, the scanner size or field of view would
-be used as the standard length scale.
-
-However, \ctsim\ takes another approach.  I believe this approach arose
-because the "image" of the phantom produced from the phantom description
-was being matched to the reconstruction image of the phantom.  That is,
-the dimensions of the 'before' and 'after' images  were being matched.
-The code has a Phantom object and a Scanner object.  The geometry of the
-Scanner is defined in part by the properties of the Phantom.  In fact,
-all dimensions are determined in terms of the phantom size, which is used
-as the standard length scale. Remember, as mentioned above, the
+\subsection{Sizes}
+Understanding the scanning geometry is the most complicated aspect
+of using \ctsim. For our real-world CT simulators, this is actually
+quite simple. The geometry is fixed by the manufacturer during
+the construction of the scanner and can not be changed. 
+\ctsim, being a very flexible simulator,
+gives tremendous options is setting up the geometry for a scan.
+
+In general, the geometry for a scan all starts from the size of the
+phantom being scanned. This is because \ctsim\ allows for statistical
+comparisons between the original phantom image and it's reconstructions.
+Since CT scanners scan a circular area, the first important
+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 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}
 The maximum of the phantom length and height is used to define the square
-that completely surrounds the phantom. Let $p_l$ be the width (also height)
-of this square. The diameter of this boundary box, $p_d$ is then
-\latexonly{$$p_d = \sqrt{2}(p_l)$$}
-\latexignore{sqrt(2) * $p_l$.}
-This relationship can be seen in figure 1 with the parallel geometry.
-
-\subsubsection{Focal Length \& Field of View}
-The two important variables is the focal-length-ratio $f_lr$.
-This is used along with $p_d$ to
-define the focal length according to
-\latexonly{$$f_l = f_lr p_d$$}
-\latexignore{\\$f_l$ = $f_lr$ x $p_d$\\}
-where
-we consider the case of a first generation parallel beam CT scanner.
-
-\subsubsection{Parallel Geometry}\label{geometryparallel}\index{Concepts,Scanner,Geometries,Parallel}
+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},}
+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{\emph{Pd}.}
+These relationships are diagrammed in figure 1.
+
+\subsubsection{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}
+is set equal to the \emph{phantom diameter}. It may be useful, especially for 
+experimental reasons, to process an area larger (and maybe even smaller) than
+the phantom. Thus, during rasterization or during projections, \ctsim\ will
+ask for a \emph{view diameter ratio},
+\latexonly{$V_{dR}$.}\latexignore{\emph{VdR}.}
+The \emph{view diameter} is then set as
+\latexonly{$$V_d = P_d V_{dR}$$}\latexignore{\\$$\emph{Vd = Pd x VdR}$$}
+
+By using a 
+\latexonly{$V_{dR}$}\latexignore{\emph{VdR}}
+less than 1, \ctsim\ will allow
+for a \emph{view diameter} less than 
+\emph{phantom diameter}.
+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}
+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 diameter}
+\latexonly{$S_{dR}$}\latexignore{\emph{SdR}}
+is born. The scan diameter
+\latexonly{$S_d$}\latexignore{\emph{Sd}}
+is defined as
+\latexonly{$$S_d = V_d S_{dR}$$}\latexignore{\\$$\emph{Sd = Vd x SdR}$$\\}
+By default and for all ordinary scanning, the \emph{scan diameter ratio} is to \texttt{1}. If the \emph{scan diameter ratio} is less than \texttt{1}, you
+can plan on significant artifacts.
+
+\subsubsection{Focal Length}
+The \emph{focal length},
+\latexonly{$F_l$,}\latexignore{\emph{Fl},}
+is the distance of the X-ray source to the center of
+the phantom. The focal length is set as a ratio,
+\latexonly{$F_{lR}$,}\latexignore{\emph{FlR},}
+of the view radius. Focal length is
+calculated as
+\latexonly{$$F_l = F_{lR} (V_d / 2)$$}\latexignore{\\$$\emph{Fl = FlR x (Vd / 2)}$$}
+
+For parallel geometry scanning, the focal length doesn't matter. However, 
+divergent geometry scanning (equilinear and equiangular), the \emph{focal
+length ratio} should be set at \texttt{2} or more to avoid artifacts. 
+
+\subsection{Parallel Geometry}\label{geometryparallel}\index{Concepts,Scanner,Geometries,Parallel}
 \begin{figure}
 \image{10cm;0cm}{ctsimfig1.eps}
 \caption{Geometry used for a 1st generation, parallel beam CT scanner}\label{fistgenfig}
 \end{figure}
 
-In figure 1A, the excursion of the source and detector need only be $l_p$,
-the height (or width) of the phantom's bounding square. However, if the
-field of view were only $l_p$, then the projection shown in figure 1B
-would clip the corners of the phantom.  By increasing the field of view by
-$\sqrt{2}$ the whole phantom is included in every projection.  Of course,
-if the field-of-view ratio $f_{vR}$ is larger than 1, there is no problem.
-However, if $f_{vR}$ is less than one and thus the scanner is smaller than
-the phantom, then distortions will occur without warning from the program.
-
-The code also sets the detector length equal to the field of view in this
-case.  The focal length is chosen to be $\sqrt{2}l_p$ so the phantom will
-fit between the source and detector at all rotation angles, when the focal
-length ratio is specified as 1.  Again, what happens if the focal length
-ratio is chosen less than 1?
-
-The other thing to note is that in this code the detector array is set to
-be the same size as the field-of-view $f_v$, equation (2).  So, one has to
-know the size of the phantom to specify a given scanner geometry with a
-given source-detector distance (or $f_l$ here) and a given range of
-excursion ($f_v$ here).
-
-\subsubsection{Divergent Geometries}\label{geometrydivergent}\index{Concepts,Scanner,Geometries,Divergent}
+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 \emph{scan diameter}. 
+For optimal scanning in this geometry, the \emph{scan diameter} should
+be equal to the \emph{phantom diameter}. This is accomplished by using
+the default values of \texttt{1} for the \emph{view diameter ratio} and
+the \emph{scan diameter ratio}. If 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}
+\subsubsection{Overview}
 Next consider the case of equilinear (second generation) and equiangular
-(third, fourth, and fifth generation) geometries.
-The parts of the code  relevant to this
-discussion are the same for both modes.  In the equilinear mode, a single
+(third, fourth, and fifth generation) geometries. In these cases,
+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.
@@ -163,15 +196,20 @@ See figure 2.
 \caption{Equilinear and equiangular geometries.}
 \end{figure}
 
-For these geometries, the following logic is executed:  A variable dHalfSquare
-$d_{hs}$ is defined as
-\latexonly{$$d_{hs} = (f_v)/(2\sqrt{2}) = (l_p/2) f_{vR}$$}
-This is then subtracted from the focal length $f_l$ as calculated above, and
-assigned to a new variable 
-\latexonly{$\mathrm{dFocalPastPhm} = f_l - d_{hs}$}.  Since $f_l$ and
-$d_{hs}$ are derived from the phantom dimension and the input focal length and field of view ratios, one can write,
-\latexonly{$$\mathrm{dFocalPastPhm} = f_l -d_{hs}
-    = \sqrt{2}(l_p/2) f_{lR} - (l_p/2) f_{vR} = l_p(\sqrt{2}f_{lR} - f_{vR})$$}
+\subsubsection{Fan Beam Angle}
+For these divergent beam geometries, the angle of the fan beam needs 
+to be calculated. For real-world CT scanners, this is fixed at the
+time of manufacture. \ctsim\, however, calculates the fan beam angle,
+\latexonly{$\alpha$,}\latexignore{\emph{alpha},} 
+from the diameter of the \emph{scan diameter} and the \emph{focal length}
+\latexignore{\\$$\emph{alpha = 2 x asin ( (Sd / 2) / F_l)}$$\\}
+\latexonly{$$\alpha = 2 \sin^{-1} ((S_d / 2) / F_l)$$}
+This is illustrated in figure 3.
+\begin{figure}
+\image{10cm;0cm}{alphacalc.eps}
+\caption{Calculation of $\alpha$}
+\end{figure}
+
 If this quantity is less than or equal to zero, then at least for some
 projections  the source is inside the phantom.  Perhaps a figure will help at
 this point. Consider first the case where $f_{vR} = f_{lR} =1 $, figure 3. The
@@ -217,12 +255,15 @@ and the field of view ratio = 1.}
 
 \section{Reconstruction}\label{conceptreconstruction}\index{Concepts,Reconstruction}%
 \subsection{Overview}
-\subsection{Filtered Backprojection}
 \subsection{Direct Inverse Fourier}
-This method is not currently implemented in \ctsim, however it is planned for a
-future release. This method does not give as accurate result as filtered
-backprojection mostly due to interpolation occuring in the frequency domain rather
-than the spatial domain. The technique is comprised of two sequential steps:
+This method is not currently implemented in \ctsim, however it is
+planned for a future release. This method does not give results as
+accurate as filtered backprojection. The difference is due primarily
+because interpolation occurs in the frequency domain rather than the
+spatial domain.
+
+\subsection{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.
 This parallelism is exploited in the MPI versions of \ctsim\ where the data from