Buffers region geometry outward, so structures too thin to read at plotting size survive. This is the post-creation counterpart of the snapshot-stage dilation the atlas pipelines used to apply: it works on the finished atlas, so a build does not have to be repeated to retune it.
Arguments
- atlas
A
ggseg_atlasobject with 2D geometry.- amount
Buffer distance in geometry units. Positive grows a region, negative shrinks it,
0returns the atlas unchanged.- labels, exclude
Which labels to dilate, or which to leave alone: a regular expression, or a function that takes the atlas and returns one. Pass
context_pattern, without calling it, to select the atlas's context. Give at most one.
Details
amount is a distance in the atlas's own geometry units, not voxels or
pixels. Start small and look: a value that reads well on one atlas will
not transfer to another built on a different grid.
Dilate the structures, not the anatomical context. Grown by even a little,
a grey brain silhouette closes its sulci and flattens into a blob, so pass
exclude (or labels) to keep it out.
See also
atlas_smooth() and atlas_simplify(), the other post-creation
geometry steps.
Other atlas geometry:
atlas_polish(),
atlas_simplify(),
atlas_smooth(),
count_vertices()
Examples
dk <- ggseg.formats::dk()
# Grow the structures and leave the grey brain alone
atlas_dilate(dk, 0.5, exclude = context_pattern)
#>
#> ── dk ggseg atlas ──────────────────────────────────────────────────────────────
#> Type: cortical
#> Regions: 35
#> Hemispheres: left, right
#> Views: inferior, lateral, medial, superior
#> Palette: ✔
#> Rendering: ✔ ggseg
#> ✔ ggseg3d (vertices)
#> ────────────────────────────────────────────────────────────────────────────────
#> hemi region label
#> 1 left bankssts lh_bankssts
#> 2 left caudalanteriorcingulate lh_caudalanteriorcingulate
#> 3 left caudalmiddlefrontal lh_caudalmiddlefrontal
#> 4 left corpuscallosum lh_corpuscallosum
#> 5 left cuneus lh_cuneus
#> 6 left entorhinal lh_entorhinal
#> 7 left fusiform lh_fusiform
#> 8 left inferiorparietal lh_inferiorparietal
#> 9 left inferiortemporal lh_inferiortemporal
#> 10 left isthmuscingulate lh_isthmuscingulate
#> display lobe
#> 1 banks of superior temporal sulcus temporal
#> 2 caudal anterior cingulate cingulate
#> 3 caudal middle frontal frontal
#> 4 corpus callosum white matter
#> 5 cuneus occipital
#> 6 entorhinal temporal
#> 7 fusiform temporal
#> 8 inferior parietal parietal
#> 9 inferior temporal temporal
#> 10 isthmus cingulate cingulate
#> ... with 60 more rows