View source: R/whitestripe_ind.R
whitestripe | R Documentation |
Returns the mean/sd of the whitestripe and indices for them on the image
whitestripe(
img,
type = c("T1", "T2", "FA", "MD", "first", "last", "largest"),
breaks = 2000,
whitestripe.width = 0.05,
whitestripe.width.l = whitestripe.width,
whitestripe.width.u = whitestripe.width,
arr.ind = FALSE,
verbose = TRUE,
stripped = FALSE,
slices = NULL,
...
)
img |
Image (T1, T2, FA, or MD). Array or object of class nifti |
type |
T1, T2, FA, or MD image whitestripe |
breaks |
Number of breaks passed to |
whitestripe.width |
Radius of the white stripe |
whitestripe.width.l |
Lower Radius of the white stripe |
whitestripe.width.u |
Upper Radius of the white stripe |
arr.ind |
Whether indices should be array notation or not,
passed to |
verbose |
Print diagnostic information |
stripped |
Applying to skull-stripped image. NOTE: This does NOT do a
subset of slices, as |
slices |
slices to use for |
... |
Arguments to be passed to |
This function takes in an image and computes a window of the
distribution called the white stripe. If you wish to pass in values you have
subset, such as single from a skull-stripped image, you can pass in img
and set the class to img_voi
(class(img) = "img_voi"
) and this
will not rerun make_img_voi
.
List of indices of whitestripe, last mode of histogram, array/nifti of 0/1 corresponding to the mask, mean of whitestripe, standard deviation of whitestripe
## Not run:
library(WhiteStripe)
lib.loc = tempdir()
if (WhiteStripe::download_img_data(lib.loc = lib.loc)){
library(oro.nifti)
set.seed(1)
t1 = readNIfTI(system.file("T1Strip.nii.gz", package="WhiteStripe",
lib.loc = lib.loc))
t1.ind = whitestripe(t1, "T1")
set.seed(2)
t1_2 = readNIfTI(system.file("T1Strip.nii.gz", package="WhiteStripe",
lib.loc = lib.loc))
t1_2.ind = whitestripe(t1_2, "T1")
t1.mask = whitestripe_ind_to_mask(t1, t1.ind$whitestripe.ind)
t1.mask[t1.mask == 0] = NA
orthographic(t1, t1.mask, col.y="red")
t2 = readNIfTI(system.file("T2Strip.nii.gz", package="WhiteStripe",
lib.loc = lib.loc))
t2.ind = whitestripe(t2, "T2")
t2.mask = whitestripe_ind_to_mask(t2, t2.ind$whitestripe.ind)
t2.mask[t2.mask == 0] = NA
orthographic(t2, t2.mask, col.y="red")
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.