arraytrim: Trim excess white-space (0 planes) from a 3D binary array.
Description
A helper function for reducing the size of 3D arrays if necessary. This reduction can improve memory utilization and speed processing, since voxels outside the feature of interest are eliminated.
Usage
arraytrim(VOLOBJ = NULL)
Value
The output is an array with the excess outter zero planes removed.
Arguments
VOLOBJ
This is a 3D binary (0,1) numeric array, which represent voxels. If there are outter margins that are all zeros, they will be trimmed off to reduce the size of the array.
Author
Tarmo K. Remmel
Details
The function scans inward, starting at the outer margins, for planes that are all zeros. If they are, those planes will be trimmed at the end. Only planes of zeros that connect contiguously to the outer margins will be trimmed.
References
Remmel, T.K. 2022. Extending morphological pattern analysis to 3D voxels. Landscape Ecology 37(2):373-380.