iniPetFifList: Initializes a Header for PET or FIF File

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

View source: R/iniPetFifList.r

Description

The function initializes a list with values that corresponds to a header of a ".pet" or a ".fif" file. The file structures of these formats are explicitly described in the functions readData and writeData of this package.

Usage

1
iniPetFifList(listType = "pet", data = NULL, imType = "normal")

Arguments

listType

Can be chosen between "pet" and "fif". Default is listType = "pet" to generate a default header for ".pet"-files. Choose listType = "fif" to generate a default header for ".fif"-files.

data

Using data, it is possible to consign the matrix corresponding to the list and to generate the parameters SignalDim, XYmin, DeltaXY and SignalMinMax with default values. Otherwise, if data = NULL these values will be set to NULL and you will have to specify these values.

imType

(character) imType specifies the type of image and thus the default values of the list. Default is imType="normal". It is also implemented imType="radon", i.e. that the image is a sinogram (radon transformed image).

Details

Set listType="pet" to generate a list with the following structure. It is assumed that data is a matrix and not equal to NULL.

Description Contains a short description of the image. The maximal number
of characters has to be 80. Defaults to Description="}\eqn{\backslash 0}{\0}\code{".
SignalDim Contains the number of rows and columns of the matrix.
Defaults to SignalDim=dim(data).
XYmin Leftmost coordinate and lowest coordinate in the original
image. If imType="normal" then defaults to XYmin=
-0.5*(dim(data)-1) or if imType="radon" then
defaults to XYmin=c(0, -0.5*(ncol(data)-1)).
DeltaXY Quantization steps in the original image in x and y direction.
If imType="normal" then defaults to DeltaXY=c(1,1)
or if imType="radon" then defaults to DeltaXY=
c(pi/(nrow(data)),1).

Set listType="fif" to generate a list, with the following structure. It is assumed that data is a matrix and not equal to NULL.

FIFIdType ID used to restore FIF:17737:'\0''\0''E''I'. Defaults to
FIFIdType=17737.
FileName Name used for saving/restoring this image. Defaults to
FileName="}\eqn{\backslash 0}{\0}\code{".
Description See above.
Date Date (YYYY-MM-DD). Defaults to Date=
as.character(Sys.Date()).
SignalDim See above.
ArrayType Defines the format number. 1 for Real and 2 for Complex.
Complex matrices are determined by A=a_{i,j}
where a_{i,2n} is the imaginary part to the real value
a_{i,2n-1}, i=1,…,M, j=1,…,2N, n=1,…,N.
Defaults to ArrayType=1.
XYmin See above.
DeltaXY See above.
SignalMinMax The lowest and highest signal value in the matrix. Defaults
to SignalMinMax=c(min(data), max(data)).

Value

Returns a list with above structure.

Author(s)

Joern Schulz jschulz78@web.de, Peter Toft.

See Also

writeData, readData

Examples

1
2
3
4
A <- phantom()
PetList <- iniPetFifList(data = A, imType = "normal")
PetList
rm(A,PetList)

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