Note this function is still under development and liable to changes.
fit_svs(
metab,
w_ref = NULL,
output_dir = NULL,
external_basis = NULL,
p_vols = NULL,
format = NULL,
pul_seq = NULL,
TE = NULL,
TR = NULL,
TE1 = NULL,
TE2 = NULL,
TE3 = NULL,
TM = NULL,
append_basis = NULL,
remove_basis = NULL,
pre_align = TRUE,
dfp_corr = TRUE,
output_ratio = "tCr",
ecc = FALSE,
hsvd_width = NULL,
fit_opts = NULL,
fit_subset = NULL,
legacy_ws = FALSE,
w_att = 0.7,
w_conc = 35880,
use_basis_cache = "auto",
summary_measures = NULL,
dyn_av_block_size = NULL,
dyn_av_scheme = NULL,
verbose = FALSE
)
path or mrs_data object containing MRS metabolite data.
path or mrs_data object containing MRS water reference data.
directory path to output fitting results.
precompiled basis set object to use for analysis.
a numeric vector of partial volumes expressed as percentages. Defaults to 100% white matter. A voxel containing 100% gray matter tissue would use : p_vols = c(WM = 0, GM = 100, CSF = 0).
Override automatic data format detection. See format argument
in read_mrs()
for permitted values.
Pulse sequence to use for basis simulation. Can be one of the following values : "press", "press_ideal", "press_shaped", "steam" or "slaser". If "press" then "press_ideal" will be assumed unless the magnetic field is stronger that 2.8 Tesla, "press_shaped" will be assumed for 2.9 Tesla and above.
metabolite mrs data echo time in seconds. If not supplied this will be guessed from the metab data file.
metabolite mrs data repetition time in seconds. If not supplied this will be guessed from the metab data file.
PRESS or sLASER sequence timing parameter in seconds.
PRESS or sLASER sequence timing parameter in seconds.
sLASER sequence timing parameter in seconds.
STEAM mixing time parameter in seconds.
names of extra signals to add to the default basis. Eg append_basis = c("peth", "cit"). Cannot be used with precompiled basis sets.
grep expression to match names of signals to remove from the basis. For example: use "*" to remove all signals, "^mm|^lip" to remove all macromolecular and lipid signals, "^lac" to remove lactate. This operation is performed before signals are added with append_basis. Cannot be used with precompiled basis sets.
perform simple frequency alignment to known reference peaks.
perform dynamic frequency and phase correction using the RATS method.
optional string to specify a metabolite ratio to output. Defaults to "tCr" and multiple metabolites may be specified for multiple outputs. Set as NULL to omit.
option to perform water reference based eddy current correction, defaults to FALSE.
set the width of the HSVD filter in Hz. Note the applied width is between -width and +width Hz, with 0 Hz being defined at the centre of the spectral width. Default is disabled (set to NULL), 30 Hz is a reasonable value.
options to pass to ABfit.
specify a subset of dynamics to analyse, for example 1:16 would only fit the first 16 dynamic scans.
perform and output legacy water scaling compatible with default LCModel and TARQUIN behaviour. See w_att and w_conc arguments to change the default assumptions. Default value is FALSE.
water attenuation factor (default = 0.7) for legacy water scaling. Assumes water T2 of 80ms and a TE = 30 ms. exp(-30ms / 80ms) ~ 0.7.
assumed water concentration (default = 35880) for legacy water scaling. Default value corresponds to typical white matter. Set to 43300 for gray matter, and 55556 for phantom measurements.
Pre-cache basis sets to reduce analysis speed. Can be one of the following : "auto", "all" or "none". The default value of "auto" will only use the cache for 3T PRESS - which generally requires more detailed simulation due to high CSD.
output an additional table with a subset of metabolite levels, eg c("tNAA", "tNAA/tCr", "tNAA/tCho", "Lac/tNAA").
perform temporal averaging with the specified block size. Defaults to NULL, eg average across all dynamic scans.
a numerical vector of sequential integers starting at 1, with the same length as the number of dynamic scans in the metabolite data. For example: c(1, 1, 2, 1, 1, 3, 1, 1).
output potentially useful information.
metab <- system.file("extdata", "philips_spar_sdat_WS.SDAT",
package = "spant")
w_ref <- system.file("extdata", "philips_spar_sdat_W.SDAT",
package = "spant")
if (FALSE) { # \dontrun{
fit_result <- svs_1h_brain_analysis(metab, w_ref, "fit_res_dir")
} # }