Load the spant package:
Get the path to a data file included with spant:
Read the file and save to the workspace as mrs_data
:
Output some basic information about the data:
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
#> Reference freq. (ppm) : 4.65
#> Spectral domain : FALSE
Plot the spectral region between 5 and 0.5 ppm:
Apply a HSVD filter to the residual water region and align the spectrum to the tNAA resonance at 2.01 ppm:
Simulate a typical basis set for short TE brain analysis, print some basic information and plot:
basis <- sim_basis_1h_brain_press(mrs_proc)
print(basis)
#> Basis set parameters
#> -------------------------------
#> Trans. freq (MHz) : 127.786142
#> Data points : 1024
#> Sampling frequency (Hz) : 2000
#> Elements : 27
#>
#> Names
#> -------------------------------
#> -CrCH2,Ala,Asp,Cr,GABA,Glc,Gln,
#> GSH,Glu,GPC,Ins,Lac,Lip09,
#> Lip13a,Lip13b,Lip20,MM09,MM12,
#> MM14,MM17,MM20,NAA,NAAG,PCh,
#> PCr,sIns,Tau
stackplot(basis, xlim = c(4, 0.5), labels = basis$names, y_offset = 5)
Perform ABfit analysis of the processed data (mrs_proc
):
Plot the fit result:
Extract the estimated amplitudes from fit_res
and print as a ratio to total-creatine in column format:
amps <- fit_amps(fit_res)
print(t(amps / amps$tCr))
#> [,1]
#> X.CrCH2 0.00000000
#> Ala 0.13346020
#> Asp 0.58109463
#> Cr 0.65736621
#> GABA 0.27449112
#> Glc 0.03982187
#> Gln 0.05128806
#> GSH 0.36339505
#> Glu 1.06388507
#> GPC 0.26212682
#> Ins 0.96301868
#> Lac 0.09507989
#> Lip09 0.38769906
#> Lip13a 0.04275887
#> Lip13b 0.00000000
#> Lip20 0.00000000
#> MM09 0.15949655
#> MM12 0.10691463
#> MM14 0.42533862
#> MM17 0.36658210
#> MM20 1.50291709
#> NAA 0.97495063
#> NAAG 0.25470784
#> PCh 0.00000000
#> PCr 0.34263379
#> sIns 0.10636574
#> Tau 0.00000000
#> tNAA 1.22965847
#> tCr 1.00000000
#> tCho 0.26212682
#> Glx 1.11517313
#> tLM09 0.54719560
#> tLM13 0.57501212
#> tLM20 1.50291709