MRSCloud basis set for PRESS

Dear developers,

I would like to create a Basis set for processing my MRS data. Following the README they mention I should edit the simMRS.json file and then run the run_simulations_cloud.m.

In the original JSON file, there are many parameters mostly related to a MEGA PRESS sequence, for example, “editOn”, “editOff”, “editTP”, and “editTarget”. I am using a PRESS sequence, therefore I thought I would erase them and/or set them to 0. However, as I run the simulation, I got errors due to this editing.

Do you have any recommendations in what to set these values to, or should I leave them as they are, and the code will identify that I am using a PRESS sequence, therefore it will ignore this info for the simulations?

Below, I am copying the original JSON file input and the JSON input following my analysis.

Thank you so much in advance for your help!!

-----------> original JSON
{
“userInput”: {
“metablist”: [“Ch”,“GABA”,“Glu”,“Lac”,“mI”,“PCh”,“PCr”],
“FieldStr”: [“3T”],
“vendor”: [“Philips”],
“mega_or_hadam”: [“UnEdited”],
“localization”: [“PRESS”],
“editTarget”: [“GABA”],
“TE”: 35,
“editOn”: 1.9,
“editOff”: 7.5,
“editTp”: 20,
“spatial_points”: 101,
“tm”: 30
},
“private”: {
“metab_default”: [“Cr”,“NAA”,“H2O”,“CrCH2”],
“flipAngle”: 180,
“centreFreq”: 3.0,
“edit_flipAngle”: 180,
“excflipAngle”: 90
},
“DIRECTORY”:{
“save_dir”: “C:/Users/SHUI/Documents/MATLAB/MRSCloud/save_dir/”,
“work_dir”: “C:/Users/SHUI/Documents/MATLAB/MRSCloud”,
“outputFile”: “C:/Users/SHUI/Documents/MATLAB/MRSCloud/mrs_sim_out.zip”
}
}

-------------> edited by me
{
“userInput”: {
“metablist”: [“NAA”,“Cr”,“Ch”,“Glu”,“PCh”,“PCr”],
“FieldStr”: [“3T”],
“vendor”: [“Philips”],
“mega_or_hadam”: [“UnEdited”],
“localization”: [“PRESS”],
“editTarget”: [“GABA”],
“TE”: 36,
“editOn”: 0,
“editOff”: 0,
“editTp”: 0,
“spatial_points”: 41,
“tm”: 30
},
“private”: {
“metab_default”: [“Cr”,“NAA”,“H2O”,“CrCH2”],
“flipAngle”: 180,
“centreFreq”: 3.0,
“edit_flipAngle”: 180,
“excflipAngle”: 90

},
"DIRECTORY":{
    "save_dir": "/home/juliana/Documents/klifoanae/propofolstudy/Analyses/spectroscopy/BASIS/MRSCloud/PRESS_TE35",
    "work_dir": "/home/juliana/Downloads/MRSCloud",
    "outputFile": "/home/juliana/Downloads/MRSCloud/mrs_sim_out.zip"
}

}

sorry I didn´t specify, I am using MRSCloud, and took the code from GitHub - shui5/MRSCloud: MRS Simulation

Hello @julianazi,
Can you post the error message?
I think that the edit fields shoud be ignored for “UnEdited” mode. But there should be another problem: The vendor specific pulses are not free avialable. The error may be related to this problem.

Heiner

Hello @hraum

Thank you so much for your answer!
Here is the error, you are probably right:

Error using io_loadRFwaveform (line 82)
ERROR: File not found! Aborting!

Error in load_parameters (line 326)
refRF = io_loadRFwaveform(refocWaveform,‘ref’,0);

Error in run_simulations_cloud (line 114)
MRS_temp = load_parameters(MRS_temp); % This is the function you need to edit to change the simulation parameters (not specified above this line)

Is there any workaround?

Thank you again for your help!

Best,
Juliana

Hello @julianazi,
without the right pulse forms, it’s possible to simulate with vendor “Universal_Philips”. In that case, it is not the exact pulse sequence and there will be probably small deviations.
Have you considered using MRICloud via https://braingps.mricloud.org/?

Best,
Heiner

Ah, ok, thank you for the info!
Yes, I saw that option; however, I was looking for an option where I could somehow code it. In my dataset, there are sadly some differences in TE across some subjects, so I thought of making it one BASIS automatically depending on their TE. From your experience, should one be really specific on TE, in my case, TE varies from 35 to 36.

If I understand correctly, you want multiple basis datasets thhat are selected depending on TE, right? To generate these, you can still use braingps-mricloud.
I would guess that in practice it is irrelevant whether the echo time is 35 or 36 ms, and that the minimal difference in the evolution of scalar coupling is lost in the measurement accuracy. For example, LCModel accepts a difference in basis and measured spectra of ± 3 ms, you have ± 0.5 ms (for TE=35.5 ms). It would be more critical if TE1 and TE2 were to differ further.
Experts’ consensus recommendations says “for simulated basis sets, the simulation parameters should match the in vivo acquisition (pulse sequence, field strength, echo
time and optionally the RF pulse shapes and durations)” (see https://analyticalsciencejournals.onlinelibrary.wiley.com/doi/10.1002/nbm.4257), but in this case, I would tend to think that a uniform basis dataset would be better, since the systematic error is small and uniform. When using different basis datasets, maybe there is a risk that these may be normalized in slightly different ways etc…

Best,
Heiner

That is really great and clear, thank you so much for your help. I will use only 1 set for everyone as you recommend. Thank you again!

Hi @hraum

Thank you so much for your assistance with the BASIS file.
I ran the batch with all my subjects, and it seemed to work fine until the quantification section.
Below you can see the error. Should I post this as another topic, or is it ok to ask here further?
Thank you so much in advance!

Best,
Juliana

----->
Timestamp October 29, 2025 09:22:28 Osprey 2.7.1 OspreyQuantify

Quantifying dataset 1 out of 193 total datasets…
Not enough input arguments.

Error in OspreyQuantify>lookUpRelaxTimes (line 1076)
switch Bo

Error in OspreyQuantify>quantAlpha (line 1036)
[T1_Metab_GM, T1_Metab_WM, T2_Metab_GM, T2_Metab_WM] = lookUpRelaxTimes(metsName.metab{mm,ss}{idx},Bo);

Error in OspreyQuantify (line 384)
[AlphaCorrWaterScaled, AlphaCorrWaterScaledGroupNormed] = quantAlpha(metsName,amplMets, amplWater, metsTR, waterTR, metsTE, waterTE, fGM, fWM, fCSF, meanfGM, meanfWM,MRSCont.opts.fit.coMM3,Bo);

Error in osp_onQuant (line 36)
MRSCont = OspreyQuantify(MRSCont);

Error while evaluating UIControl Callback.

Hi @julianazi,
It looks that your B0 field is not set correctly. Can you check ‘MRSCont.raw{1}.Bo’. Which data format (.spar/.sdat or .dcm…) do you have and what version of Osprey do you use?

Heiner

Hi @hraum,

Ok, I checked:
MRSCont.raw{1}.Bo=3.0006

My data format is .spar/.sdat.

The Osprey version i am currently using is “2.7.1”

Best,
Juliana

Hi @hraum

I was wondering if you had the chance to see my reply about the B0? any further tip would be helpful.

Thank you very much in advance!

Best,
Juliana