Question to op_alignAverages.m in Osprey

Hi,
I use the script op_alignAverages from Osprey (FID-A library) in one of my own scripts. Now, I have an error because of the new function op_add_analysis_provenance in line 152 (https://github.com/schorschinho/osprey/blob/develop/libraries/FID-A/processingTools/op_alignAverages.m) which is new in the current Osprey version. The problem here is that there is no ‘else’ condition for ‘if isfield(in,‘nii_mrs’)’ and when in.nii_mrs isn’t defined there is no output available. Can this also be a problem in usage of Osprey or is there always the field ‘nii_mrs’ defined, @Helge ? When somebody else uses this script outside Osprey, a simple ‘else’ condition with out = in solves this problem.

Best,
Heiner

Hi @hraum,

thanks for reporting this issue. I’ll take a look at this and define a proper solution for cases where nii_mrs is not defined.

However, this shouldn’t be a problem as long you run everything Osprey as the nii_mrs field is always defined because we want it to track the processing provenance.

I’ll let you know when the fix is on GitHub.

Best,
Helge

Hi Helge,
thanks for your answer and the future fit. I suspected that but wondered about the if condition.

Best,
Heiner