do.mask | R Documentation |
Mask/unmask the voxels of your niftiXd object
do.mask(x, mask, thresh=0, output.prefix=NULL) do.unmask(x, return.niftiXd=TRUE)
x |
|
mask |
A vector |
thresh |
If the mask isn't logical, what values should we threshold it at (default: 0) |
output.prefix |
if you have big.niftiXd object that is file-backed, you can specify this option |
return.niftiXd |
Whether or not to return a niftiXd type object
(doesn't apply to big.niftiXd objects) for |
Masking a niftiXd object involves including only those columns (voxels) that
are specified as TRUE or above a given threshold in the input mask
.
The benefit of using this function over just x[,mask]
is that it will
keep a record of the regions that were masked, allowing you to go back to the
original structure with do.unmask
or easily save your file in the
appropriate dimensions with write.nifti
.
The mask
input argument can have a length that is:
(1) equal to the total number of voxels in the original nifti image
(2) equal to the number of columns or elements in your input x
Note that columns or elements in a niftiXd
correspond to different
voxels in 3D space.
The do.unmask
function puts back the columns or vector elements that
were previously masked. The values of these new elements will be set to 0.
A masked niftiXd
object for mask
and unmask
;
Zarrar Shehzad
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.