MR Spectroscopy Analysis Tools
Overview
Tools for reading, visualising and processing Magnetic Resonance Spectroscopy data. The package includes methods for spectral fitting: Wilson (2021) DOI:10.1002/mrm.28385, Wilson (2025) DOI:10.1002/mrm.30462 and spectral alignment: Wilson (2018) DOI:10.1002/mrm.27605.
- Bug fix for read_basis_niidir function.
- Added read_fslmrs_json_basis_dir function.
- Added get_gaussian_pulse function to replace the misspelled get_guassian_pulse, which is now deprecated.
- Synced the spant_fit_svs command-line wrapper with fit_svs, adding segment_t1_method, remove_external_basis, pre_align_max_shift, pre_align_ref_freq and pre_align_ref_amp options.
- Added spant_fit_svs_edited command-line wrapper for fit_svs_edited, and install_cli now installs both command-line scripts.
- Fixed the --ecc option in the spant_fit_svs and spant_fit_svs_edited command-line wrappers to default to NULL (auto-detect GE eddy current correction) rather than always forcing FALSE.
Show all changes in 4.5.0Hide the rest of the changes in 4.5.0
- Fixed a broken shebang line in the command-line scripts generated by install_cli, which caused "No such file or directory" errors on Linux.
- Replaced the non-functional tcltk fit_svs_gui() prototype with a working Shiny/miniUI gadget for running fit_svs interactively, and exported it.
- Added spant_fit_svs_gui command-line wrapper to launch fit_svs_gui, installed alongside the other scripts by install_cli.
- Fixed gen_numeric_reg silently overwriting the time column when the name argument was missing. It now stops if name is missing, not a single character string, or equal to "time".
- gen_trap_reg, gen_bold_reg, gen_conv_reg and gen_impulse_reg now stop if trial_type contains "time", which previously created a duplicate time column that was silently dropped by glm_spec.
From NEWS.md in the release
Install
Health
ERRORre-building of vignette outputsr-oldrel-macos-arm64
Error(s) in re-building vignettes:
sh: line 1: 81788 Segmentation fault: 11 '/Library/Frameworks/R.framework/Resources/bin/R' --vanilla --no-echo > '/Volumes/Temp/tmp/Rtmp4ZIu07/file13db12612cbe0' 2>&1 < '/Volumes/Temp/tmp/Rtmp4ZIu07/file13db11c06f2a7'
--- re-building ‘abfit-baseline-opts.Rmd’ using rmarkdown
*** caught segfault ***
address 0x2, cause 'invalid permissions'
Traceback:
1: eigen(H_mat_list$H_mat, symmetric = TRUE)
2: spin_sys(spin_params, ft, ref)
3: pul_seq(group, ft, ref, ...)
4: sim_mol(mol_list[[n]], pul_seq, ft, ref, fs, N, xlim, ...)
5: sim_basis(get_1h_brain_basis_paras(ft = acq_paras$ft, lcm_compat = lcm_compat), seq_press_ideal, acq_paras = acq_paras, xlim = xlim, TE1 = TE1, TE2 = TE2)
6: sim_basis_1h_brain_press(mrs_data)
7: eval(expr, envir)
8: eval(expr, envir)
9: withVisible(eval(expr, envir))
10: withCallingHandlers(code, error = function (e) rlang::entrace(e), message = function (cnd) { watcher$capture_plot_and_output() if (on_mes
...[truncated]...
FALSE, quiet = quiet) output <- find_vignette_product(name, by = "texi2pdf", engine = engine) }}, error = function(e) { OK <<- FALSE message(gettextf("Error: processing vignette '%s' failed with diagnostics:\n%s", file, conditionMessage(e)))})
41: tools:::.buildOneVignette("spant-metabolite-simulation.Rmd", "/Volumes/Builds/packages/big-sur-arm64/results/4.5/spant.Rcheck/vign_test/spant", TRUE, FALSE, "spant-metabolite-simulation", "UTF-8", "/Volumes/Temp/tmp/Rtmp4ZIu07/file13db12909e9d4.rds")
An irrecoverable exception occurred. R is aborting now ...
--- re-building ‘spant-preprocessing.Rmd’ using rmarkdown
2026-10-22 18:27:32.163 R[81966:269415] XType: Using static font registry.
--- finished re-building ‘spant-preprocessing.Rmd’
SUMMARY: processing the following files failed:
‘abfit-baseline-opts.Rmd’ ‘spant-basis-simulation.Rmd’
‘spant-intro.Rmd’ ‘spant-metabolite-simulation.Rmd’
Error: Vignette re-building failed.
Execution haltedERRORtestsr-oldrel-macos-arm64
Running ‘testthat.R’ [1s/1s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> library(testthat)
> library(spant)
spant 4.5.0
Attaching package: 'spant'
The following object is masked from 'package:stats':
sd
>
> test_check("spant")
*** caught segfault ***
address 0x2, cause 'invalid permissions'
Traceback:
1: eigen(H_mat_list$H_mat, symmetric = TRUE)
2: spin_sys(spin_params, ft, ref)
3: pul_seq(group, ft, ref, ...)
4: sim_mol(mol_list[[n]], pul_seq, ft, ref, fs, N, xlim, ...)
5: sim_basis(brain_basis_paras, pul_seq, acq_paras, xlim = xlim, ...)
6: sim_brain_1h(pul_seq = seq_press_ideal, full_output = TRUE, type = "normal_v1")
7: eval(code, test_env)
8: eval(code, test_env)
9: withCallingHandlers({ eval(code, test_env) new_expectations <- the$test_expectations > starting_expectations if (snapshot_skipped) { skip("On CRAN") } else if (!new_expectations && skip_on_empty) {
...[truncated]...
conditionMessage(cnd), "\n") NULL})
37: with_reporter(reporters$multi, lapply(test_paths, test_one_file, env = env, desc = desc, shuffle = shuffle, error_call = error_call))
38: test_files_serial(test_dir = test_dir, test_package = test_package, test_paths = test_paths, load_helpers = load_helpers, reporter = reporter, env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, desc = desc, load_package = load_package, shuffle = shuffle, error_call = error_call)
39: test_files(test_dir = path, test_paths = test_paths, test_package = package, reporter = reporter, load_helpers = load_helpers, env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, load_package = load_package, parallel = parallel, shuffle = shuffle)
40: test_dir("testthat", package = package, reporter = reporter, ..., load_package = "installed")
41: test_check("spant")
An irrecoverable exception occurred. R is aborting now ...- ERROR12 OK, 1 ERRORNow
- ERROR11 OK, 1 NOTE, 2 ERROR2026-03-10
Documentation
- Help pages
- 412 (1 internal)includes a package overview page
- Examples that run
- 73%11 run in a plain check · 4 never run
- Exported functions with examples
- 4%
- Documented parameters
- 100%
- Return-value docs
- 79%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 1
- Median days to close, 50 most recently updated closed PRs
- 1
Stars over time
Releases over time
Issues over time
Commits over time
9 development-tooling and community-health practices detected across 6 families in the upstream repository
Checks run against github.com/martin3141/spant on 2026-10-18.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-10-02
pkgdown site last built 2026-10-02
Show all practicesHide 2 practices
This repository shows signs of AI coding tools.
- Claude Codefirst seen 2026-05-22Seen in the repository: CLAUDE.mdNamed in .Rbuildignore: .claude, CLAUDE.mdCommits: at least 25 crediting it in the message
- Claude Sonnet 520 commits · Sep 2026
- Claude Opus 5.55 commits · Oct 2026
Dependencies
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 4.5.0Latest2026-10-02 · current release · diff ↗ ·
added 5 exports
fit_svs_gui, fp_scale_basis, get_gaussian_pulse, read_fslmrs_json_basis_dir, read_fslmrs_json_basis_file - 4.4.0
- 4.3.0
- 4.2.0
- 4.1.02026-05-21 · diff ↗
- 4.0.02026-05-08 · diff ↗ ·
added 9 exports
faceoff, get_ants_dir, get_spant_resources_dir, install_ants, install_faceoff, install_oasis_template, segment_t1_ants, segment_t1_rpyants, set_ants_dir - RR 4.6.0 released · 2026-04-24
- 3.9.02026-02-23 · diff ↗
- 3.8.02025-12-16 · diff ↗
- 3.7.02025-11-20 · diff ↗ ·
added 6 exports
assign_dyns, fit_svs_edited_group_results, lb_renoise, match_files, paths2df, trim_paths - 3.6.02025-09-22 · diff ↗ ·
added 9 exports
fit_asy_pvoigt, match_lineshape, mean_dyns_scheme, read_basis_niidir, sim_asy_pvoigt, sub_even_from_odd_dyns, sub_odd_from_even_dyns, subtract_rest_task, write_basis_niidir - 3.5.02025-08-18 · diff ↗ ·
added 5 exports
auto_phase_bl, comb_fit_list_dyns, gen_numeric_reg, mr_data2bids, mrs_data2list - 3.4.0
- RR 4.5.0 released · 2025-04-11
- 3.3.0
- 3.2.0
Show 76 earlier eventsHide 76 earlier events
- 3.1.02024-12-17 · diff ↗ ·
added 5 exports
abfit_reg_opts, fit_svs, fit_svs_gui, scale_amp_legacy, sv_res_table - 2.24.02024-11-14 · diff ↗
- 2.23.0
- 2.22.02024-07-11 · diff ↗ ·
removed 1 export
mrs_data_list2bidsadded 13 exports
comb_coils_mrsi_gls, comb_coils_svs_gls, gen_group_reg, glm_spec_fmrs_fl, glm_spec_fmrs_group, glm_spec_group_linhyp, mrs_data2bids, mrs_data2spec_mat, phase_ref_1h_brain, preproc_svs, preproc_svs_dataset, spant_sim_fmrs_dataset, t_test_spec - 2.21.02024-05-30 · diff ↗ ·
removed 2 exports
gen_bold_rf, gen_trap_rfadded 14 exports
add_noise_spec_snr, append_regs, basis2dyn_mrs_data, calc_design_efficiency, find_bids_mrs, gen_baseline_reg, gen_bold_reg, gen_conv_reg, gen_impulse_reg, gen_poly_reg, gen_trap_reg, glm_spec, mrs_data_list2bids, plot_reg - 2.20.0
- RR 4.4.0 released · 2024-04-24
- 2.19.0
- 2.18.02024-02-23 · diff ↗
- 2.17.02023-11-28 · diff ↗ ·
added 10 exports
get_1h_brain_basis_names, get_1h_braino_basis_names, get_1h_spectre_basis_names, get_spin_num, read_pulse_ascii, seq_press_2d_shaped, sub_median_dyns, svs_1h_brain_analysis_dev, te, write_pulse_ascii - 2.16.02023-10-23 · diff ↗ ·
removed 2 exports
seq_pulse_acquire_31p, seq_spin_echo_ideal_31padded 2 exports
find_mrs_files, read_pulse_bruker - 2.15.02023-09-14 · diff ↗
- 2.14.02023-07-19 · diff ↗ ·
added 8 exports
Ntrans, bc_gauss, bc_spline, deconv_mrs, fd_gauss_smo, set_Ntrans, set_tr, tr - 2.13.0
- 2.12.0
- 2.11.02023-04-22 · diff ↗
- RR 4.3.0 released · 2023-04-21
- 2.10.0
- 2.9.0
- 2.7.02023-01-28 · diff ↗ ·
added 13 exports
crop_td_pts_end, fit_t1_ti_array, fit_t1_tr_array, fit_t2_te_array, lofdc, mask_xy_corners, mask_xy_ellipse, mean_vec_blocks, recon_imag, recon_imag_vec, scale_amp_molal, seq_mega_press_ideal, zero_td_pts_end - 2.6.02023-01-06 · diff ↗ ·
removed 2 exports
seq_mega_press_ideal, zero_nzocadded 14 exports
Imzap, apply_pulse, bc_poly, coherence_filter, gen_I, make_basis_from_raw, matexp, qn_states, read_pulse_pta, seq_steam_ideal_cof, seq_steam_ideal_young, sim_th_excit_profile, smooth_dyns, zero_higher_orders - 2.5.02022-12-06 · diff ↗ ·
removed 1 export
read_basis_acadded 4 exports
get_basis_subset, resample_basis, scale_basis_from_singlet, sim_basis_mm_lip_lcm - 2.4.0
- 2.3.0
- 2.2.0
- 2.1.02022-07-21 · diff ↗
- 2.0.0
- 1.22.0
- 1.21.0
- RR 4.2.0 released · 2022-04-22
- 1.20.0
- 1.19.0
- 1.18.02022-02-08 · diff ↗
- 1.17.0
- 1.16.0
- 1.15.02021-10-22 · diff ↗ ·
removed 1 export
comb_csv_resultsadded 3 exports
get_head_dyns, get_tail_dyns, read_basis_ac - 1.14.02021-07-23 · diff ↗ ·
removed 2 exports
norm_mrs, scale_mrsadded 11 exports
elliptical_mask, ft_dyn, gausswin_2d, mean_mrs_list, rectangular_mask, scale_mrs_amp, scale_spec, set_mask_xy_mat, sim_zero, spec_op, sub_mean_dyns - 1.13.0
- RR 4.1.0 released · 2021-05-18
- 1.12.02021-05-05 · diff ↗
- 1.11.02021-03-28 · diff ↗ ·
removed 2 exports
comb_fits, get_fit_tableadded 8 exports
comb_fit_list_fit_tables, comb_fit_list_result_tables, comb_fit_tables, get_lcm_cmd, get_tqn_cmd, spant_abfit_benchmark, svs_1h_brain_analysis, svs_1h_brain_batch_analysis - 1.10.0
- 1.9.0
- 1.8.02020-11-18 · diff ↗ ·
removed 6 exports
back_extrap, comb_coils_fp_pc, decimate_mrs, downsample_mrs, mrsi2d_img2kspace, mrsi2d_kspace2imgadded 19 exports
back_extrap_ar, circ_mask, decimate_mrs_fd, decimate_mrs_td, downsample_mrs_fd, downsample_mrs_td, fp_scale, gridplot, hsvd, hsvd_vec, img2kspace_xy, kspace2img_xy, mask_dyns, pg_extrap_xy, precomp, reson_table2mrs_data, set_precomp_mode, set_precomp_verbose, ssp - 1.7.02020-07-10 · diff ↗ ·
removed 3 exports
write_mrs_dpt_v2, write_mrs_lcm_raw, write_mrs_rdsadded 4 exports
array2mrs_data, crossprod_3d, def_nuc, write_mrs - 1.6.02020-06-05 · diff ↗ ·
removed 1 export
write_mrs_rdaadded 4 exports
downsample_mrs, get_1h_brain_basis_paras_v3, write_mrs_nifti, write_mrs_rds - unarchivedReturned to CRAN2020-05-11
- 1.5.02020-05-11 · diff ↗
- archivedRemoved from CRAN2020-05-07requires 'lsei' Which is orphaned and soon to be archived
- RR 4.0.0 released · 2020-04-24
- 1.4.0
- 1.3.0
- 1.2.12020-03-15 · diff ↗
- 1.2.0
- 1.1.0
- 1.0.0
- 0.19.0
- 0.18.0
- 0.16.02019-10-30 · diff ↗ ·
added 22 exports
append_coils, back_extrap, bc_als, bc_constant, comb_coils_fp_pc, ift_shift_mat, l2_reg, mrsi2d_img2kspace, mrsi2d_kspace2img, mvifftshift, norm_mrs, ortho3, ortho3_int, plot_bc, re_weighting, readNifti, read_ima_coil_dir, read_siemens_txt_hdr, resample_img, reslice_to_mrs, sd, set_lw - 0.15.02019-09-19 · diff ↗ ·
removed 2 exports
plot_fit_slice, plot_fit_slice_interadded 17 exports
Ncoils, Ndyns, Npts, Nx, Ny, Nz, calc_peak_info_vec, comb_fits, crop_xy, get_2d_psf, get_mrsi_voi, get_mrsi_voxel, get_mrsi_voxel_xy_psf, get_voi_seg_psf, nifti_flip_lr, plot_slice_fit, plot_slice_fit_inter - 0.14.02019-05-28 · diff ↗ ·
added 5 exports
auto_phase, collapse_to_dyns, decimate_mrs, fit_amps, get_subset - RR 3.6.0 released · 2019-04-26
- 0.13.02019-04-25 · diff ↗ ·
added 6 exports
%$%, crop_td_pts, diff_mrs, fd_conv_filt, max_mrs, max_mrs_interp - 0.12.02018-11-05 · diff ↗ ·
added 5 exports
conv_mrs, get_1h_brain_basis_paras_v2, lw2alpha, mrs_data2vec, write_mrs_lcm_raw - 0.11.0
- 0.10.02018-06-25 · diff ↗ ·
removed 7 exports
calc_peak_info, fp_corr_td, press_ideal, pulse_acquire, pulse_acquire_31p, spin_echo_ideal, spin_echo_ideal_31padded 21 exports
%>%, acquire, comb_csv_results, gen_F, gen_F_xy, get_1h_brain_basis_paras_v1, get_guassian_pulse, peak_info, seq_cpmg_ideal, seq_mega_press_ideal, seq_press_ideal, seq_pulse_acquire, seq_pulse_acquire_31p, seq_slaser_ideal, seq_spin_echo_ideal, seq_spin_echo_ideal_31p, seq_steam_ideal, sim_basis_1h_brain, spin_sys, tdsr, zero_nzoc - RR 3.5.0 released · 2018-04-23
- 0.9.0
- 0.7.02018-01-31 · diff ↗ ·
removed 1 export
combine_metab_refadded 11 exports
apply_axes, apply_mrs, calc_spec_diff, comb_metab_ref, fp_corr_td, get_fh_dyns, get_sh_dyns, interleave_dyns, is_fd, median_dyns, spm_pve2categorical - 0.6.02017-10-25 · diff ↗ ·
added 6 exports
Nspec, beta2lw, fit_diags, plot_fit_slice_inter, plot_slice_map_inter, shift - 0.5.02017-10-10 · diff ↗ ·
added 6 exports
calc_peak_info, get_fit_map, plot_slice_map, pulse_acquire_31p, set_ref, spin_echo_ideal_31p - 0.4.02017-08-09 · diff ↗ ·
added 15 exports
fit_tab2csv, ft_shift, ft_shift_mat, get_1h_brain_basis_paras, get_seg_ind, get_slice, get_voxel, ift_shift, lw2beta, mvfftshift, n2coord, plot_fit_slice, ppm, seconds, vec2mrs_data - 0.3.02017-06-20 · diff ↗ ·
removed 1 export
apply_water_scalingadded 20 exports
apply_pvc, calc_coil_noise_cor, calc_coil_noise_sd, calc_spec_snr, crop_spec, get_mol_names, get_mol_paras, get_svs_voi, get_voi_seg, plot_voi_overlay, plot_voi_overlay_seg, press_ideal, pulse_acquire, resample_voi, scale_amp_molal_pvc, scale_amp_molar, scale_amp_ratio, scale_amp_water_ratio, sim_mol, spin_echo_ideal - 0.2.02017-05-25 · diff ↗ ·
removed 3 exports
get_def_acq_paras, set_lcm_path, set_tqn_pathadded 35 exports
N, apply_water_scaling, basis2mrs_data, calc_sd_poly, check_lcm, check_tqn, comb_coils, combine_metab_ref, def_N, def_acq_paras, def_fs, def_ft, def_ref, dyns, est_noise_sd, fd2td, fp_phase, get_fp, get_metab, get_ref, get_td_amp, get_uncoupled_mol, int_spec, mat2mrs_data, mean_dyn_blocks, mrs_data2basis, mrs_data2mat, rep_dyn, set_lcm_cmd, set_tqn_cmd and 5 more - 0.1.02017-04-26
- RR 3.4.0 released · 2017-04-21
Package metadata
- First published
- 2017-04-26
- Total releases
- 80 / 9 yrs
- License
- GPL-3 OSI
- Minimum R
- ≥ 4.1.0
- Download size
- 4.1 MB
Cite
Cite this package
Run in R for the authors' entry:
citation("spant")The package provides a citation file, so citation() returns the authors' own entry.
It points to 10.21105/joss.03646, 10.1002/mrm.28385, 10.1002/mrm.30462, 10.1002/mrm.27605.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-22, which the citation names so these numbers can be found later. More on citing and the projects behind them.