
Last chance! 50% off unlimited learning
Sale ends in
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.
phantom(n = 257, design = "A", addIm = "none", DebugLevel = "Normal")
(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
.
(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"
.
(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"
.
(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.
Returns a phantom image.
design
:
To define an own design of the phantom (e.g. design=P
) you have to note the following conditions:
P
is a
All elements P
have to be between -1 and 1.
Each row from P
define a ellipse on
[,1] | |
Is the additive intensity of the corresponding ellipse. |
[,2] | |
Is the |
[,3] | |
Is the |
[,4] | |
Is the half length of the horizontal axis. |
[,5] | |
Is the half length of the vertical axis. |
[,6] | |
Is the angle in degree between the |
and the |
||
but the number of columns have to be the same in all rows. |
# NOT RUN {
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)
# }
Run the code above in your browser using DataLab