Creates axial, coronal, and sagittal panels at a given coordinate with
harmonized aesthetics. Returns the three ggplot objects invisibly after
drawing, or without drawing when draw = FALSE.
Usage
plot_ortho(
vol,
coord = NULL,
unit = c("index", "mm"),
cmap = "grays",
range = c("robust", "data"),
probs = c(0.02, 0.98),
crosshair = TRUE,
annotate = TRUE,
downsample = 1L,
title = NULL,
subtitle = NULL,
caption = NULL,
draw = TRUE,
style = c("light", "dark", "report"),
enhance = FALSE,
crop = NULL,
interpolate = NULL,
cbar_title = "value"
)Arguments
- vol
A 3D volume handled by `slice()`.
- coord
Length-3 coordinate of the target point. Interpreted as voxel indices by default; set `unit = "mm"` to convert using `coord_to_grid()` if available in your environment.
- unit
"index" or "mm".
- cmap
Palette for the slices.
- range
Intensity limits shared by all panels:
"robust","data", or an explicit numericc(lo, hi).- probs
Quantiles for robust range.
- crosshair
Logical; draw crosshair lines.
- annotate
Logical; add orientation glyphs.
- downsample
Integer decimation for speed.
- title, subtitle, caption
Optional layout-level labels used when drawing.
- draw
Logical; if `TRUE`, draw the panels on the active graphics device. If `FALSE`, only return the ggplot objects invisibly.
- style
Visual style:
"light","dark", or"report"(light card, dark cropped tiles, typography, and a colorbar – matchingplot_overlay's report look).- enhance
Display-only enhancement of an unsmoothed statistical
vol.FALSE(default) leaves it untouched;TRUEappliesenhance_stat_mapwith defaults; a namedlistis forwarded as arguments toenhance_stat_map().- crop, interpolate
Logical or
NULL; crop panels to the brain bounding box / smooth the raster.NULL(default) enables both forstyle = "report"only.- cbar_title
Character; the quantity label drawn above the colorbar in
style = "report". Defaults to"value". Set it to the quantity actually being displayed (e.g."Semipartial r") so the figure does not assert a quantity it is not showing.
Details
The affine determines which native voxel axis is nearest each
anatomical plane and how that plane must be permuted or flipped for
display. Oblique images are shown on their regular native voxel planes;
values are not silently resampled. Use deoblique() or
resample_to() first when true cardinal-plane sections are required.