Issue during OspreyFit process

Hi all,

During the OspreyFit process, for my second subject, the software crash with this information*. Do you have any idea how to fix it?

Thanks!

Fred
*

Matrix dimensions must agree.

Error in fit_waterOspreyParamsToModel (line 78)
residual    = data - completeFit;
Error in osp_plotFit (line 145)
            [ModelOutput] = fit_waterOspreyParamsToModel(inputData, inputSettings, fitParams);

Error in osp_plotModule (line 409)
            temp = osp_plotFit(MRSCont, kk,Style,which);

Error in OspreyFit (line 199)
            osp_plotModule(MRSCont, 'OspreyFit', kk, Names{ss});

Hi @Frederic,

Thanks for the bug report. Can you confirm that all datasets have been acquired with consistent parameters (i.e. with the same number of samples)?

Best,
Georg

Thanks @admin for your quick reply.
Same parameters, yes. Strangely, it happens between 2 subject (sub-01, ok sub-02 crash, same when I removed the sub-02: sub-01, ok sub-03 crash).
Best,
Fred

What happens when you switch the two subjects in the job file?

Tagging @Helge as well.

When I remove the first subject, the pipeline works well for all the others.
Very strange, it seems to be the same parameter…
I will forget this one for the moment.

thanks @admin and @Helge

Fred

Hi @Frederic,

this sounds strange. Would you mind sharing this specific dataset? I curious on why this specific subject is not working.

Helge

Hi @Helge,
Here you go.
Thanks.
Fred

Hi @Helge,
Any update about this strange spectra?
Best,
Fred

Hi @Frederic,

I’ve just looked at your data and everything seems to work fine for me. Two questions:

  1. From your error message I do assume that you have turned on the savePDF option?
  2. And your reported error appears during the fit plot output of the water fit, while the dataset you shared does not have a water reference scan? If a water reference was acquired, could you upload it as well? If there’s no water reference scan for this subject I’d like to take a look at your jobFile and a screenshot of the Names variable right before the call at line 199 would be helpful.

Best,
Helge

Oh… I am so stupid, it was not the good subject.
Here is the good link (indeed with savePDF on and with water reference).
Very sorry @Helge. :disappointed:

Frederic

Hi @Frederic,
I did look into the sub-31 data. And loading, processing, and fitting worked fine for me. I thought, you would send me the dataset that resulted in the crash?

One other thing I’ve realized is that you should consider changing the width of the iterative water filter for your data. At least one of the spectra still had a residual water peak which interfered with the LCM. This can be done in OspreyProcess.m search for waterRemovalFreqRange and change it to 4.4 to 4.9 and should be done to all datasets similarly.

Helge

Thanks @Helge ,

For me too. The bug happened during the quantification process OspreyQuantify(MRSCont), not before. :wink:
Concerning the waterRemovalFreqRange, thanks for the tip. However, I don’t see it in the OspreyProcess.m ?

Best,

Frederic

Ah ok. In this case I’ll do some more digging :wink:

You are right. Sorry for that. You will have to look into osp_process_UnEdited.m to change the width.

Helge

1 Like

Hi @Frederic,

sub 31 works for me - Load, Process, Fit, Quantify, and Overview. The gui is starting up as well.
Did you recently update Osprey or have you tried to run just this subject?

Helge

Thanks for all Helge!

  1. Little correction, the file is: osp_processUnEdited.m :wink:
  2. I have a previous version of Osprey, I will upload the new one (change the waterRemovalFreqRange) and try once again with my dataset.

I will let you know the result.

1 Like

Dear @Helge ,
Quick message to inform you that the last version of Osprey (I download it today) cannot be launch (Matlab R2017b).

  1. Some issue to unzip the Osprey folder
  2. Stange behaviour of the window to select the SPM-folder (Cannot create 'SPMpath.mat' because 'GUI' does not exist.).

Do you have an idea of the key cause of these issues?

Hi @Frederic,
Thanks for your feedback. I did test a fresh download of Osprey on another machine this morning (Matlab 2018b) using GitHub Desktop clone and the zip download. Both worked fine for me.

My suspicion is that some connection issue must have corrupted your download, resulting in the issues during the decompression. I assume, your resulting folder did not contain all the needed functions. I hope a simple re-download solves the issue.

I’m not sure how firm you are with GitHub, but as you are an early adopter of Osprey I would consider setting up a GItHub account and GitHub Desktop. That way you would not need to re-download everything every time :wink:

Let me know it his works.

Best,
Helge

Thanks once again @Helge . I am sorry to disturb you as I do.

You are right; the corruption was the cause of the issue. I am now, directly linked to your software by Github.

Another question, I am not sure to understand the goal into the jobRDA.m, of the files_w. The comment is “Specify water data for quantification (e.g. short-TE water scan, btw is there a consensus about the cut-off between a short and long TE?)”, but what is the difference with files_ref ? In both case, it is possible to have the absolute quantification, so I don’t understand.

Thanks for all,

Fred

No worries @Frederic! Happy to help and your feedback is always appreciated!

Wrt the deleted post, I ran in a similar problem today and I’ll upload a fix for that after the weekend.

The idea of files_w and files_ref are as follows (also describe in the paper). Files_ref should be a water reference scan with the same TE as the metabolite scan (so basically just the water suppression turned off). It is used for the eddy current correction of the metabolite scan.

For the quantification there are different ways on how Osprey calculates any water referenced concentrations (raw waer scaled or any tissue corrected concentrations) and this depends on the supplied files. In case you did only supply the files_ref it is done with regards to the water amplitude of those. If you did supply files_w the quantification will pe performed with regards to the water amplitude of those files, which reduces the water relaxation weighting.

For the odd case that you supply files_w - but no files_ref - there’s going to be the crash taht you saw, bc I did not thought of this case during the sorting of the processed spectra.

Have a nice weekend!
Helge

1 Like

Thanks for your kind words @Helge .

According to your explanation, if I understand well, it is possible that files_w = files_ref (same files)? In this case no need to add the files_w?
Thus, I am waiting your new patch to restart my process.

Have a nice day,
Frederic