MR Spectroscopy Analysis Tools
Return a list of options for an ABfit analysis to maintain comparabili...
Return a list of options for an ABfit analysis.
Return a list of options for an ABfit analysis with regularision.
Simulate pulse sequence acquisition.
Add noise to an mrs_data object to match a given SNR.
Add noise to an mrs_data object.
Align spectra to a reference frequency using a convolution based metho...
Apodise MRSI data in the x-y direction with a k-space filter.
Combine a pair of basis set objects.
Append MRS data across the coil dimension, assumes they matched across...
Append MRS data across the dynamic dimension, assumes they matched acr...
Append multiple regressor data frames into a single data frame.
Apply a function over specified array axes.
Apply a function across given dimensions of a MRS data object.
Simulate an RF pulse on a single spin.
Apply Arg operator to an MRS dataset.
Convert a 7 dimensional array in into a mrs_data object. The array dim...
Perform zeroth-order phase correction based on the minimisation of the...
Back extrapolate time-domain data points using an autoregressive model...
Convert a basis object to a dynamic mrs_data object.
Convert a basis object to an mrs_data object - where basis signals are...
Generate a spline basis, slightly adapted from : "Splines, knots, and ...
Baseline correction using the ALS method.
Remove a constant baseline offset based on a reference spectral region...
Apply and subtract a Gaussian smoother in the spectral domain.
Fit and subtract a polynomial to each spectrum in a dataset.
Fit and subtract a smoothing spline to each spectrum in a dataset.
Covert a beta value in the time-domain to an equivalent linewidth in H...
Bin equally spaced spectral regions.
Estimate the correlation matrix for a basis set.
Estimate the CRLB for each element in a basis set.
Calculate the noise correlation between coil elements.
Calculate the noise standard deviation for each coil element.
Calculate the efficiency of a regressor data frame.
Calculate the effective dimensions of a spline smoother from lambda.
Calculate the FWHM of a peak from a vector of intensity values.
Perform a polynomial fit, subtract and return the standard deviation o...
Calculate the sum of squares differences between two mrs_data objects.
Calculate the spectral SNR.
Check LCModel can be run
Check the TARQUIN binary can be run
Create a logical circular mask spanning the full extent of an n x n ma...
Zero all coherence orders other than the one supplied as an argument.
Collapse MRS data by concatenating spectra along the dynamic dimension...
Combine MRSI coil data using the GLS method presented by An et al JMRI...
Combine SVS coil data using the GLS method presented by An et al JMRI ...
Combine coil data based on the first data point of a reference signal.
Combine all fitting data points from a list of fits into a single data...
Combine the fit result tables from a list of fit results.
Combine all fitting data points into a single data frame.
Combine a reference and metabolite mrs_data object.
Apply Conj operator to an MRS dataset.
Convolve two MRS data objects.
Crop basis_set
object based on a frequency range.
Crop mrs_data
object based on a frequency range.
Crop mrs_data
object data points at the end of the FID.
Crop mrs_data
object data points in the time-domain rounding down to...
Crop mrs_data
object data points in the time-domain.
Crop an MRSI dataset in the x-y direction
Compute the vector cross product between vectors x and y. Adapted from...
Decimate an MRS signal to half the original sampling frequency by filt...
Decimate an MRS signal by filtering in the time domain before downsamp...
Deconvolve two MRS data objects.
Return (and optionally modify using the input arguments) a list of the...
Return the default sampling frequency in Hz.
Return the default transmitter frequency in Hz.
Return the default number of data points in the spectral dimension.
Return the default nucleus.
Return the default reference value for ppm scale.
A very simple DICOM reader.
Apply the diff operator to an MRS dataset in the FID/spectral dimensio...
Downsample an MRS signal by a factor of 2 using an FFT "brick-wall" fi...
Downsample an MRS signal by a factor of 2 by removing every other data...
Return a time scale vector of acquisition times for a dynamic MRS scan...
Eddy current correction.
Create an elliptical mask stored as a matrix of logical values.
Estimate the standard deviation of the noise from a segment of an mrs_...
Frequency-domain convolution based filter.
Apply a Gaussian smoother in the spectral domain.
Transform frequency-domain data to the time-domain.
Search for MRS data files in a BIDS filesystem structure.
Find valid MRS data files recursively from a directory path.
Extract the fit amplitudes from an object of class fit_result
.
Calculate diagnostic information for object of class fit_result
.
Perform a fit based analysis of MRS data.
Write fit results table to a csv file.
GUI interface for the standard SVS 1H brain analysis pipeline, this is...
Standard SVS 1H brain analysis pipeline.
Fit a T1 recovery curve, from multiple TIs, to a set of amplitudes.
Fit a T1 recovery curve, from multiple TRs, to a set of amplitudes.
Fit a T2 relaxation curve, from multiple TEs, to a set of amplitudes.
Perform a zeroth order phase correction based on the phase of the firs...
Return the phase of the first data point in the time-domain.
Scale the first time-domain data point in an mrs_data object.
Return the sampling frequency in Hz of an MRS dataset.
Apply the Fourier transform over the dynamic dimension.
Perform a fft and fftshift on a matrix with each column replaced by it...
Perform a fft and ffshift on a vector.
Create a two dimensional Gaussian window function stored as a matrix.
Generate baseline regressor.
Generate BOLD regressors.
Generate regressors by convolving a specified response function with a...
Generate the Fxy product operator with a specified phase.
Generate the F product operator.
Expand a regressor matrix for a group analysis.
Generate the I product operator for a single spin.
Generate impulse regressors.
Generate polynomial regressors.
Generate trapezoidal regressors.
Return a character vector of common 1H molecules found in healthy huma...
Return a list of mol_parameter
objects suitable for 1H brain MRS ana...
Return a list of mol_parameter
objects suitable for 1H brain MRS ana...
Return a list of mol_parameter
objects suitable for 1H brain MRS ana...
Return a list of mol_parameter
objects suitable for 1H brain MRS ana...
Return a character vector of molecules included in the GE BRAINO phant...
Return a character vector of molecules included in the Gold Star Phant...
Get the point spread function (PSF) for a 2D phase encoded MRSI scan.
Return acquisition parameters from a MRS data object.
Return a subset of the input basis.
Extract a subset of dynamic scans.
Return even numbered dynamic scans starting from 1 (2,4,6...).
Return the first half of a dynamic series.
Get a data array from a fit result.
Return the first time-domain data point.
Generate a gaussian pulse shape.
Return the first scans of a dynamic series.
Print the command to run the LCModel command-line program.
Extract the metabolite component from an mrs_data object.
Return a character array of names that may be used with the `get_mol_p...
Get a mol_parameters
object for a named molecule.
Generate an affine for nifti generation.
Generate a MRSI VOI from an mrs_data
object.
Generate a MRSI voxel PSF from an mrs_data
object.
Generate a MRSI voxel from an mrs_data
object.
Calculate the partial volume estimates for each voxel in a 2D MRSI dat...
Return odd numbered dynamic scans starting from 1 (1,3,5...).
Extract the reference component from an mrs_data object.
Get the indices of data points lying between two values (end > x > sta...
Return the second half of a dynamic series.
Return a single slice from a larger MRSI dataset.
Return the spin number for a given nucleus.
Extract a subset of MRS data.
Generate a SVS acquisition volume from an mrs_data
object.
Return the last scans of a dynamic series.
Return an array of amplitudes derived from fitting the initial points ...
Print the command to run the TARQUIN command-line program.
Generate a mol_parameters
object for a simple spin system with one r...
Calculate the centre of gravity for an image containing 0 and 1's.
Return the white matter, gray matter and CSF composition of a volume.
Return the white matter, gray matter and CSF composition of a volume.
Return a single voxel from a larger mrs dataset.
Perform first-level spectral GLM analysis of an fMRS dataset.
Perform group-level spectral GLM analysis of an fMRS dataset.
Test a group-level spectral GLM linear hypothesis.
Perform a GLM analysis of dynamic MRS data in the spectral domain.
Grid shift MRSI data in the x/y dimension.
Arrange spectral plots in a grid.
Arrange spectral plots in a grid.
HSVD based signal filter.
HSVD of a complex vector.
HSVD of an mrs_data object.
Return the frequency scale of an MRS dataset in Hz.
Perform an ifft and ifftshift on a matrix with each column replaced by...
Perform an iffshift and ifft on a vector.
Apply Im operator to an MRS dataset.
Image plot method for objects of class mrs_data.
Transform 2D MRSI data to k-space in the x-y direction.
Complex rounding function taken from complexplus package to reduce the...
Integrate a spectral region.
Interleave the first and second half of a dynamic series.
Invert even numbered dynamic scans starting from 1 (2,4,6...).
Invert odd numbered dynamic scans starting from 1 (1,3,5...).
Check if the chemical shift dimension of an MRS data object is in the ...
Check if an object is defined, which is the same as being not NULL.
Transform 2D MRSI data from k-space to image space in the x-y directio...
Perform l2 regularisation artefact suppression.
Apply line-broadening (apodisation) to MRS data or basis object.
Correct linear frequency drift.
Covert a linewidth in Hz to an equivalent alpha value in the time-doma...
Covert a linewidth in Hz to an equivalent beta value in the time-domai...
Make a basis-set object from a directory containing LCModel formatted ...
Mask an MRS dataset in the dynamic dimension.
Mask fit result spectra depending on a vector of bool values.
Mask the four corners of an MRSI dataset in the x-y plane.
Mask the voxels outside an elliptical region spanning the MRSI dataset...
Mask a 2D MRSI dataset in the x-y dimension.
Mask an MRSI dataset in the x-y direction
Convert a matrix (with spectral points in the column dimension and dyn...
Matrix exponential function taken from complexplus package to reduce t...
Apply the max operator to an interpolated MRS dataset.
Apply the max operator to an MRS dataset.
Calculate the mean of adjacent dynamic scans.
Calculate the pairwise means across a dynamic data set.
Calculate the mean dynamic data.
Return the mean of a list of mrs_data objects.
Calculate the mean of adjacent blocks in a vector.
Calculate the mean spectrum from an mrs_data object.
Calculate the mean spectrum from an mrs_data object.
Calculate the median dynamic data.
Apply the Modulus operator to the time-domain MRS signal.
Apply Mod operator to an MRS dataset.
Convert an mrs_data object to basis object - where basis signals are s...
Create a BIDS file structure from a vector of MRS data paths or list o...
Convert mrs_data object to a matrix, with spectral points in the colum...
Convert mrs_data object to a matrix, with spectral points in the colum...
Convert mrs_data object to a vector.
Perform a fftshift on a matrix, with each column replaced by its shift...
Perform an ifftshift on a matrix, with each column replaced by its shi...
Print fit coordinates from a single index.
Return the total number of coil elements in an MRS dataset.
Return the total number of dynamic scans in an MRS dataset.
Flip the x data dimension order of a nifti image. This corresponds to ...
Return the number of data points in an MRS dataset.
Return the total number of spectra in an MRS dataset.
Return the total number of acquired transients for an MRS dataset.
Return the total number of x locations in an MRS dataset.
Return the total number of y locations in an MRS dataset.
Return the total number of z locations in an MRS dataset.
Export a one-page pdf of a single fit result
Display an interactive orthographic projection plot of a nifti object.
Display an orthographic projection plot of a nifti object.
Search for the highest peak in a spectral region and return the freque...
Papoulis-Gerchberg (PG) algorithm method for k-space extrapolation.
Corrected zero order phase and chemical shift offset in 1H MRS data fr...
Apply phasing parameters to MRS data.
Convenience function to plot a baseline estimate with the original dat...
Plot regressors as an image.
Plot a 2D slice from an MRSI fit result object.
Plot a 2D slice from an MRSI fit result object.
Plot an interactive slice map from a data array where voxels can be se...
Plot a slice from a 7 dimensional array.
Plot the spectral standard deviation.
Plot a volume as an overlay on a segmented brain volume.
Plot a volume as an image overlay.
Plot the fitting results of an object of class fit_result
.
Plotting method for objects of class mrs_data.
Return the ppm scale of an MRS dataset or fit result.
Save function results to file and load on subsequent calls to avoid re...
Preprocess and perform quality assessment of one or more SVS data sets...
Preprocess and perform quality assessment of a single SVS data set.
Print a summary of an object of class fit_result
.
Print a summary of mrs_data parameters.
Get the quantum coherence matrix for a spin system.
Robust Alignment to a Target Spectrum (RATS).
Apply a weighting to the FID to enhance spectral resolution.
Apply Re operator to an MRS dataset.
Read a basis file in LCModel .basis format.
Read a directory containing Siemens MRS IMA files and combine along th...
Read a directory containing Siemens MRS IMA files and combine along th...
Read an LCModel formatted coord file containing fit information.
Read MRS data using the TARQUIN software package.
Read MRS data from the filesystem.
Read an ASCII formatted pulse file.
Read a Bruker formatted pulse file
Read a .pta formatted pulse file compatible with Siemens PulseTool.
Read the text format header found in Siemens IMA and TWIX data files.
Reader for csv fit results generated by TARQUIN.
Reader for csv results generated by TARQUIN.
Reconstruct complex time-domain data from the real part of frequency-d...
Reconstruct complex time-domain data from the real part of frequency-d...
Reconstruct 2D MRSI data from a twix file loaded with read_mrs.
Create a rectangular mask stored as a matrix of logical values.
Objects exported from other packages
Repeat an array over a given dimension.
Replicate a scan in the dynamic dimension.
Replicate a scan over a given dimension.
Resample a basis-set to match a mrs_data acquisition.
Resample an image to match a target image space.
Resample a VOI to match a target image space using nearest-neighbour i...
Reslice a nifti object to match the orientation of mrs data.
Generate mrs_data from a table of single Lorentzian resonances.
Remove a subset of dynamic scans.
Apply water reference scaling to a fitting results object to yield met...
Apply water reference scaling to a fitting results object to yield met...
Apply water reference scaling to a fitting results object to yield met...
Apply water reference scaling to a fitting results object to yield met...
Convert default LCM/TARQUIN concentration scaling to molal units with ...
Scale fitted amplitudes to a ratio of signal amplitude.
Scale fitted amplitudes to a ratio of signal amplitude.
Scale metabolite amplitudes as a ratio to the unsuppressed water ampli...
Scale a basis object by a scalar.
Scale a basis-set to be consistent with spant assumptions for water sc...
Scale an mrs_data object by a scalar or vector or amplitudes.
Scale mrs_data to a spectral region.
Calculate the standard deviation spectrum from an mrs_data object.
Calculate the standard deviation spectrum from an mrs_data object.
Return a time scale vector to match the FID of an MRS data object.
CPMG style sequence with ideal pulses.
MEGA-PRESS sequence with ideal localisation pulses and Gaussian shaped...
PRESS sequence with shaped refocusing pulses.
PRESS sequence with ideal pulses.
Simple pulse and acquire sequence with ideal pulses.
sLASER sequence with ideal pulses.
Spin echo sequence with ideal pulses.
STEAM sequence with ideal pulses and coherence order filtering to simu...
STEAM sequence with ideal pulses using the z-rotation gradient simulat...
STEAM sequence with ideal pulses.
Set the default acquisition parameters.
Set the command to run the LCModel command-line program.
Apply line-broadening to an mrs_data object to achieve a specified lin...
Set the masked voxels in a 2D MRSI dataset to given spectrum.
Set the number of transients for an mrs_data object.
Set the precompute mode.
Set the verbosity of the precompute function.
Set the ppm reference value (eg ppm value at 0Hz).
Set the number of time-domain data points, truncating or zero-filling ...
Set the command to run the TARQUIN command-line program.
Set the repetition time of an MRS dataset.
Apply frequency shifts to basis set signals.
Apply a frequency shift to MRS data.
Simulate a basis-set suitable for 1H brain MRS analysis acquired with ...
Simulate a basis-set suitable for 1H brain MRS analysis acquired with ...
Simulate a macromolecular and lipid basis-set suitable for 1H brain MR...
Simulate a basis file using TARQUIN.
Simulate a basis set object.
Simulate MRS data with a similar appearance to normal brain (by defaul...
Simulate a mol_parameter
object.
Simulate an mrs_data object containing simulated Gaussian noise.
Simulate a MRS data object containing a set of simulated resonances.
Simulate an ideal pulse excitation profile by smoothing a top-hat func...
Simulate an mrs_data object containing complex zero valued samples.
Smooth data across the dynamic dimension with a Gaussian kernel.
Sort the basis-set elements alphabetically.
Simulate and fit some spectra with ABfit for benchmarking purposes. Ba...
Simulate an example fMRS dataset for a block design fMRS experiment an...
Simulate a typical metabolite basis set for benchmarking. Timing metri...
spant: spectroscopy analysis tools.
Decompose an mrs_data object into white and gray matter spectra.
Perform a mathematical operation on a spectral region.
Create a spin system object for pulse sequence simulation.
Convert SPM style segmentation files to a single categorical image whe...
Signal space projection method for lipid suppression.
Plot the fitting results of an object of class fit_result
with indiv...
Stackplot plotting method for objects of class mrs_data.
Produce a plot with multiple traces.
Subtract the first dynamic spectrum from a dynamic series.
Subtract the mean dynamic spectrum from a dynamic series.
Subtract the median dynamic spectrum from a dynamic series.
Calculate the sum across receiver coil elements.
Calculate the sum of data dynamics.
Return the sum of a list of mrs_data objects.
Sum two mrs_data objects.
Output a table of fit amplitudes and error estimates for a single-voxe...
Standard SVS 1H brain analysis pipeline.
Standard SVS 1H brain analysis pipeline.
Batch interface to the standard SVS 1H brain analysis pipeline.
Perform a t-test on spectral data points.
Time-domain convolution based filter.
Transform time-domain data to the frequency-domain.
Time-domain spectral registration.
Return the echo time of an MRS dataset.
Return the repetition time of an MRS dataset.
Return a list of options for VARPRO based fitting with 3 free paramete...
Return a list of options for a basic VARPRO analysis.
Return a list of options for VARPRO based fitting.
Convert a vector into a mrs_data object.
Generate a basis file using TARQUIN.
Write a basis object to an LCModel .basis formatted file.
Write MRS data object to file in NIFTI format.
Write MRS data object to file.
Write an ASCII formatted pulse file.
Fade a spectrum to zero by frequency domain multiplication with a tanh...
Zero all coherences including and above a given order.
Set mrs_data
object data points at the end of the FID to zero.
Zero-fill MRSI data in the k-space x-y direction.
Zero-fill MRS data in the time domain.
Tools for reading, visualising and processing Magnetic Resonance Spectroscopy data. The package includes methods for spectral fitting: Wilson (2021) <DOI:10.1002/mrm.28385> and spectral alignment: Wilson (2018) <DOI:10.1002/mrm.27605>.
Useful links