phantom: Creation of a Phantom

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

View source: R/phantom.r

Description

This function creates two dimensional phantom data. There are different options, e.g. to generate a big ellipse that represents the head, and several smaller ellipses, that represent pathological areas to be located in the space of the bigger ellipse.

Usage

1
phantom(n = 257, design = "A", addIm = "none", DebugLevel = "Normal")

Arguments

n

(integer) Is the number of columns and rows in the generated phantom. It is assumed that the number of columns is equal to the number of rows. Defaults to n=257.

design

(character) design characterizes the phantom data. It is possible to define different ellipses, with different intensities. There are four default-designs, these are design = "A", "B", "C" and "D". To define an own design of the phantom see below to details. Defaults to design = "A".

addIm

(character) Adds an additional image to the phantom. There are six default-designs for addIm. These are addIm="blurred1", "blurred2", "keen1", "keen2", "simple1" and "simple2". The defaults of addIm will be generated with the function partEllipse. If addIm="none", no image will be added to the phantom. A further possibility is a matrix A (addIm=A) with the same size as the phantom (i.e. dim(A)==c(n,n)). Defaults to addIm = "none".

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.

Details

design:

To define an own design of the phantom (e.g. design=P) you have to note the following conditions:

  1. P is a (n,5) or (n,6) matrix, whereas n > 0.

  2. All elements x of P have to be between -1 and 1.

  3. Each row from P define a ellipse on [-1,1]^2, where

[,1] A Is the additive intensity of the corresponding ellipse.
[,2] x_0 Is the x-coordinate of the center of the ellipse.
[,3] y_0 Is the y-coordinate of the center of the ellipse.
[,4] a Is the half length of the horizontal axis.
[,5] b Is the half length of the vertical axis.
[,6] α Is the angle in degree between the x-axis of the ellipse
and the x-axis of the grid. This parameter is optional,
but the number of columns have to be the same in all rows.

Value

Returns a phantom image.

Author(s)

Joern Schulz jschulz78@web.de.

See Also

partEllipse, markPoisson

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
P1 <- phantom()
P2 <- phantom(addIm="blurred1")
PhPa1 <- c(0.5, 0, 0, 0.4, 0.6)
PhPa2 <- matrix( c(0.6, -0.35, 0, 0.4, 0.6,
         0.3,  0.5,  0, 0.2, 0.35), nrow=2, byrow=TRUE )
P3 <- phantom(design=PhPa1)
P4 <- phantom(design=PhPa2)
viewData(list(P1, P2, P3, P4), list("Default Phantom",  
         "addIm='blurred1'", "First new design",
         "Second new design"))
rm(P1,P2,P3,P4,PhPa1,PhPa2)

Example output

Loading required package: adimpro
Loading required package: awsMethods

Use the function setCores() to change the number of CPU cores.

sh: 1: cannot create /dev/null: Permission denied
sh: 1: cannot create /dev/null: Permission denied
sh: 1: cannot create /dev/null: Permission denied
Reading RAW images requires to install dcraw, see 

    http://cybercom.net/~dcoffin/dcraw/ for LINUX and http://www.insflug.org/raw/ 
    for MAC OS and Windows 


Attaching package: 'PET'

The following object is masked from 'package:base':

    norm

Warning message:
In fun(libname, pkgname) : could not determine path to Imagemagick 

    please set the correct path manually using 

    'Sys.setenv(ImageMagick='path2imagemagick')'
Creation of the source-data --> complete. 
Creation of the source-data --> Start of function halfCircle. 
The calculation need a few of minutes --> complete. 
complete. 
Creation of the source-data --> complete. 
Creation of the source-data --> complete. 

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