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.13346050
#> Asp 0.58109460
#> Cr 0.65736716
#> GABA 0.27449048
#> Glc 0.03982332
#> Gln 0.05128914
#> GSH 0.36339508
#> Glu 1.06388597
#> GPC 0.26212693
#> Ins 0.96301990
#> Lac 0.09507967
#> Lip09 0.38769857
#> Lip13a 0.04275914
#> Lip13b 0.00000000
#> Lip20 0.00000000
#> MM09 0.15949686
#> MM12 0.10691461
#> MM14 0.42533845
#> MM17 0.36658236
#> MM20 1.50291738
#> NAA 0.97494966
#> NAAG 0.25470768
#> PCh 0.00000000
#> PCr 0.34263284
#> sIns 0.10636591
#> Tau 0.00000000
#> tNAA 1.22965734
#> tCr 1.00000000
#> tCho 0.26212693
#> Glx 1.11517512
#> tLM09 0.54719544
#> tLM13 0.57501220
#> tLM20 1.50291738