Error message -Model Data Osprey

Hi everyone!

I’m new in the MRS world and trying to work with Osprey for the first time. However, Osprey keeps on giving errors with the modeling step and I don’t know what is wrong. There have been errors in the previous steps but this was always because of the wrong slash (\ instead of /), but right now, I don’t see any problems in the code. Can anyone help me with fixing this error? I’m working with Microsoft, MATLAB version R2021b, and the error is listed below. Thank you in advance! -Marte

Index exceeds the number of array elements. Index must not exceed 0.

Error in op_ampScale (line 28)

Error in osp_fitHERMES (line 56)
dataToFit = op_ampScale(dataToFit, 1/{kk});

Error in OspreyFit (line 60)
[MRSCont] = osp_fitHERMES(MRSCont);

Error in osp_onFit (line 35)
MRSCont = OspreyFit(MRSCont);

Error while evaluating UIControl Callback.

Hi Marte,

What kind of data are you trying to analyze and what’s the job file looking like?


Hi Georg, thanks for answering.
The data are acquired with the HERMES sequence, in the SM1 region. This is the information in the job file:

“seqType”: “HERMES”,
“editTarget”: [“GABA”,“GSH”],
“dataScenario”: “invivo”,
“MM3coModel”: “3to2MM”,
“FWHMMM3co”: “14”,
“SpecReg”: “RobSpecReg”,
“SubSpecAlignment”: “L2Norm”,
“UnstableWater”: “0”,
“saveLCM”: “0”,
“savejMRUI”: “0”,
“saveVendor”: “0”,
“saveNII”: “0”,
“savePDF”: “0”,
“method”: “Osprey”,
“ECCmetab”: “1”,
“ECCmm”: “1”,
“includeMetabs”: [“Cr”,“GABA”,“GPC”,“GSH”,“Glu”,“mI”,“NAA”],
“style”: “Separate”,
“lolim_range”: “0.5”,
“uplim_range”: “4.0”,
“lolim_rangew”: “2.0”,
“uplim_rangew”: “7.4”,
“bLineKnotSpace”: “0.4”,
“fitMM”: “1”,
“files”: [“C:/MasterThesis/Osprey_DATA/Subject1/lSM1/DBIEX_4_1_raw_act.SDAT”],
“files_nii”: [“C:/MasterThesis/Osprey_DATA/Subject1/T1/DBIEX_2_1.nii”],
“file_stat”: [“”],
“outputFolder”: [“C:/MasterThesis/Osprey_DATA/Subject1/lSM1”]

OK, few things:

  1. Are you acquiring ONLY HERMES data or also short-TE data? If the latter, can you confirm that the file you’re pointing to is the HERMES and not the short-TE data?
  2. You need to include the _ref.sdat files as well in the files_ref field to enable eddy-current correction and water-scaled concentration estimation.
  3. Is there a particular reason you are only including this very reduced set of metabolites? You should start with selecting the default set.


I checked all the points you mentioned and changed the metabolites to default and it works! Thank you so much for your help! I really appreciate it.


1 Like