Read MRS data from a file.
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,
fid_filt_dist = NULL
)
filename of the dpt format MRS data.
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.
transmitter frequency in Hz (required for list_data format).
sampling frequency in Hz (required for list_data format).
reference value for ppm scale (required for list_data format).
override the number of water reference scans detected in the file header (GE p-file only).
export all data points, including those before the start of the FID (default = FALSE), TWIX format only.
remove any reference scans sometimes saved in SVS twix data (default = TRUE).
print data file information (default = FALSE).
an optional data frame to provide additional variables for use in subsequent analysis steps, eg id or grouping variables.
indicate if the data has a distorted FID due to a brick-wall filter being used to downsample the data. Default is to auto detect this from the data, but TRUE or FALSE options can be given to override detection.
MRS data object.
fname <- system.file("extdata", "philips_spar_sdat_WS.SDAT", package = "spant")
mrs_data <- read_mrs(fname)
print(mrs_data)
#> MRS Data Parameters
#> ----------------------------------
#> Trans. freq (MHz) : 127.7861
#> FID data points : 1024
#> X,Y,Z dimensions : 1x1x1
#> Dynamics : 1
#> Coils : 1
#> Voxel resolution (mm) : 20x20x20
#> Sampling frequency (Hz) : 2000
#> Repetition time (s) : 2
#> Reference freq. (ppm) : 4.65
#> Nucleus : 1H
#> Spectral domain : FALSE
#> Number of transients : 128
#> Echo time (s) : 0.03
#> Manufacturer : Philips