collapse = TRUE,
  comment = "#>",
  fig.path = "README-",
  fig.width = 5,
  fig.height = 4

Spectroscopy Analysis Tools (spant)

Travis Build Status AppVeyor Build Status CRAN_Status_Badge Coverage Status

muschellij2 badges: Travis Build Status AppVeyor Build Status


spant provides a full suite of tools to build automated analysis pipelines for Magnetic Resonance Spectroscopy (MRS) data. The following features are included:


You can install the stable version of spant from CRAN:

install.packages("spant", dependencies = TRUE)

Or the the development version from GitHub (requires devtools package):



Long form :

Function reference :

Quick introduction

fname <- system.file("extdata", "philips_spar_sdat_WS.SDAT", package = "spant")

# import raw data
mrs_data <- read_mrs(fname, format = "spar_sdat")

# output basic data structure

# plot data in the frequency domain
plot(mrs_data, xlim = c(5, 0.5))
# apply water filter and align to tNAA resonance
mrs_proc <- hsvd_filt(mrs_data)
mrs_proc <- align(mrs_proc, 2.01)
plot(mrs_proc, xlim = c(5, 0.5))
# simulate a typical basis set for short TE brain analysis
basis <- sim_basis_1h_brain_press(mrs_proc)

# output basis info

# plot basis signals
stackplot(basis, xlim = c(4, 0.5), labels = basis$names, y_offset = 5)
# perform VARPRO fitting to processed data
fit_res <- fit_mrs(mrs_proc, basis)

# plot the fit estimate, residual and baseline
plot(fit_res, xlim = c(4, 0.5))

neuroconductor-devel-releases/spant documentation built on Feb. 14, 2020, 1:34 p.m.