read_mrs: Read MRS data from a file.

View source: R/mrs_data_io.R

read_mrsR Documentation

Read MRS data from a file.

Description

Read MRS data from a file.

Usage

read_mrs(
  fname,
  format = NULL,
  ft = NULL,
  fs = NULL,
  ref = NULL,
  n_ref_scans = NULL,
  full_fid = FALSE,
  omit_svs_ref_scans = TRUE,
  verbose = FALSE,
  extra = NULL
)

Arguments

fname

filename of the dpt format MRS data.

format

string describing the data format. Must be one of the following : "spar_sdat", "rda", "dicom", "twix", "pfile", "list_data", "paravis", "dpt", "lcm_raw", "rds", "nifti", "varian", "jmrui_txt". If not specified, the format will be guessed from the filename extension.

ft

transmitter frequency in Hz (required for list_data format).

fs

sampling frequency in Hz (required for list_data format).

ref

reference value for ppm scale (required for list_data format).

n_ref_scans

override the number of water reference scans detected in the file header (GE p-file only).

full_fid

export all data points, including those before the start of the FID (default = FALSE), TWIX format only.

omit_svs_ref_scans

remove any reference scans sometimes saved in SVS twix data (default = TRUE).

verbose

print data file information (default = FALSE).

extra

an optional data frame to provide additional variables for use in subsequent analysis steps, eg id or grouping variables.

Value

MRS data object.

Examples

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

martin3141/spant documentation built on April 14, 2024, 4:15 a.m.