Skip to contents

wbcmd provides R wrapper functions for the Connectome Workbench command-line tool (wb_command).

Installation

You can install wbcmd from CRAN with:

Or install the development version 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:

  1. The R option wbcmd.path
  2. The environment variable WB_PATH
  3. Platform-specific default installation paths
  4. 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:

wb_cmd("-version")
wb_cmd("-cifti-info", c("data.dscalar.nii"))

Convenience wrappers provide a more ergonomic interface:

cifti_parcellate(
  "data.dtseries.nii",
  "atlas.dlabel.nii",
  direction = "COLUMN",
  cifti_out = "parcellated.ptseries.nii"
)

cifti_correlation(
  "data.dtseries.nii",
  "corr.dconn.nii",
  fisher_z = TRUE
)

Get help for any subcommand:

wb_help("-cifti-parcellate")