Replaces the colour palette of a brain atlas, validating that value is a
named character vector and warning if it does not cover every atlas label.
This is the setter counterpart to the atlas_palette() accessor; it returns
the modified atlas, so it composes with the pipe.
See also
atlas_palette() to read the palette.
Examples
a <- aseg()
labs <- atlas_labels(a)
a <- set_atlas_palette(a, setNames(grDevices::rainbow(length(labs)), labs))
