X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=doc%2Fctsim-textui.tex;h=c6fc11d4a3288fe0e29d37d6f121749bce814c08;hb=82ea0c94394a5a175b260160760155a6686203a1;hp=d1d4d0c318be0f51f4045e2b5171c48a96e39826;hpb=d4674ec14f947ca140080a2582ce09dbfdd692c3;p=ctsim.git diff --git a/doc/ctsim-textui.tex b/doc/ctsim-textui.tex index d1d4d0c..c6fc11d 100644 --- a/doc/ctsim-textui.tex +++ b/doc/ctsim-textui.tex @@ -1,210 +1,296 @@ -\chapter{ctsimtext}\label{ctsimtext}\index{ctsimtext}% -\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}% -\setfooter{\thepage}{}{}{}{}{\thepage}% - -\ctsimtext\ is a master shell for all of the command-line utilities. +\chapter{The Command Line Interface}\label{ctsimtext}\index{ctsimtext}% +\setheader{{\it CHAPTER \thechapter}}{}{}{\ctsimheadtitle}{}{{\it CHAPTER \thechapter}}% +\ctsimfooter% + +\ctsimtext\ is a master shell for all of the command-line utilities. The +command-line utilities can perform most of the functions of the graphical +shell. These command-line utilities are especially appropriate for use on +systems without graphical capability, batch files, and parallel processing +with a Beowulf-type computer cluster. + +\usage \ctsimtext\ can be invoked via three different +methods. +\begin{enumerate}\itemsep=3pt +\item \ctsimtext\ can executed without any parameters. In that case, +\ctsimtext\ offers a command-line to enter the function-names and +their parameters. The output of the command is displayed. Further +commands may be given to \ctsimtext. The shell is exited by the +\texttt{quit} command. \ctsimtext\ uses the +\urlref{readline}{http://www.gnu.org} library on UNIX and Linux platforms +to provide command history processing. + +\item \ctsimtext\ can also be called to +execute a single command. This is especially useful for batch +files containing multiple \ctsimtext\ commands. This is invoked by +calling\\ \texttt{ctsimtext function-name parameters...}. + +\item Using operating systems that support soft or hard linking of +files (such as UNIX and Linux), the executable file \ctsimtext\ can +be linked to the function names. This is automatically done by +the installation file for Linux. Thus, to use \ctsimtext\ with the +function name \texttt{pjrec}, the below command can be executed:\\ +\texttt{pjrec parameters...} \\ +as a shortcut rather than the equivalent command \\ +\texttt{ctsimtext pjrec parameters...} + +\end{enumerate} + +\section{Parallel Processing} +\ctsimtext\ can be used to spread it's processing over a cluster. Specifically, +\ctsimtext\ supports the \urlref{LAM}{http://www.mpi.nd.edu/lam} version of +the MPI environment. On platforms with LAM installed, a parallel version of +\ctsimtext\ is created. The name of this program is \texttt{ctsimtext-lam}. +The functions that take advantage of the parallel processing are +\texttt{phm2if}, \texttt{phm2pj}, \texttt{pjrec}. + +This parallel processing version has been tested with excellent results on +a 16-CPU \urlref{Beowulf}{http://www.beowulf.org} cluster. + + +\section{if1}\label{if1}\index{if1}% +Performs math functions on a single image. The commands works with +both real and complex valued images. \usage -\ctsimtext\ can be executed without any parameters. In that case, \ctsimtext\ -offers a command-line to enter the function-names and their parameters. The output of the command is displayed. Further commands may be given to \ctsimtext. The shell is exited by the {\tt quit} command. - -\ctsimtext\ can also be called to execute a single command. This is especially useful for batch files containing multiple \ctsimtext\ commands. This is invoked by calling \par -{\tt ctsimtext function-name parameters...}. - -The available functions are: +\texttt{if1 input-filename output-filename [options...]} -\section{if1}\label{if1}\index{ctsimtext,if1}% -Perfoms math functions on a single image. - -\usage +\textbf{Options} \begin{itemize}\itemsep=0pt - \item --invert - \item --log - \item --exp - \item --sqr - \item --sqrt + \item \doublehyphen{invert} - Negate pixel values + \item \doublehyphen{log} - Take natural logrithm of pixel values + \item \doublehyphen{exp} - Take natural exponent of pixel values + \item \doublehyphen{sqr} - Take square of pixel values + \item \doublehyphen{sqrt} - Take square root of pixel values \end{itemize} -\section{if2}\label{if2}\index{ctsimtext,if2}% -Perfoms math functions on a two images. +\section{if2}\label{if2}\index{if2}% +Performs math functions on a two images. The command works with both +real and complex valued images. \usage +\texttt{if2 input-filename1 input-filename2 output-filename [options...]} + +\textbf{Options} \begin{itemize}\itemsep=0pt - \item --add - \item --sub - \item --mul - \item --comp - \item --column-plot - \item --row-plot + \item \doublehyphen{add} - Add the two images + \item \doublehyphen{sub} - Subtract the two images + \item \doublehyphen{multiply} - Multiply the two images + \item \doublehyphen{divide} - Divide the two images + \item \doublehyphen{comp} - Statistically compare the two images + \item \doublehyphen{column-plot n} - Plot the values of a particular col + \item \doublehyphen{row-plot n} - Plot the values of a particular row \end{itemize} -\section{ifexport}\label{ifexport}\index{ctsimtext,ifexport}% -Export an imagefile to a standard graphics file. +\section{ifexport}\label{ifexport}\index{ifexport}% +Export an image file to a standard graphics file. \usage +\texttt{ifexport input-filename output-filename -\,-format }\emph{graphic-format} \texttt{ [options...]} + +\textbf{Options} \begin{itemize}\itemsep=0pt - \item --format + \item \doublehyphen{format} \begin{itemize}\itemsep=0pt - \item --pgm - \item --pgmasc - \item --png - \item --png16 + \item \texttt{pgm} - Portable graymap format. + \item \texttt{pgmasc} - ASCII PGM format. + \item \texttt{png} - Portable network graphics format. + \item \texttt{png16} - 16-bit PNG format. \end{itemize} - \item --center + \item \doublehyphen{center} - Set center of intensity window. \begin{itemize}\itemsep=0pt - \item median - \item mode - \item mean + \item \texttt{median} + \item \texttt{mode} + \item \texttt{mean} \end{itemize} - \item --auto + \item \doublehyphen{auto} - Set half-width of intensity window. \begin{itemize}\itemsep=0pt - \item --full - \item --std0.1 - \item --std0.5 - \item --std1 - \item --std2 - \item --std3 + \item \texttt{full} + \item \texttt{std0.1} + \item \texttt{std0.5} + \item \texttt{std1} + \item \texttt{std2} + \item \texttt{std3} \end{itemize} - \item --scale - \item --min - \item --max + \item \doublehyphen{scale} - Set size of output image. A value of + \texttt{1} is default and creates an output image the same size as the input image. + \item \doublehyphen{min} - Set the minimum intensity value. + \item \doublehyphen{max} - Set the maximum intensity value. \end{itemize} -\section{ifinfo}\label{ifinfo}\index{ctsimtext,ifinfo}% +\section{ifinfo}\label{ifinfo}\index{ifinfo}% Displays information about an imagefile. \usage +\texttt{ifinfo input-filename [options...]} + +\textbf{Options} \begin{itemize}\itemsep=0pt - \item --labels - \item --no-labels - \item --stats - \item --no-stats - \item --help + \item \doublehyphen{labels} - Display history labels. + \item \doublehyphen{no-labels} - Suppress history labels. + \item \doublehyphen{stats} - Display image statistics. + \item \doublehyphen{no-stats} - Suppress image statistics. \end{itemize} -\section{phm2pj}\label{phm2pj}\index{ctsimtext,phm2pj}% +\section{phm2pj}\label{phm2pj}\index{phm2pj}% Simulates collection of X-rays data (projections) around a phantom object. \usage -phm2pj projection-file-name number-of-detectors number-of-views [options...] -\begin{itemize}\itemsep=0pt - \item --phantom - Select a standard phantom - \begin{itemize}\itemsep=0pt - \item herman - \item herman-b - \item shepp-logan - \item shepp-logan-b - \end{itemize} +\texttt{phm2pj projection-filename number-detectors number-views [options...]} - \item --phmfile - Load a phantom definition definition +\begin{twocollist} +\twocolitem{\doublehyphen{phantom}}{Select a standard phantom. +\begin{itemize}\itemsep=0pt +\item \texttt{herman} +\item \texttt{shepp-logan} +\item \texttt{unit-pulse} +\end{itemize} +} +\twocolitem{\doublehyphen{phmfile}}{Reads a user-created phantom file.} - \item --geometry +\twocolitem{\doublehyphen{geometry}}{Sets the scanner geometry. Valid values are: \begin{itemize}\itemsep=0pt - \item parallel - \item equiangular - \item equilinear + \item \texttt{parallel} + \item \texttt{equiangular} + \item \texttt{equilinear} \end{itemize} +} - \item --nray - Number of samples per each detector +\twocolitem{\doublehyphen{nray}}{ Number of samples per each detector} - \item --rotangle - Sets the rotation amount as a multiple of pi. For parallel geometries use -a rotation angle of 1 and for equilinear and equiangular geometries use a rotation angle of 2. +\twocolitem{\doublehyphen{rotangle}}{The rotation angle as a multiple of pi. +For parallel geometries use a rotation angle of \texttt{1} and for equilinear and equiangular +geometries use a rotation angle of \texttt{2}. The default is to use to +appropriate rotation angle based on the geometry.} - \item --field-of-view - Sets the field of view as a ratio of the diameter of the phantom. For parallel geometries, using a value of 1.0 is fine. For other geometies, this should be at least 1.3 to avoid artifacts. +\twocolitem{\doublehyphen{view-ratio}}{Sets the field of view as a ratio of the diameter of the phantom. + For normal scanning, the default value of \texttt{1.0} is optimal.} - \item --focal-length - Sets the distance of the radiation source and detectors from the center of the object as a ratio of the radius of the object. For parallel geometries, a value of 1.0 is fine. For other geometries, this should be at least 2.0 to avoid artifacts. -\end{itemize} +\twocolitem{\doublehyphen{scan-ratio}}{Sets the length of scanning as a ratio of the view diameter. + For normal scanning, the default value of \texttt{1.0} is optimal.} + +\twocolitem{\doublehyphen{focal-length}}{Sets the distance between the radiation source + and the center of the object as a ratio of the radius of the object. + For parallel geometries, a value of \texttt{1.0} is optimal. For other + geometries, this should be at least \texttt{2.0} to avoid artifacts.} +\end{twocollist} -The Herman phantom is taken with permission from Gabor Hermans 1980 book\cite{HERMAN80}. The Shepp-Logan phantom was published in 1974\cite{SHEPP74}. -\section{phm2if}\label{phm2if}\index{ctsimtext,phm2if}% -Converts a geometric phantom object into an imagefile. The size of the -imagefile in pixels must be specified as well as the number of samples -to average per pixel. +\section{phm2if}\label{phm2if}\index{phm2if}% +Converts a geometric phantom object into an imagefile. \usage -\begin{itemize}\itemsep=0pt - \item --nsamples -\end{itemize} +\texttt{phm2if phantom-filename image-filename [options...]} -\section{pj2if}\label{pj2if}\index{ctsimtext,pj2if}% +\textbf{Options} +\begin{twocollist} + \twocolitem{\doublehyphen{nsamples}}{Number of samples in x \& y directions per pixel} + \twocolitem{\doublehyphen{view-ratio}}{Sets the view ration. For normal scanning, + the default value of \texttt{1.0} is optimal.} +\end{twocollist} + +\section{pj2if}\label{pj2if}\index{pj2if}% Convert a projection file into an imagefile. \usage -\begin{itemize}\itemsep=0pt -\item --help Print brief online help -\end{itemize} +\texttt{pj2if projection-filename image-filename x-size y-size [options...]} -\section{pjinfo}\label{pjinfo}\index{ctsimtext,pjinfo}% +\textbf{Options} +\begin{twocollist} +\twocolitem{\doublehyphen{dump}}{Print all projection data to the console.} +\end{twocollist} + +\section{pjinfo}\label{pjinfo}\index{pjinfo}% Displays information about a projection file. \usage +\texttt{pjinfo projection-filename [options...]} + +\textbf{Options} \begin{itemize}\itemsep=0pt - \item --binaryheader - \item --binaryview - \item --startview - \item --endview - \item --dump + \item \doublehyphen{binaryheader} - Dump the binary header to the standard output. + This option is only used when manually creating a composite projection file from + several different projection files. + \item \doublehyphen{binaryview} - Dump binary view data to the standard output. + This option is only used when manually creating a composite projection file from + several different projection files. + \item \doublehyphen{startview} - Sets starting view to display. Default is \texttt{0}. + \item \doublehyphen{endview} - Sets ending view to display. Default is the last view. + \item \doublehyphen{dump} - Print all projection data to the console. \end{itemize} -\section{pjrec}\label{pjrec}\index{ctsimtext,pjrec}% +\section{pjrec}\label{pjrec}\index{pjrec}% Reconstructs the interior of an object from a projection file. \usage +\texttt{pjrec projection-filename image-filename image-cols image-rows [options...]} + +\textbf{Options} + \begin{twocollist} -\twocolitemruled{{\bf Parameter}}{{\bf Options}} -\twocolitem{{\bf --filter}} -{Selects which filter to apply to each projection. To properly reconstruct an image, this filter should be multiplied -by the absolute value of distance from zero frequency. +\twocolitemruled{\textbf{Parameter}}{\textbf{Options}} +\twocolitem{\doublehyphen{filter}}{Selects which filter to apply to +each projection. To properly reconstruct an image, this filter +should be multiplied by the absolute value of distance from zero +frequency. \begin{itemize}\itemsep=0pt -\item abs\_bandlimit -\item abs\_cosine -\item abs\_hamming +\item \texttt{abs\_bandlimit} +\item \texttt{abs\_cosine} +\item \texttt{abs\_hamming} \end{itemize} -} -\twocolitem{{\bf --filter-parameter}}{Sets the alpha level for Hamming - window. At setting of 0.54, this equals the Hanning window.} - -\twocolitem{{\bf --filter-method}}{Selects the filtering method. For large numbers of detectors, {\tt rfftw} is optimal. For smaller numbers of detectors, {\tt convolution} might be a bit faster. +} \twocolitem{\doublehyphen{filter-parameter}}{Sets the alpha level +for Hamming window. At setting of \texttt{0.54}, this equals +the Hanning window.} + +\twocolitem{\doublehyphen{filter-method}}{Selects the filtering +method. For large numbers of detectors, \texttt{rfftw} is optimal. +For smaller numbers of detectors, \texttt{convolution} might be a +bit faster. \begin{itemize}\itemsep=0pt -\item convolution -\item fourier -\item fourier\_table -\item fftw -\item rfftw +\item \texttt{convolution} +\item \texttt{fourier} - Uses simple Fourier transform. +\item \texttt{fourier-table} - Optimizes Fourier transform by precalculating trigometric functions. +\item \texttt{fftw} - Uses complex-valued Fourier transform with the \emph{fftw} library. +\item \texttt{rfftw} - Uses optimized real/half-complex Fourier transform. \end{itemize} } +\end{twocollist} -\twocolitem{{\bf --filter-generation}}{Selects the filter generation. With convolution, {\tt direct} is the proper method to select. With any of the frequency methods, {\tt inverse-fourier} is the best method. +\begin{twocollist} +\twocolitem{\doublehyphen{filter-generation}}{Selects the filter +generation. With convolution, \texttt{direct} is the proper method +to select. With any of the frequency methods, +\texttt{inverse-fourier} is the best method. \begin{itemize}\itemsep=0pt -\item direct -\item inverse-fourier +\item \texttt{direct} +\item \texttt{inverse-fourier} \end{itemize} } -\twocolitem{{\bf --interpolation}}{Interpolation technique. {\tt linear} is optimal. + +\twocolitem{\doublehyphen{interpolation}}{Interpolation technique. +\texttt{cubic} is optimal when the +data is smooth. Smooth data is obtained by taking many projections and/or +using a smoothing filter. In the absence of smooth data, \texttt{linear} gives better results and +is many times faster than cubic interpolation. + \begin{itemize}\itemsep=0pt -\item nearest -\item linear +\item \texttt{nearest} +\item \texttt{linear} +\item \texttt{cubic} \end{itemize} -} -\twocolitem{{\bf -backprojection}}{Selects the backprojection technique. A setting of {\tt idiff3} is optimal. +} + +\twocolitem{\doublehyphen{backprojection}}{Selects the +backprojection technique. A setting of \texttt{idiff} is optimal. \begin{itemize}\itemsep=0pt -\item trig -\item table -\item diff -\item diff2 -\item idiff2 -\item idiff3 +\item \texttt{trig} - Use trigometric functions at each image point. +\item \texttt{table} - Use precalculated trigometric tables. +\item \texttt{diff} - Use difference method to iterate within image. +\item \texttt{idiff} - Use integer iteration math. \end{itemize} } -\twocolitem{{\bf --zeropad}}{ Zeropad factor. A setting of {\tt 1} is optimal.} -\twocolitem{{\bf --preinterpolate}}{Selects preinterpolation interpolation technique and sets the preinterpolation factor. Currently, this is experimental and does not work well.} +\twocolitem{\doublehyphen{zeropad}}{Zeropad factor. A setting of +\texttt{1} is optimal whereas a zeropad of \texttt{0} performs no zeropadding.} + \end{twocollist}