Choose an example or drop spectroscopy data to begin.
Choose an example or drop spectroscopy data to begin.
This app quantifies metabolites in single-voxel MR spectroscopy data, in the browser. Raw data are preprocessed with FID-A's automatic pipelines and fitted with LCModel. Both run as Rust ports compiled to WebAssembly.
Preprocessing. FID-A combines the receiver channels, removes bad averages, corrects frequency and phase drift by spectral registration, and averages. For SPECIAL it also aligns and combines the ISIS subspectra. It then phases and references the spectrum to creatine and the water reference to 4.65 ppm. Multi-coil, unedited GE data in the PRESS pipeline, from P-files or NIfTI-MRS, follow FID-A's GE script, which phases on the residual water. In room-temperature phantoms water sits near 4.8 ppm, so FID-A's creatine search can lock onto choline; LCModel's own referencing corrects this and reports it as the data shift. These are FID-A's run_pressproc_auto and run_specialproc_auto, with fixed values where FID-A draws random registration windows, so the result is reproducible. The port agrees with FID-A run in GNU Octave to within 10-5 Hz in the drift estimates and 10-8 in the final spectra. Data that arrive coil-combined (RDA, DICOM, NIfTI-MRS) are aligned and averaged only. LCModel .RAW files go to LCModel unchanged.
Fitting. LCModel 6.3-1N was translated from Stephen Provencher's Fortran subprogram by subprogram, keeping its precision and order of operations. On LCModel's own test case, the port's .TABLE and .COORD outputs are identical to those of the Fortran compiled with gfortran. Concentrations are scaled to the unsuppressed water reference when there is one (LCModel's WCONC and ATTH2O defaults); without water they are in arbitrary units, and the ratios to creatine are the useful numbers. %SD is LCModel's Cramér-Rao estimate; values above about 20% are unreliable.
Line-broadening prior. The included basis sets have 1.5 Hz lines, narrower than in vivo. With LCModel's default priors (DESDT2 0.4, RFWBAS 10) the fit cannot follow the broadened line tails and the reference singlet is integrated over too narrow a window, so water-scaled concentrations come out 8-15 % low: 13 % below the known concentrations of synthetic spectra, and below spant's ABfit with the same basis on the same files. The app therefore widens the prior (DESDT2 2, RFWBAS 80), which recovers the synthetic concentrations to 1 % and agrees with spant within about 5 %. It applies with or without a water reference, so ratios and concentrations come from the same fit; ratios move by a few percent. MEGA-PRESS difference fits keep LCModel's values, because there the widened prior changed GABA+ by up to 30 % with nothing to validate it. "LCModel defaults" in the LCModel settings restores LCModel's own priors, to compare with other LCModel analyses.
Basis sets. The included basis sets were simulated with FID-A for 20 metabolites. LCModel adds macromolecules and lipids itself. Most use ideal (instantaneous) pulses. Sets marked "shaped pulses" use real refocusing pulse shapes across the voxel (FID-A's sample Mao refocusing pulse for PRESS, its HS2 adiabatic pulse for semi-LASER), which reproduce J-evolution during the pulses and the chemical-shift displacement of the slices; the app prefers them to the ideal set with the same parameters. Choose the set that matches the data's field strength, sequence and echo time, or supply your own .BASIS file. The pulses are FID-A's examples, not a particular scanner's.
MEGA-PRESS. GABA-edited data go through FID-A's run_megapressproc_auto: coil combination, removal of bad averages, drift correction per subspectrum and alignment of edit-ON to edit-OFF. LCModel then fits the difference spectrum with its MEGA-PRESS analysis (sptype='mega-press-3', no baseline, scaled to NAA) and a difference basis set, simulated with FID-A's shaped editing and refocusing pulses at the voxel centre: real editing pulses nearly erase the NAA singlet in the edit-ON scan, which instantaneous pulses cannot reproduce. Sets exist for TE 68 ms (14 ms editing pulses) and TE 80 ms (20 ms), and for macromolecule-suppressed editing (TE 80 ms, edit-OFF at 1.5 ppm). Ratios are to NAA+NAAG; the edit-OFF spectrum is a separate download. GE and Philips files do not record editing or which transient is edit-ON, so the app compares alternate transients, as Osprey does. Data that the scanner averaged in edit-ON/OFF pairs cannot be separated.
GABA and co-edited macromolecules. The 1.9 ppm editing pulse also edits a macromolecule signal at 3.0 ppm (MM3co) under the GABA peak. The fit models it as Zöllner et al. (2022) recommend: a 14 Hz Gaussian at 3.0 ppm tied to the co-edited macromolecule peak at 0.915 ppm by a soft 3:2 area constraint, fitted from 4.2 to 0.5 ppm. As in Osprey's MEGA-PRESS LCModel jobs, 1.2 to 1.95 ppm is left out: macromolecules there, hit directly by the editing pulse, have no basis spectrum, and the analysis has no baseline. The table gives GABA, MM3co and their sum GABA+, each with %SD. GABA+ is robust; the split between GABA and MM3co is not a measurement but follows from the model's assumptions (the MM3co line width and its ratio to the 0.915 ppm peak), and changes when they change. The results therefore lead with GABA+ and mark GABA and MM3co as model-dependent; report GABA+ as the primary result. LCModel settings offer the previous analysis as the macromolecule model "None": LCModel's mega-press-3 as is, 4.2 to 1.95 ppm, where GABA is GABA+. Macromolecule-suppressed data have no co-edited MM3co, so their sets always use it.
Groups. Drop several acquisitions, or a folder of subjects, and the app fits each one in turn with the same settings. Every spectrum is paired with the water reference in its own folder. Each dataset gets the basis set recommended for its header, unless you chose a library basis set that suits all of them or dropped your own .BASIS file, which then fits every dataset. A dataset that fails is listed with its error and the rest continue. The group table shows each dataset's concentrations or ratios with their %SD, FID-A's SNR, linewidth and removed averages, and LCModel's FWHM, S/N and shift. Its CSV download is long, one row per dataset and metabolite, because units and ratio references can differ between datasets; the second CSV has one row per dataset. Both also record each dataset's macromolecule model, line-broadening prior and, when it was corrected, its tissue fractions and tissue-corrected concentrations.
Reports. This port does not draw LCModel's PostScript page. Instead each fit has a printable HTML report with the same information: the fit with its baseline and residual, the concentration table with %SD above 20% marked, LCModel's diagnostics and fit quality, the data's header, FID-A's preprocessing summary, the basis set with its checksum, the fit settings, the tissue correction and its inputs when one was applied, the control file and the versions used. Open it and print it to PDF from the browser.
Tissue correction. LCModel scales to the water reference as if the voxel were pure white matter (WCONC 35880 mM, ATTH2O 0.7). With a T1 image from the same session, the app segments it in the browser with MindMap's partial-volume grey matter, white matter and CSF maps (brainchop, on WebGPU, WebGL2 or CPU), places the voxel from the spectroscopy header (spec2nii's conventions for Siemens, GE, Philips and NIfTI-MRS), and samples the oblique voxel box on the T1 grid. MindMap's CSF map holds the ventricles only, so the part of the voxel no map labels (sulcal and interhemispheric CSF) counts as CSF. The Voxel view shows the box on the T1: check it covers the region you planned. Concentrations are then corrected as in Gasparovic et al. 2006, in mmol per kg tissue water, with Osprey's constants: tissue water contents of 0.78, 0.65 and 0.97, water T1 and T2 per tissue and metabolite T1 and T2 from the literature at 3 T and 7 T. For GABA-edited data, GABA, GABA+ and Glx are also given with Harris et al.'s alpha correction (alpha 0.5). In a group, a loaded T1 is taken to be the session's and each dataset's own voxel is measured on it; typed fractions correct only the dataset on display. Fractions from another tool can be typed in. Bruker and .RAW files do not carry the voxel position here.
Research use only.
Spectroscopy files are processed in this browser and are never uploaded. Basis sets and examples are downloaded from Hugging Face at a pinned revision and verified by checksum.