Return the total number of dynamic scans in an MRS dataset.
Apply Arg operator to an MRS dataset.
Return the number of data points in an MRS dataset.
Return the total number of spectra in an MRS dataset.
Apply Im operator to an MRS dataset.
Complex rounding function taken from complexplus package to reduce the number
of spant dependencies.
Apply Mod operator to an MRS dataset.
Return the total number of coil elements in an MRS dataset.
Apply Conj operator to an MRS dataset.
Return the total number of acquired transients for an MRS dataset.
Simulate pulse sequence acquisition.
Return the total number of z locations in an MRS dataset.
Return the total number of y locations in an MRS dataset.
Return the total number of x locations in an MRS dataset.
Return a list of options for an ABfit analysis to maintain comparability with
analyses performed with version 1.9.0 (and earlier) of spant.
Return a list of options for an ABfit analysis.
Apply Re operator to an MRS dataset.
Apply a function across given dimensions of a MRS data object.
Convert a 7 dimensional array in into a mrs_data object. The array dimensions
should be ordered as : dummy, X, Y, Z, dynamic, coil, FID.
Perform zeroth-order phase correction based on the minimisation of the
squared difference between the real and magnitude components of the
spectrum.
Convert a basis object to an mrs_data object - where basis signals are spread
across the dynamic dimension.
Combine a pair of basis set objects.
Apodise MRSI data in the x-y direction with a k-space filter.
Append MRS data across the coil dimension, assumes they matched across the
other dimensions.
Align spectra to a reference frequency using a convolution based method.
Back extrapolate time-domain data points using an autoregressive model.
Add noise to an mrs_data object.
Create a logical circular mask spanning the full extent of an n x n matrix.
Covert a beta value in the time-domain to an equivalent linewidth in Hz:
x * exp(-i * t * t * beta).
Append MRS data across the dynamic dimension, assumes they matched across the
other dimensions.
Apply a function over specified array axes.
Check the TARQUIN binary can be run
Bin equally spaced spectral regions.
Remove a constant baseline offset based on a reference spectral region.
Apply and subtract a Gaussian smoother in the spectral domain.
Zero all coherence orders other than the one supplied as an argument.
Crop mrs_data
object data points at the end of the FID.
Crop mrs_data
object data points in the time-domain.
Simulate an RF pulse on a single spin.
Collapse MRS data by concatenating spectra along the dynamic dimension.
Calculate the noise correlation between coil elements.
Calculate the spectral SNR.
Fit and subtract a smoothing spline to each spectrum in a dataset.
Fit and subtract a polynomial to each spectrum in a dataset.
Return the default sampling frequency in Hz.
Crop basis_set
object based on a frequency range.
Combine a reference and metabolite mrs_data object.
Convolve two MRS data objects.
Return (and optionally modify using the input arguments) a list of the
default acquisition parameters.
Check LCModel can be run
Return the default transmitter frequency in Hz.
Return the default number of data points in the spectral dimension.
Crop mrs_data
object data points in the time-domain rounding down to
the next smallest power of two (pot). Data that already has a pot length will
not be changed.
Perform a polynomial fit, subtract and return the standard deviation of the
residuals.
Downsample an MRS signal by a factor of 2 by removing every other data point
in the time-domain. Note, signals outside the new sampling frequency will be
aliased.
Decimate an MRS signal by filtering in the time domain before downsampling.
Eddy current correction.
Crop an MRSI dataset in the x-y direction
Write fit results table to a csv file.
Fit a T1 recovery curve, from multiple TIs, to a set of amplitudes.
Calculate the noise standard deviation for each coil element.
comb_fit_list_result_tables
Combine the fit result tables from a list of fit results.
Calculate the sum of squares differences between two mrs_data objects.
Crop mrs_data
object based on a frequency range.
Deconvolve two MRS data objects.
Create an elliptical mask stored as a matrix of logical values.
Find valid MRS data files recursively from a directory path.
Perform a zeroth order phase correction based on the phase of the first data
point in the time-domain.
Generate a spline basis, slightly adapted from : "Splines, knots, and
penalties", Eilers 2010.
Combine all fitting data points into a single data frame.
Return the phase of the first data point in the time-domain.
Return a character vector of common 1H molecules found in healthy human
brain.
A very simple DICOM reader.
Generate a trapezoidal response function.
Generate a gaussian pulse shape.
Estimate the standard deviation of the noise from a segment of an mrs_data
object.
Return the first scans of a dynamic series.
Generate an affine for nifti generation.
Perform a fft and fftshift on a matrix with each column replaced by its
shifted fft.
Downsample an MRS signal by a factor of 2 using an FFT "brick-wall" filter.
Create a two dimensional Gaussian window function stored as a matrix.
Generate a BOLD response function.
Extract the fit amplitudes from an object of class fit_result
.
Return even numbered dynamic scans starting from 1 (2,4,6...).
Generate the I product operator for a single spin.
Generate a MRSI voxel PSF from an mrs_data
object.
Return odd numbered dynamic scans starting from 1 (1,3,5...).
Return the last scans of a dynamic series.
Generate the F product operator.
Baseline correction using the ALS method.
Calculate the effective dimensions of a spline smoother from lambda.
Compute the vector cross product between vectors x and y. Adapted from
http://stackoverflow.com/questions/15162741/what-is-rs-crossproduct-function
Combine coil data based on the first data point of a reference signal.
Return the spin number for a given nucleus.
Return the default nucleus.
Return the first half of a dynamic series.
Calculate the FWHM of a peak from a vector of intensity values.
Generate the Fxy product operator with a specified phase.
Combine all fitting data points from a list of fits into a single data frame.
Generate a SVS acquisition volume from an mrs_data
object.
Calculate the partial volume estimates for each voxel in a 2D MRSI dataset.
Return the default reference value for ppm scale.
get_1h_braino_basis_names
Return a character vector of molecules included in the GE BRAINO phantom.
Decimate an MRS signal to half the original sampling frequency by filtering
in the frequency domain before down sampling.
Calculate diagnostic information for object of class fit_result
.
Apply the diff operator to an MRS dataset in the FID/spectral dimension.
Extract a subset of MRS data.
Arrange spectral plots in a grid.
Transform frequency-domain data to the time-domain.
Fit a T1 recovery curve, from multiple TRs, to a set of amplitudes.
Image plot method for objects of class mrs_data.
Covert a linewidth in Hz to an equivalent alpha value in the time-domain ie:
x * exp(-t * alpha).
Transform 2D MRSI data to k-space in the x-y direction.
Mask the four corners of an MRSI dataset in the x-y plane.
Covert a linewidth in Hz to an equivalent beta value in the time-domain ie:
x * exp(-t * t * beta).
Fit a T2 relaxation curve, from multiple TEs, to a set of amplitudes.
Make a basis-set object from a directory containing LCModel formatted RAW
files.
Return the white matter, gray matter and CSF composition of a volume.
Return the white matter, gray matter and CSF composition of a volume.
Arrange spectral plots in a grid.
Integrate a spectral region.
Return a list of mol_parameter
objects suitable for 1H brain MRS
analyses.
Return a subset of the input basis.
get_1h_brain_basis_paras_v1
Return a list of mol_parameter
objects suitable for 1H brain MRS
analyses.
Return an array of amplitudes derived from fitting the initial points in the
time domain and extrapolating back to t=0.
Print the command to run the TARQUIN command-line program.
Generate a MRSI VOI from an mrs_data
object.
Extract a subset of dynamic scans.
Generate a MRSI voxel from an mrs_data
object.
Apply the Fourier transform over the dynamic dimension.
Perform a fit based analysis of MRS data.
Apply a Gaussian smoother in the spectral domain.
Frequency-domain convolution based filter.
Scale the first time-domain data point in an mrs_data object.
Convert an mrs_data object to basis object - where basis signals are spread
across the dynamic dimension in the MRS data.
Perform a fft and ffshift on a vector.
Mask an MRS dataset in the dynamic dimension.
Grid shift MRSI data in the x/y dimension.
Return a single voxel from a larger mrs dataset.
Perform an iffshift and ifft on a vector.
Convert mrs_data object to a matrix, with spectral points in the column
dimension and dynamics in the row dimension.
get_1h_spectre_basis_names
Return a character vector of molecules included in the Gold Star Phantoms
SPECTRE phantom.
Apply the max operator to an MRS dataset.
Return the sampling frequency in Hz of an MRS dataset.
get_1h_brain_basis_paras_v3
Return a list of mol_parameter
objects suitable for 1H brain MRS
analyses.
Get a data array from a fit result.
Return the first time-domain data point.
get_1h_brain_basis_paras_v2
Return a list of mol_parameter
objects suitable for 1H brain MRS
analyses.
Interleave the first and second half of a dynamic series.
Apply the max operator to an interpolated MRS dataset.
Robust Alignment to a Target Spectrum (RATS).
Print the command to run the LCModel command-line program.
Return acquisition parameters from a MRS data object.
Get the point spread function (PSF) for a 2D phase encoded MRSI scan.
Calculate the mean of adjacent dynamic scans.
Calculate the mean spectrum from an mrs_data object.
Mask the voxels outside an elliptical region spanning the MRSI dataset in the
x-y plane.
Perform a fftshift on a matrix, with each column replaced by its shifted
result.
Plot a 2D slice from an MRSI fit result object.
Convert mrs_data object to a vector.
Resample an image to match a target image space.
Plot a 2D slice from an MRSI fit result object.
Extract the metabolite component from an mrs_data object.
HSVD based signal filter.
Resample a basis-set to match a mrs_data acquisition.
Return a single slice from a larger MRSI dataset.
Perform an ifft and ifftshift on a matrix with each column replaced by its
shifted ifft.
Check if an object is defined, which is the same as being not NULL.
Return the second half of a dynamic series.
Flip the x data dimension order of a nifti image. This corresponds to
flipping MRI data in the left-right direction, assuming the data in save in
neurological format (can check with fslorient program).
Get the quantum coherence matrix for a spin system.
Print a summary of mrs_data parameters.
Calculate the mean spectrum from an mrs_data object.
Read a Bruker formatted pulse file
Read an ASCII formatted pulse file.
Return the mean of a list of mrs_data objects.
Print a summary of an object of class fit_result
.
Apply line-broadening (apodisation) to MRS data or basis object.
HSVD of an mrs_data object.
Perform an ifftshift on a matrix, with each column replaced by its shifted
result.
Return the frequency scale of an MRS dataset in Hz.
HSVD of a complex vector.
Check if the chemical shift dimension of an MRS data object is in the
frequency domain.
Repeat an array over a given dimension.
Calculate the median dynamic data.
Mask fit result spectra depending on a vector of bool values.
Matrix exponential function taken from complexplus package to reduce the
number of spant dependencies.
Apply a weighting to the FID to enhance spectral resolution.
Correct linear frequency drift.
Return a character array of names that may be used with the
get_mol_paras
function.
Calculate the mean of adjacent blocks in a vector.
Export a one-page pdf of a single fit result
Resample a VOI to match a target image space using nearest-neighbour
interpolation.
Convenience function to plot a baseline estimate with the original data.
Apply the Modulus operator to the time-domain MRS signal.
Plotting method for objects of class mrs_data.
Set the repetition time of an MRS dataset.
Scale an mrs_data object by a scalar or vector or amplitudes.
Scale a basis-set to be consistent with spant assumptions for water scaling.
Apply water reference scaling to a fitting results object to yield metabolite
quantities in millimolar (mM) units (mol / kg of tissue water).
Apply water reference scaling to a fitting results object to yield metabolite
quantities in millimolar (mM) units (mol / kg of tissue water).
Reader for csv fit results generated by TARQUIN.
Set the command to run the LCModel command-line program.
Reader for csv results generated by TARQUIN.
Apply phasing parameters to MRS data.
Calculate the pairwise means across a dynamic data set.
Mask an MRSI dataset in the x-y direction
Papoulis-Gerchberg (PG) algorithm method for k-space extrapolation.
Search for the highest peak in a spectral region and return the frequency,
height and FWHM.
Calculate the mean dynamic data.
Scale fitted amplitudes to a ratio of signal amplitude.
Apply a frequency shift to MRS data.
Plot the spectral standard deviation.
Simulate and fit some spectra with ABfit for benchmarking purposes. Basic
timing and performance metrics will be printed.
Simulate a MRS data object containing a set of simulated resonances.
Save function results to file and load on subsequent calls to avoid repeat
computation.
Print fit coordinates from a single index.
Replicate a scan in the dynamic dimension.
Return the ppm scale of an MRS dataset or fit result.
Read the text format header found in Siemens IMA and TWIX data files.
spant: spectroscopy analysis tools.
Simulate an mrs_data object containing simulated Gaussian noise.
CPMG style sequence with ideal pulses.
Plot a volume as an image overlay.
Reconstruct 2D MRSI data from a twix file loaded with read_mrs.
MEGA-PRESS sequence with ideal localisation pulses and Gaussian shaped
editing pulse.
Plot a volume as an overlay on a segmented brain volume.
Read a .pta formatted pulse file compatible with Siemens PulseTool.
Plot the fitting results of an object of class fit_result
.
Simple pulse and acquire sequence with ideal pulses.
STEAM sequence with ideal pulses and coherence order filtering to simulate
gradient crushers.
Create a rectangular mask stored as a matrix of logical values.
Objects exported from other packages
Apply water reference scaling to a fitting results object to yield metabolite
quantities in millimolar (mM) units (mol / Litre of tissue).
Read MRS data from a file.
Replicate a scan over a given dimension.
Get a mol_parameters
object for a named molecule.
STEAM sequence with ideal pulses using the z-rotation gradient simulation
method described by Young et al JMR 140, 146-152 (1999).
Set the ppm reference value (eg ppm value at 0Hz).
Set the verbosity of the precompute function.
Scale a basis object by a scalar.
Get the indices of data points lying between two values (end > x > start).
Reslice a nifti object to match the orientation of mrs data.
Generate a mol_parameters
object for a simple spin system with one
resonance.
Invert even numbered dynamic scans starting from 1 (2,4,6...).
Invert odd numbered dynamic scans starting from 1 (1,3,5...).
Extract the reference component from an mrs_data object.
Calculate the centre of gravity for an image containing 0 and 1's.
Produce a plot with multiple traces.
Reconstruct complex time-domain data from the real part of frequency-domain
data.
Signal space projection method for lipid suppression.
Scale fitted amplitudes to a ratio of signal amplitude.
Set the precompute mode.
Read MRS data using the TARQUIN software package.
Set the masked voxels in a 2D MRSI dataset to given spectrum.
Simulate an mrs_data object containing complex zero valued samples.
PRESS sequence with ideal pulses.
Write MRS data object to file in NIFTI format.
Reconstruct complex time-domain data from the real part of frequency-domain
data.
Calculate the sum of data dynamics.
scale_amp_molar2molal_pvc
Convert default LCM/TARQUIN concentration scaling to molal units with partial
volume correction.
PRESS sequence with shaped refocusing pulses.
Transform 2D MRSI data from k-space to image space in the x-y direction.
Simulate a macromolecular and lipid basis-set suitable for 1H brain MRS
analysis.
Simulate a basis file using TARQUIN.
Convert a vector into a mrs_data object.
Standard SVS 1H brain analysis pipeline.
Return the sum of a list of mrs_data objects.
Perform l2 regularisation artefact suppression.
Display an interactive orthographic projection plot of a nifti object.
Mask a 2D MRSI dataset in the x-y dimension.
Display an orthographic projection plot of a nifti object.
Convert a matrix (with spectral points in the column dimension and dynamics
in the row dimensions) into a mrs_data object.
Plot a slice from a 7 dimensional array.
Write a basis object to an LCModel .basis formatted file.
Plot an interactive slice map from a data array where voxels can be selected
to display a corresponding spectrum.
Read a basis file in LCModel .basis format.
Simulate a basis-set suitable for 1H brain MRS analysis acquired with a PRESS
sequence. Note, ideal pulses are assumed.
Subtract the first dynamic spectrum from a dynamic series.
STEAM sequence with ideal pulses.
Scale metabolite amplitudes as a ratio to the unsuppressed water amplitude.
Spin echo sequence with ideal pulses.
Time-domain spectral registration.
Return a list of options for a basic VARPRO analysis.
Calculate the sum across receiver coil elements.
Apply frequency shifts to basis set signals.
Simulate a basis set object.
Sum two mrs_data objects.
svs_1h_brain_batch_analysis
Batch interface to the standard SVS 1H brain analysis pipeline.
Write an ASCII formatted pulse file.
Zero-fill MRSI data in the k-space x-y direction.
Sort the basis-set elements alphabetically.
Fade a spectrum to zero by frequency domain multiplication with a tanh
function. Note this operation distorts data points at the end of the FID.
svs_1h_brain_analysis_dev
Standard SVS 1H brain analysis pipeline.
Smooth data across the dynamic dimension with a Gaussian kernel.
Subtract the median dynamic spectrum from a dynamic series.
Scale mrs_data to a spectral region.
Calculate the standard deviation spectrum from an mrs_data object.
Convert SPM style segmentation files to a single categorical image where
the numerical values map as: 0) Other, 1) CSF, 2) GM and 3) WM.
Read a directory containing Siemens MRS IMA files and combine along the
dynamic dimension. Note that the coil ID is inferred from the sorted file
name and should be checked when consistency is required.
Read a directory containing Siemens MRS IMA files and combine along the coil
dimension. Note that the coil ID is inferred from the sorted file name and
should be checked when consistency is required between two directories.
Generate mrs_data from a table of single Lorentzian resonances.
Read an LCModel formatted coord file containing fit information.
Simulate a basis-set suitable for 1H brain MRS analysis acquired with a PRESS
sequence. Note, ideal pulses are assumed.
Return a list of options for VARPRO based fitting.
spant_simulation_benchmark
Simulate a typical metabolite basis set for benchmarking. Timing metrics will
be printed on completion.
Example MEGA-PRESS data with significant B0 drift.
Apply line-broadening to an mrs_data object to achieve a specified linewidth.
Calculate the standard deviation spectrum from an mrs_data object.
Remove a subset of dynamic scans.
sLASER sequence with ideal pulses.
Stackplot plotting method for objects of class mrs_data.
Set the default acquisition parameters.
Return a time scale vector to match the FID of an MRS data object.
Set the number of transients for an mrs_data object.
Simulate an ideal pulse excitation profile by smoothing a top-hat function
with a Gaussian.
Set the command to run the TARQUIN command-line program.
Create a spin system object for pulse sequence simulation.
Simulate MRS data with a similar appearance to normal brain (by default).
Set the number of time-domain data points, truncating or zero-filling as
appropriate.
Decompose an mrs_data object into white and gray matter spectra.
Return the repetition time of an MRS dataset.
Simulate a mol_parameter
object.
Perform a mathematical operation on a spectral region.
Write MRS data object to file.
Generate a basis file using TARQUIN.
Zero all coherences including and above a given order.
Transform time-domain data to the frequency-domain.
Zero-fill MRS data in the time domain.
Set mrs_data
object data points at the end of the FID to zero.
Time-domain convolution based filter.
Plot the fitting results of an object of class fit_result
with
individual basis set components shown.
Return a list of options for VARPRO based fitting with 3 free parameters.
Return the echo time of an MRS dataset.
Subtract the mean dynamic spectrum from a dynamic series.