pial surfaces from an intensity volumeStarting from a single closed surface mesh (typically a smoothed estimate
of the white-matter boundary, in the same physical coordinate space as
volume) and a co-registered intensity volume (such as a normalized
T1 scan), iteratively deforms the surface in two passes to localize
the white/gray-matter and gray-matter/CSF tissue-intensity
boundaries, producing a white and a pial surface.
mris_make_surfaces(
mesh,
volume,
white_intensity,
pial_intensity,
IJK2RAS = NULL,
max_thickness = 5,
step_size = 0.4,
n_averages = 4L,
niterations = 10L,
l_intensity = 1,
l_spring = 0.5,
momentum = 0.9,
dt = 0.5,
verbose = FALSE
)A named list of two 'mesh3d' surfaces (each with
vb, it, and normals):
whiteSurface localized to white_intensity.
pialSurface localized to pial_intensity, continuing
from white.
triangular mesh of class 'mesh3d' (or coercible via
ensure_mesh3d), in the same physical (RAS) coordinate
space as volume. As with mris_inflate, the mesh
must be closed, manifold, and genus-0 (watertight, no boundary or
non-manifold edges, single connected component); mris_make_surfaces
raises an error if such defects are detected
a 3-dimensional numeric array of image intensities (such as
a normalized T1 volume), co-registered with mesh
target intensity for the white/gray-matter boundary;
the value the white-surface pass searches for along each vertex normal. For
a normalized T1 volume this is typically close to the midpoint
between the white-matter and gray-matter intensities
target intensity for the gray-matter/CSF
boundary, analogous to white_intensity for the pial-surface pass
volume IJK (zero-indexed voxel index) to surface
tkrRAS transform (a 4x4 matrix); default is NULL,
which assumes volume is a conformed volume (LIA orientation,
1mm isotropic 'voxels', centered at the volume midpoint, the same
convention fill_surface defaults to) and derives the
transform from dim(volume); set this explicitly when volume
uses a different orientation or voxel size
half-width, in mm, of the per-vertex normal
search window the intensity-target term samples. Default 5
sampling step, in mm, along the search window.
Default 0.4
number of 1-ring gradient-averaging passes applied to the
intensity-target gradient before the smoothness term is added (mirrors
mris_inflate's gradient-averaging step). Default 4
number of deformation iterations per pass
(white, then pial). Default 10
intensity-target term coefficient. Default 1.0
smoothness (1-ring Laplacian spring) term coefficient.
Default 0.5
momentum coefficient. Default 0.9
time step. Default 0.5
logical; print per-pass progress. Default FALSE
The implementation keeps the two dominant ideas of the surface-placement procedure described in the literature (see References):
Intensity-target localization: for each vertex, sample
volume along the vertex's current normal at offsets spanning
\(\pm\)max_thickness in steps of step_size, and pull
the vertex toward the offset whose sampled intensity is closest to a
single target value (white_intensity for the white-surface pass,
pial_intensity for the pial-surface pass).
Smoothness: a 1-ring Laplacian spring keeps the mesh regular while the per-vertex intensity term, which reacts independently to noisy image data, pulls vertices toward the tissue boundary.
Both terms are integrated with the same gradient-averaging and
momentum-integration machinery mris_inflate and
mris_sphere use: each inner iteration clears the gradient,
adds the intensity-target term, smooths it over n_averages passes of
1-ring averaging, adds the locally-acting smoothness term (which is not
itself smoothed),
then takes a momentum-integration step with a 1 mm per-step
displacement cap, and refreshes the vertex normals.
The white-surface pass runs first, for niterations iterations; the
pial-surface pass then continues from its result, with the momentum
velocity reset to rest, toward pial_intensity for another
niterations iterations.
This is a reduced port: the literature's procedure is a
multi-resolution optimization over roughly seven weighted energy terms
(intensity, intensity gradient, smoothness, self-intersection repulsion,
curvature, and more), using per-vertex gray/white/CSF intensity
statistics derived from a prior segmentation. Reproducing that faithfully
is out of scope for this package; white_intensity and
pial_intensity are supplied directly here instead, for example the
midpoints between the typical white-matter/gray-matter and
gray-matter/CSF intensities of volume.
Cortical surface-based analysis I: Segmentation and surface reconstruction. NeuroImage, 9(2), 179-194 (1999).
if (is_not_cran()) {
data("left_hippocampus_mask")
n_vox <- length(left_hippocampus_mask)
volume <- left_hippocampus_mask + runif(n = n_vox, 0, 1)
vox2ras <- diag(1, 4)
mesh <- vcg_isosurface(volume, threshold_lb = 0.99)
plot(mesh)
# Fix defects
mesh <- vcg_fix_defects(mesh, verbose = TRUE, merge_tolerance = 1.75)
res <- mris_make_surfaces(
mesh,
volume,
pial_intensity = 1.1,
white_intensity = 1,
IJK2RAS = vox2ras
)
plot(res$pial)
}
Run the code above in your browser using DataLab