Description Usage Arguments Details Examples
Uses tkrplot to create an interactive slice view of three or four dimensional volume data.
1 2 3 |
vol1 |
a three or four dimensional real array. If two images are overlaid, then this is the one at bottom. |
vol2 |
a three or four dimensional real array. If two images are
overlaid, then this is the one on top. The default value is
|
rlim1 |
the minimum and maximum |
rlim2 |
the minimum and maximum |
col1 |
a list of colors for |
col2 |
a list of colors for |
main |
a character vector; main title for the plot. |
scale |
real value for scaling embedded plot size. |
alpha |
real value for transparency level, if two images are overlaid. The default value is 1. |
cross |
logical; if |
layout |
a character string specifying the layout. It must be
either "counterclockwise" or "clockwise", and may be abbreviated.
The default is "counterclockwise". Images corresponding to
the x-y planes are always displayed in the third quadrant.
If |
Shows slices of 3D array along the axes as produced by image
,
along with sliders for controlling which slices are shown. For 4D
data an additional slider selects the value of the fourth index.
Two images can be overlaid. This is useful for viewing medical imaging
data (e.g. PET scans and fMRI data).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #Example 1: View of a mixture of three tri-variate normal densities
nmix3 <- function(x, y, z, m, s) {
0.4 * dnorm(x, m, s) * dnorm(y, m, s) * dnorm(z, m, s) +
0.3 * dnorm(x, -m, s) * dnorm(y, -m, s) * dnorm(z, -m, s) +
0.3 * dnorm(x, m, s) * dnorm(y, -1.5 * m, s) * dnorm(z, m, s)
}
x<-seq(-2, 2, len=40)
g<-expand.grid(x = x, y = x, z = x)
v<-array(nmix3(g$x,g$y,g$z, .5,.5), c(40,40,40))
slices3d(vol1=v, main="View of a mixture of three tri-variate normals", col1=heat.colors(256))
## Not run:
#Example 2: Put a z-map from fMRI data on top of a structure
# image. The threshold value of the z-map is 2.
library(AnalyzeFMRI)
temp<-f.read.analyze.volume("standard.img")
z<-f.read.analyze.volume("z-map.img")
slices3d(vol1=temp, vol2=z[,,,1], rlim2=c(2,Inf),col2=heat.colors(20),
main="Regions above threshold values.")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.