Description Usage Arguments Value Examples
Generic function to apply a function to each volume of a four-dimensional image
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 | eachVolume(x, FUN, withIndex, mask, ...)
## S4 method for signature 'SparseBrainVector,'function',logical,missing'
eachVolume(x, FUN,
withIndex = FALSE, mask, ...)
## S4 method for signature 'SparseBrainVector,'function',missing,missing'
eachVolume(x, FUN,
withIndex, mask, ...)
## S4 method for signature
## 'SparseBrainVector,‘function',missing,LogicalBrainVolume’
eachVolume(x,
FUN, withIndex, mask, ...)
## S4 method for signature 'BrainVector,'function',missing,missing'
eachVolume(x, FUN, withIndex,
mask, ...)
## S4 method for signature 'BrainVector,'function',missing,BrainVolume'
eachVolume(x, FUN,
withIndex, mask, ...)
## S4 method for signature 'BrainVector,'function',missing,missing'
eachVolume(x, FUN, withIndex,
mask, ...)
## S4 method for signature 'BrainBucket,'function',missing,missing'
eachVolume(x, FUN, withIndex,
mask, ...)
## S4 method for signature 'BrainBucket,'function',logical,ANY'
eachVolume(x, FUN, withIndex,
mask, ...)
## S4 method for signature 'BrainVector,'function',logical,ANY'
eachVolume(x, FUN, withIndex,
mask, ...)
|
x |
four-dimensional image, e.g. of class |
FUN |
a |
withIndex |
whether the index of the volume supplied as the second argument to the function |
mask |
an image mask indicating subset of volume elements to apply function over |
... |
additional arguments |
a list
of results of apply FUN
to each volume.
1 2 3 4 | bvec <- BrainVector(array(rnorm(24*24*24*24), c(24,24,24,24)), BrainSpace(c(24,24,24,24), c(1,1,1)))
res <- eachVolume(bvec, mean)
res <- eachVolume(bvec, function(x,i) median(x), withIndex=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.