MEGA-sLASER ON/OFF .RAWs to Osprey DIFF Basis Set

Hi all,
I’m working on creating a DIFF basis set for Osprey using a simulated MEGA-sLASER sequence (CMRR, TE = 68 ms) on a Siemens Skyra 3T system. I used @wclarke sequence information and simulated the spectra via FSL-MRS, which gave me ON and OFF .RAW files as well as ON/OFF/DIFF .json files.

However, I’m now a bit stuck on how to proceed:
:small_blue_diamond: FSL-MRS doesn’t output DIFF .RAW files, only DIFF .json
:small_blue_diamond: I need DIFF .RAW files (or .mat) to import into Osprey to create the basis set

What’s the recommended way to convert the ON and OFF .RAW files (LCModel-style) into DIFF .RAW or .mat files for use in Osprey’s fit_makeBasis?

Any suggestions, example scripts, or advice would be very much appreciated!

Thanks a lot in advance!

Hi @Thomas ,

I’ve just got round to this after getting back from holiday.

I’d imagine the easiest rout would be to read the FSL generated json file into Matlab and then write it into an Osprey compatible .mat file.

The key bits of the FSL .json are the fields basis_real, basis_imag and basis_dwell.

@admin or @Helge , is there a specification for what needs to be in an Osprey .mat file?

We don’t have a written-out specification, but we probably should at some point.

Do you have a convenient way of converting FSL-generated JSON basis sets into LCModel-type .BASIS files? Osprey can definitely use those.

Hi @wclarke, hi @admin,

thanks a lot for your helpful replies! I’ll try reading the FSL-generated JSON and re-writing it into an Osprey-compatible .mat file. From what I can tell from other metabolite .mat files I’ve imported into Osprey and from looking at fit_makeBasis, the file should probably follow a FID-A style structure - i.e., real and imaginary parts combined into complex numbers.

A written-out specification of the .mat format would be very useful. For now, I’ll just orient myself on what fit_makeBasis is reading and on the FID-A structures.

From what I understand (please correct me if I’m wrong), there isn’t a straightforward way of converting FSL-generated JSON files into LCModel .BASIS sets. I also considered using the FSL-MRS .RAW files to build an LCModel-style set, but abandoned this because (as far as I can tell) FSL-MRS doesn’t have a function to subtract the ON/OFF raw files, and the .RAW format also differs from LCModel.

It feels surprisingly difficult to get a working basis set for the CMRR MEGA-sLASER 3T sequence.

Thanks again for the guidance! At the moment I need to focus on a manuscript revision, but once I have time for the conversion script, I’ll share any progress here.

In the meantime, would it be possible to share a minimal Osprey-compatible .mat example (for one metabolite)? That would make writing a conversion script much easier.

Hi @wclarke and @admin,

After working on another project and only intermittently on MRS, I can now focus again on the MEGA-sLASER analysis and basis set.

I managed to convert the FSL-MRS-generated MEGA-sLASER basis set into an Osprey-readable format. Briefly, I:

  • converted the FSL-MRS ON/OFF basis folders into FID-A format
  • combined ON/OFF into a single file per metabolite
  • imported these into Osprey to generate a .basis file

I also had to manually add a water peak, otherwise Osprey complained about the basis set (details below).

I tested this basis in both Osprey and FSL-MRS using pilot in vivo data and a custom GABA phantom. So far, the fits are not very good (especially around the 3 ppm region and where the co-edited MMs would be).

At the moment, I have not included any co-edited MM/lipid peaks, and I suspect this is part of the issue. I tried:

  • adding MM peaks in FSL-MRS
  • letting Osprey add MM components

but this has not clearly improved the fits yet.

Questions

1) MM/lipid modeling
What would be the recommended way to include co-edited MM/lipid basis functions for a MEGA-sLASER basis generated with FSL-MRS?

Specifically:

  • Should MM components be simulated, added empirically, or taken from existing Osprey basis sets?

  • My understanding is that for edited MEGA data, simply adding generic MM basis functions may not be sufficient, since the edited GABA signal includes a co-edited MM contribution?

Would you recommend explicitly modeling co-edited MM (e.g., MM3co/MM09), and if so, how should this best be implemented when starting from an FSL-MRS simulated basis?

2) FSL-MRS preprocessing

For FSL-MRS, I used the standard preprocessing pipeline for edited sequences. This is likely not optimal for MEGA-sLASER.

Are there recommendations for preprocessing/analyzing MEGA-sLASER data in FSL-MRS?

The only relevant discussion I found was:

3) Basis set simulation parameters
I plan to refine the simulation and rerun the basis set with a higher spectral resolution. For MEGA-sLASER at TE ≈ 68.32 ms, which parameters are most critical to get right?

For example:

  • exact TE (atm the basis set simulation is using 68 ms instead of 68.32)
  • spectral resolution
  • pulse bandwidth / shape
  • excitation pulse duration (we had to increase it from the default values)

4) Splitting acquisitions due to frequency drift
We observe substantial frequency drift (~2.6 Hz/min) when running fMRI before the post-task MEGA-sLASER scan.

Splitting the acquisition into 2 × 4 min blocks and updating the frequency in between improved data quality.

What would be the best way to combine these blocks for analysis:

  • in Osprey
  • in FSL-MRS

(i.e., should they be concatenated before fitting, or aligned and combined during preprocessing?)

I’ve added the plots of the basis set from FSL-MRS and the imported Osprey basis set to the post at the end. I’m happy to upload the full FSL-MRS and Osprey basis sets if that would be helpful.

Thank you for your help in advance!

Best,
Thomas

P.S. @wclarke, I’m currently reading your Introduction to Magnetic Resonance Spectroscopy together with a PhD student I’m training - it’s a great resource. It would have saved me quite a bit of pain if it had been available when I started :slight_smile:

Water peak used for Osprey import:


waterPPM = 4.68;

waterFWHM = 0.05; % ppm

sigma = waterFWHM / 2.355;

spec = exp(-0.5 * ((ppm - waterPPM) ./ sigma).^2);

spec = spec / max(spec);

FSL-MRS Basis Set Plots:
Diff:

On:

Off:

Osprey Basis Set Plot:

Quick correction: the osprey plot in my original post was the OFF spectrum (v1 basis set), not the DIFF spectrum.

Here is the correct DIFF spectrum for v1:

In the meantime I also updated the basis set (v2; corrected some sequence/simulation parameters + higher spectral resolution 40 → 60).

DIFF spectrum with v2:

I also included the FSL-MRS DIFF output for v2 for reference:

Would be very interested in your thoughts on whether this looks more reasonable / if I’m moving in the right direction.