Learn R Programming

FIACH (version 0.1.2)

kmeansMask: Binarize vector, matrix or array

Description

This function creates a mask for an image using kmeans clustering.

Usage

kmeansMask(x)

Arguments

x
x can be a vector,matrix or array.

Value

returns a binary vector, matrix or array of zeros and ones.

Examples

Run this code
file<-system.file("extdata","motion_ex.nii.gz",package="FIACH")
arr<-readNii(file)[,,,1]
mask<-kmeansMask(arr)

Run the code above in your browser using DataLab