iradon: Direct Inverse Radon Transformation

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/iradon.r

Description

The function implements different direct reconstruction methods for a radon transformed two-dimensional image.

Usage

1
2
3
4
5
6
7
iradon(rData, XSamples, YSamples, mode = "FB", 
       Xmin = -sqrt(0.5)*(ncol(rData)/XSamples)*0.5*(XSamples-1), 
       Ymin = -sqrt(0.5)*(ncol(rData)/YSamples)*0.5*(YSamples-1), 
       DeltaX = sqrt(0.5)*(ncol(rData)/XSamples), 
       DeltaY = sqrt(0.5)*(ncol(rData)/YSamples), 
       InterPol=1, FilterTyp="Hamming1", oData=NULL, 
       DebugLevel="Normal", iniFile=NULL)

Arguments

rData

(matrix) A matrix that contains the sinogram image (for the reconstruction functions).

XSamples

(integer) Number of samples on the x-axis (rows) in the reconstructed image.

YSamples

(integer) Number of samples on the y-axis (columns) in the reconstructed image.

mode

(character) The reconstruction method. Default is mode="FB" for Filtered Backprojection. Also implemented are "BF" for Filtering After Backprojection, "CNF" for Central Slice (FFT based with Nearest Neighbour approximation), "CBF" for Central Slice (FFT based with Bilinear Interpolation), "CC" for using a variation of the Central Slice (by the use of nonlinear sampling of the Radon domain with the use of the Chirp-z algorithm, the interpolation can be reduced to a simple one dimensional linear interpolation compared to normal CS), "CNC" for Central Slice (Chirp-z based with Nearest Neighbour approximation), "CBC" for Central Slice (Chirp-z based with Bilinear Interpolation) and "Test" to run all available reconstruction routines on the same image and to compare with a L1-Norm and L2-Norm. In case of "Test" the surrender value is NULL.

Xmin

(double) The minimum x-position of the reconstructed image. Defaults to Xmin=-sqrt(0.5)*(ncol(rData)/XSamples)*0.5*(XSamples-1).

Ymin

(double) The minimum y-position of the reconstructed image. Defaults to Ymin=-sqrt(0.5)*(ncol(rData)/YSamples)*0.5*(YSamples-1).

DeltaX

(double) Sampling distance on the x-axis.
Defaults set to DeltaX = sqrt(0.5)*(ncol(rData)/XSamples).

DeltaY

(double) Sampling distance on the y-axis.
Defaults set to DeltaY = sqrt(0.5)*(ncol(rData)/YSamples).

InterPol

(integer) Interpolation level. Used by Filtered Backprojection. Defaults InterPol=1.

FilterTyp

(character) Filter type is only used by Filtered Backprojection ("FB"). Defaults to FilterTyp="Hamming1" for generalized Hamming Filter with α=0.5. The alternative choice is "Hamming2" for generalized Hamming Filter with α=0.54 or a "Ramp" to get very good results of data without noise.

oData

(matrix) If mode="Test", measures of misfit can be made between rData and oData. oData is the original image of the radon transformed data. Defaults to oData=NULL.

DebugLevel

(character) This parameter controls the level of output. Defaults to DebugLevel="Normal" for a standard level output. Alternative implementations are "Detail" if it is desirable to show almost all output on screen or "HardCore" for no information at all.

iniFile

(character) If iniFile!=NULL, iniFile has to be the name of an ini-file including a pathname to the file. In the case of a specified iniFile all parameters are read from the file. Note that in this case contingently setting parameters (except for DebugLevel) in R are ignored when calling iradon. The parameters which are not specified in iniFile are set to defaults. Defaults to iniFile=NULL.

Details

The function implements different direct reconstruction methods for a radon transformed two-dimensional image. The different methods will be specified with parameter mode. The reconstruction methods are developed by P. Toft (1996) and implemented in R by J. Schulz (2006). For detail theoretical information about the radon-transformation see references.
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.

Another variation to determine the parameter is the offer with iniFile. iniFile has to be a name of a file (e.g. iniFile="/home/work/sino.ini") with the following structure. Each line begins with the name of 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 oData both have 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 oData (see ?readData or ?writeData in R to get more information about these formats), the parameters XSamples, YSamples, XMin, YMin, DeltaX and DeltaY will be read from the file-header, but only in the case of unspecified corresponding parameters.
Note that in the case of an ini-file contingently setting parameters (except for DebugLevel) in R are ignored with the calling of iradon. Parameters that are not specified in the iniFile are set to default.

Value

irData

A matrix, that contains the reconstructed image (matrix) of rData.

Header

A list of following values:

SignalDim

The dimension of the irData.

XYmin

The minimum x- and y-position in irData.

DeltaXY

Sampling distance on the x- and y-axis in irData.

call

Arguments of the call to iradon.

Author(s)

Joern Schulz jschulz78@web.de, Peter Toft.

References

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.

See Also

radon, iradonIT

Examples

 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
38
39
40
41
42
43
44
45
#    
# Compare the results of different direct reconstruction methods
#
## Not run: 
P <- phantom(design="B")
rP <- markPoisson(P, nSample=3000000 )
irP1 <- iradon(rP$rData , nrow(P), ncol(P))
irP2 <- iradon(rP$rData , nrow(P), ncol(P), 
        mode="BF", DebugLevel="HardCore")
irP3 <- iradon(rP$rData , nrow(P), ncol(P), 
        mode="CBF", DebugLevel="HardCore")
viewData(list(rP$rData, irP1$irData, irP2$irData, irP3$irData),
         list("Generated PET Data", "Reconstruction: mode='FB'", 
         "Reconstruction: mode='BF'", "Reconstruction: mode='CBF'"))
rm(irP1,irP2,irP3,P,rP)

## End(Not run)

#    
# Compare the results of different values for RhoSamples in 'markPoisson'
#
## Not run: 
P <- phantom()
rP1 <- markPoisson(P, nSample=1000000, RhoSamples=101, image=FALSE)
rP2 <- markPoisson(P, nSample=1000000, RhoSamples=256, image=FALSE)
rP3 <- markPoisson(P, nSample=1000000, RhoSamples=501, image=FALSE)
rP4 <- markPoisson(P, nSample=1000000, RhoSamples=801, image=FALSE)
irP1 <- iradon(rP1$rData, 257, 257)
irP2 <- iradon(rP2$rData, 257, 257, DebugLevel="HardCore")
irP3 <- iradon(rP3$rData, 257, 257, DebugLevel="HardCore")
irP4 <- iradon(rP4$rData, 257, 257, DebugLevel="HardCore")
viewData(list(irP1$irData, irP2$irData, irP3$irData, irP4$irData,),
         list("RhoSamples=101",  "RhoSamples=256", "RhoSamples=501",
         "RhoSamples=801"))
rm(P,rP1,rP2,rP3,rP4,irP1,irP2,irP3,irP4)

## End(Not run)

# 
# mode="Test"
#
P <- phantom()
R <- radon(P)
iradon(R$rData, XSamples=257, YSamples=257, mode="Test", oData=P)
rm(P,R)

PET documentation built on May 2, 2019, 2:43 a.m.