Description Usage Arguments Details Value Author(s) References See Also Examples
The function implements three of the major iterative reconstruction techniques: ART (Algebraic Reconstruction Technique), EM (Likelihood Reconstruction using Expectation Maximization) and LSCG (Least Squares Conjugate Method).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | iradonIT(rData, XSamples, YSamples, StartImage = "None",
mode = "EM", UseFast = 1, RadonKernel = "NN",
Iterations = 20, IterationsType = "random",
SaveIterations = 0, SaveIterationsName = "",
LowestALevel = 0, ConstrainMin = -1,
ConstrainMax = -1, Alpha = 1, Beta = 1,
Regularization = 0, KernelFileSave = 0,
KernelFileName = "", RefFileName = "None",
ThetaSamples = nrow(rData), RhoSamples = ncol(rData),
ThetaMin = 0, RhoMin = -0.5*((2*round(sqrt(XSamples^2+
YSamples^2)/2)+1)-1), DeltaTheta = pi/ThetaSamples,
DeltaRho = (2*abs(RhoMin)+1)/RhoSamples,
Xmin = -0.5*(XSamples-1), Ymin = -0.5*(YSamples-1),
DeltaX = 1, DeltaY = 1, OverSamp = 0,
DebugLevel = "Normal", iniFile = NULL)
|
rData |
(matrix) A matrix that contains the sinogram. The rows of the image correspond to the sampled angles θ and the columns correspond to the sampled distance ρ. These both parameters determine the lines. |
XSamples |
(integer) |
YSamples |
(integer) |
StartImage |
(matrix) If provided, then the initial guess on the reconstructed image is taken from this image, otherwise a constant solution will be assumed from the start. Default is set to |
mode |
(character) The iterative reconstruction method. Default is |
UseFast |
(logical) If |
RadonKernel |
(character) The type of kernel is used to model the system matrix. Default is |
Iterations |
(integer) Using |
IterationsType |
(character) Using |
SaveIterations |
(integer) If it is set to |
SaveIterationsName |
(character) In case of |
LowestALevel |
(double) If fast reconstruction is used, the matrix elements will be truncated to this level relatively to the sampling distance of x. Defaults to |
ConstrainMin |
(double) After each iteration the solution in each sample will be forced above this limit. Defaults to |
ConstrainMax |
(double) After each iteration the solution in each sample will be forced below this limit. Defaults to |
Alpha |
(double) If |
Beta |
(double) If |
Regularization |
(double) If the Regularization is not zero and positive and using fast reconstruction, rows will be appended to the system matrix with a simple Laplace operator. A weight factor should also be incorporated. If negative, identity matrix will be used. Defaults to |
KernelFileSave |
(logical) If |
KernelFileName |
(character) If fast reconstruction is used, the system matrix will be saved and restored with this sif-name. If the system matrix is incompatible to the sampling parameters, a new one will be generated. KernelFileName contains the path to the filename and the filename. The path contains the path relatively to the working-directory of your R-session or it contains the full path to the file. Defaults to |
RefFileName |
(character) Error measures can be made between the image which is contained in |
ThetaSamples |
(integer) Number of angular samples θ in the sinogram. |
RhoSamples |
(integer) Number of samples in the sinogram ρ in the ρ-direction. Defaults to |
ThetaMin |
(double) Start of the angular sampling (should be set to zero). Defaults to |
RhoMin |
(double) Start of sampling positions in rho. |
DeltaTheta |
(double) Angular sampling distance. Should be set to the default |
DeltaRho |
(double) Sampling distance in rho. Defaults to |
Xmin |
(double) The minimum x-position of the reconstructed image. Defaults to |
Ymin |
(double) The minimum y-position of the reconstructed image. Defaults to |
DeltaX |
(double) Sampling distance on the x-axis. Defaults to |
DeltaY |
(double) Sampling distance on the y-axis. Defaults to |
OverSamp |
(integer) Uses oversampling - squared number of samples are used. Defaults to |
DebugLevel |
(character) This parameter controls the level of output. Defaults to |
iniFile |
(character) If |
The function implements three of the major iterative reconstruction techniques: ART (Algebraic Reconstruction Technique), EM (Likelihood Reconstruction using Expectation Maximization) and LSCG (Least Squares Conjugate Method). The reconstruction methods were developed by P. Toft (1996) and implemented in R by J. Schulz (2006). For detailed theoretical information about the Radon-transformation see references.
There are a lot of different parameters which influence the reconstruction method. In common cases, it should be enough to determine rData
, XSamples
and YSamples
. For the default parameters, it is assumed that the sinogram is standardised to a coordinate system with theta from 0 to π and rho from -0.5*((2*round(sqrt(M^2+N^2)/2)+1)-1) to 0.5*((2*round(sqrt(M^2+N^2)/2)+1)-1). It is also assumed that the reconstructed image is standardised to a coordinate system with x from -0.5*(M-1) to 0.5*(M-1) and y from -0.5*(N-1) to 0.5*(N-1). R, M and N are the number of sampling parameters in ρ, x and y. If that is not true, you will have to adapt the parameters.
Several things must be fulfilled to ensure a reasonable performance. Firstly sampling must be adequate in all parameters (see to references to get detail information). This will imply bounds on the sampling intervals. Secondly it is assumed that the fundamental function f(x,y) to be reconstructed have compact support, or more precisely is zero if sqrt(x^2+y^2) > |rho_{max}|. This demand will ensure that Rf(rho,theta)=0, if |rho|>|rho_{max}|. If this cannot be fulfilled, numerical problems must be expected.
Assuming that f(x,y) has compact support, then (x,y)=(0,0) should be placed to minimize |rho_{max}|. This will reduce the size of the data array used for the discrete Radon transform.
The numerical complexity of the procedure is mainly determined by Iterations
, the size of rData
, XSamples
, YSamples
and by the use of fast reconstruction method.
Fast reconstruction is used in case of UseFast=1
. It is possible to store the computed system matrix (KernelFileSave=1
) under the name KernelFileName
. The speed of the reconstruction can obviously be increased by using of an existing system matrix. NOTE: This is only possible, if the sampling parameters are compatible with the system matrix. That means, that the fifteen parameters XSamples
, YSamples
, DeltaX
, DeltaY
, Xmin
, Ymin
, ThetaSamples
, RhoSamples
, DeltaRho
, DeltaTheta
, ThetaMin
, RhoMin
, LowestALevel
, RadonKernel
and OverSamp
are equal to the parameter from which the system matrix is generated. If the system matrix is incompatible to the sampling parameters, a new one will be generated.
Another variation to determine the parameter is the offer with iniFile
. iniFile
has to be the name of a file (e.g. iniFile="/home/work/sino.ini"
) with the following structure. Each line contains at first the name of a parameter, then an equal sign follows and the value of the parameter. The first line must contain the parameter mode
. Characters are not written in ""
, e.g. RadonKernel=NN
and not RadonKernel="NN"
. Furthermore note that in an ini-file rData
and StartImage
are to be of type character, videlicet the name of the corresponding file. Supported file formats are ".txt", ".dat", ".fif", ".pet", ".tif", ".tiff", ".pgm", ".ppm", ".png", ".pnm", ".gif", ".jpg", ".jpeg". See ?readData
to get detailed information about supported formats.
If a file of the type ".fif", ".pet" or ".dat" is specified for rData
(see ?writeData
or ?readData
in R to get more information about these formats), the parameters ThetaSamples
, RhoSamples
, ThetaMin
, RhoMin
, DeltaTheta
and DeltaRho
will be read from the file-header of rData
, but only in case of unspecified corresponding parameters. Just as, if a file of type ".fif", ".pet" or ".dat" is specified for StartImage
, then the parameters XSamples
, YSamples
, XMin
, YMin
, DeltaX
and DeltaY
will be read from the file-header.
Note that in case of an ini-file, contingently setting parameters (except for DebugLevel
) in R are ignored when calling iradonIT
. Parameters that are not specified in the iniFile
are set to defaults.
irData |
A matrix, that contains the reconstructed image (matrix) of |
Header |
A list of following values:
|
call |
Arguments of the call to |
Joern Schulz jschulz78@web.de, Peter Toft.
Toft, Peter, Ph.D. Thesis, The Radon Transform - Theory and Implementation, Department of Mathematical Modelling Section for Digital Signal Processing, Technical University of Denmark, 1996.
http://eivind.imm.dtu.dk/staff/ptoft/ptoft_papers.html
Schulz, Joern, Diploma Thesis: Analyse von PET Daten unter Einsatz adaptiver Glaettungsverfahren, Humboldt-Universitaet zu Berlin, Institut fuer Mathematik, 2006.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | #
# Compare the results of iterative reconstruction method "EM" and
# direct reconstruction method "FB"
#
## Not run:
P <- phantom(design="B")
rP <- markPoisson(P, nSample=1600000 )
irP1 <- iradon(rP$rData , nrow(P), ncol(P))
irP2 <- iradonIT(rP$rData , nrow(P), ncol(P))
viewData(list(P, rP$rData, irP1$irData, irP2$irData),
list("Generated unnoisy Phantom", "Generated PET Data",
"Direct rec.: mode='FB'", "Iterative rec.: mode='EM'"))
rm(irP1,irP2,P,rP)
## End(Not run)
#
# Compare the results from the iterative reconstruction methods "EM"
# "CG" and "ART"
#
## Not run:
P <- phantom(n=151, addIm="blurred1")
rP <- markPoisson(P, nSample=2000000, RhoSamples=401)
irP1 <- iradonIT(rP$rData , nrow(P), ncol(P), Iterations=20,
ConstrainMin=0, ConstrainMax=10)
irP2 <- iradonIT(rP$rData , nrow(P), ncol(P), mode="CG",
Iterations=4, ConstrainMin=0, ConstrainMax=10)
irP3 <- iradonIT(rP$rData , nrow(P), ncol(P), mode="ART",
Iterations=5, ConstrainMin=0, ConstrainMax=10,
Alpha=0.1, Beta=0.5)
viewData(list(P,irP1$irData,irP2$irData,irP3$irData),
list("Generated unnoisy Phantom",
"mode='EM', Iterations=20","mode='CG', Iterations=4",
"mode='ART', Iter.=20, Alpha=0.1, Beta=0.5"))
rm(irP1,irP2,irP3,P,rP)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.