wbcmd provides R wrapper functions for the Connectome Workbench command-line tool (wb_command).
Installation
You can install the development version of wbcmd from GitHub with:
# install.packages("pak")
pak::pak("lcbc-uio/wbcmd")You also need Connectome Workbench installed on your system.
Setup
wbcmd looks for wb_command in the following order:
- The R option
wbcmd.path - The environment variable
WB_PATH - Platform-specific default installation paths
- The system
PATH
Check your setup with:
If wb_command is not found automatically, set the path explicitly:
set_wb_path("/path/to/wb_command")Usage
All commands flow through the central wb_cmd() dispatcher:
Convenience wrappers provide a more ergonomic interface:
wb_cifti_separate(
"data.dscalar.nii",
direction = "COLUMN",
metric = list(
CORTEX_LEFT = "left.func.gii",
CORTEX_RIGHT = "right.func.gii"
)
)
wb_cifti_smoothing(
"data.dtseries.nii",
surface_sigma = 4,
volume_sigma = 4,
direction = "COLUMN",
cifti_out = "smoothed.dtseries.nii",
left_surface = "left.midthickness.surf.gii",
right_surface = "right.midthickness.surf.gii"
)Get help for any subcommand:
wb_help("-cifti-separate")