Build subcortical slabs from a label bounding box
Source:R/subcortical_builders.R
subcortical_slabs.RdComputes evenly spaced coronal, axial and/or sagittal slabs spanning the
bounding box of the requested labels, ready to pass as the slabs
argument of create_subcortical_from_volume().
subcortical_views() was renamed to subcortical_slabs() to match the
slabs argument of create_subcortical_from_volume() and
create_tract_from_tractography().
Usage
subcortical_slabs(
volume,
labels,
coronal = 0,
axial = 0,
sagittal = 0,
pad = 0,
reorient = TRUE
)
subcortical_views(
volume,
labels,
coronal = 0,
axial = 0,
sagittal = 0,
pad = 0,
reorient = TRUE
)Arguments
- volume
Path to a label volume, or an integer array already in the builder's frame.
- labels
Integer label ids whose combined bounding box frames the slabs.
- coronal, axial, sagittal
Number of slabs to produce for each orientation (
0= none).- pad
Voxels by which to expand the bounding box before slabbing.
- reorient
Passed to the internal volume reader; must match the value
create_subcortical_from_volume()uses (defaultTRUE).
Details
The volume is read with the same axis reorientation the builder uses
internally, so the returned slab indices are in the projection frame. This
avoids a subtle trap: RNifti::readNifti() and the builder's reader can
return different axis orders, so a bounding box computed from the RNifti
array points the slabs at the wrong slices (silently producing empty
views). Always derive slabs with this function rather than indexing the
volume by hand.