Problems loading Philips data

Hi Guy’s
Trying out Osprey and I don’t seem to be able to get past the “load data” step. When I "click that button in the gui I get this error message:

Array indices must be positive integers or logical values.

Error in OspreyGUIapp (line 320)
gui.layout.RedFileList{i} = [filesep SepFileList{i}{end-2} filesep
SepFileList{i}{end-1} filesep SepFileList{i}{end}];

Error in OspreyStartUp/loadJob (line 131)

Error in OspreyStartUp/onLoadJob (line 169)

Error while evaluating UIControl Callback.

I’m thinking it’s either something wrong with my job file, or somethign about the data.
The data is a multi-shot (dynamic) SVS PRESS acquisition (48 shots, 8 averages per shot).

The important bits of the job file are below


% Specify sequence type
seqType = ‘unedited’; % OPTIONS: - ‘unedited’ (default)
% - ‘MEGA’
% - ‘HERMES’

% Specify editing targets
editTarget = {‘none’}; % OPTIONS: - {‘none’} (default if ‘unedited’)
% - {‘GABA’}, {‘GSH’} (for ‘MEGA’)
% - {'GABA, 'GSH}, {‘GABA, GSH, EtOH’} (for ‘HERMES’)
% - {‘HERCULES1’}, {‘HERCULES2’} (for ‘HERCULES’)



% Save LCModel-exportable files for each spectrum?
opts.saveLCM = 1; % OPTIONS: - 0 (no, default)
% - 1 (yes)
% Save jMRUI-exportable files for each spectrum?
opts.saveJMRUI = 1; % OPTIONS: - 0 (no, default)
% - 1 (yes)

% Save processed spectra in vendor-specific format (SDAT/SPAR, RDA, P)?
opts.saveVendor = 1; % OPTIONS: - 0 (no, default)
% - 1 (yes)

% Choose the fitting algorithm = ‘Osprey’; % OPTIONS: - ‘Osprey’ (default)
% - ‘AQSES’ (planned)
% - ‘LCModel’ (planned)
% - ‘TARQUIN’ (planned)

% Choose the fitting style for difference-edited datasets (MEGA, HERMES, HERCULES)
% (only available for the Osprey fitting method) = ‘Separate’; % OPTIONS: - ‘Concatenated’ (default) - will fit DIFF and SUM simultaneously)
% - ‘Separate’ - will fit DIFF and OFF separately

% Determine fitting range (in ppm) for the metabolite and water spectra = [0.2 4.2]; % [ppm] Default: [0.2 4.2] = [2.0 7.4]; % [ppm] Default: [2.0 7.4]

% Determine the baseline knot spacing (in ppm) for the metabolite spectra = 0.4; % [ppm] Default: 0.4.

% Add macromolecule and lipid basis functions to the fit? = 1; % OPTIONS: - 0 (no)
% - 1 (yes, default)


% When using single-average Siemens RDA or DICOM files, specify their
% folders instead of single files!

% Specify metabolite data
files = {which(’/Volumes/Extreme_SSD/SPECTROSCOPY_data/Fingertapping/p02/SS0029_02_WIP_SV_P40_LOC_R1_5_1_raw_act.SDAT’)};

% Specify water reference data for eddy-current correction (same sequence as metabolite data!)
% Leave empty for GE P-files (.7) - these include water reference data by
% default.
files_ref = {which(’/Volumes/Extreme_SSD/SPECTROSCOPY_data/Fingertapping/p02/SS0029_02_WIP_SV_P40_LOC_R1_5_1_raw_ref.SDAT’)};

% Specify water data for quantification (e.g. short-TE water scan)
files_w = {};

% Specify T1-weighted structural imaging data
% Link to single NIfTI (.nii) files for Siemens and Philips data
% Link to DICOM (
.dcm) folders for GE data
files_nii = {};


% The Osprey data container will be saved as a *.mat file in the output
% folder that you specify below. In addition, any exported files (for use
% with jMRUI, TARQUIN, or LCModel) will be saved in sub-folders.

% Specify output folder
outputFolder = strrep(which(’/Volumes/Extreme_SSD/SPECTROSCOPY_data/Fingertapping/p02/’),‘jobSDAT.m’,‘outputs’);

Any help appreciated.

P.S. currently running the example data set - and that seems to be working fine.

Hi Paul,

Thanks for trying Osprey :slight_smile: Can you try removing the “which” and “strrep” parts of the paths you provide? These are really only in the example job files to ensure that they work out of the box, regardless of which folder the user is running Osprey from.

You should just provide the full paths to your files (inside a cell array - this allows for batching, like Gannet does).


Thanks Georg,
that got me a bit further, I was at least able to process the files (although the phasing isn’t right)
I then tried to “fit” the data (using the fit button) and got this error

Error using load
File name is empty.

Error in osp_fitInitialise (line 71)
basisSet = load(;

Error in OspreyFit (line 49)
[MRSCont] = osp_fitInitialise(MRSCont);

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

Error while evaluating UIControl Callback.

Any ideas?

I think it might be because this is 40 ms TE data, and not 35 ms TE. So I need to import a basis set. How do I do that?

It’s entirely possible that we’re not featuring a basis set for your sequence yet - we pretty much put it out there to see what we have to simulate. If you have an LCModel basis set, you can import it using the io_LCMBasis function in the libraries\FID-A\inputOutput folder in the Osprey directory.

@Helge has recently re-vamped the basis set folder organization, and I thought he had added a 40-ms Philips PRESS basis set. Have you pulled the latest Osprey version from GitHub?


Just saw the updated basis sets on git-hub and am downloading the latest version now.

1 Like

Excellent! Thank you for testing and reporting back, it’s much appreciated - we’ve lost track of how many ways there are to break early-development stage software :slight_smile:

Oh, I’ll find ways to break it, - even ones you would never think off…


So, downloading the latest version helped - I can now get the data to fit.
However, the quantification step doesn’t seem to want to work.
Do I need the structural files to make this step work? (I thought they were optional?)

Oh, and I needed to edit my .SPAR file so that scan_id was press (and not the name I had originally given it)
scan_id : press

The structural files are optional and the quantification step should work regardless of them. Can you explain a bit more on how it is not working for you?

And where exactly is the scan_id causing a problem during the calls. I assume it is during the selection of the basis set or the creation of a figure title?

It would be great if you could share a screenshot or two.

Thanks Helge

Hi Helge,

I’m totaly new to using Osprey (and not used GANNET yet), so am just clikcing my way through in the GUI.

The scan_id was causing a problem with the modeling step, and I figured out it was because it was reading my protocol name (SVS_P40_LOC_R1) as the sequence name, and so it could not select the right basis set.
I wIll likely try to dig a bit deeper and look at the code to see if I can figure out how to select my own basis sets, how to sepcify these etc, but that won’t be for a while.
I may also want to figure out how to change the default processing steps.
The matlab output (with errors) from when I push the quantify button is pasted below:

Quantifying dataset 1 out of 1 total datasets…
… done.
Gathering spectra from subspectrum 3 out of 3 total subspectra…
… done.
Gathering fit models from fit 3 out of 3 total fits…
… done.
Interpolating fit models from fit 3 out of 3 total fits…
… done.
Scaling data from dataset 1 out of 1 total datasetss…
… done.
Index exceeds the number of array elements (1).

Error in OspreyOverview (line 569)
if ~strcmp(subject{1},subject{2}) %Add names to the csv file

Error in osp_onQuant (line 42)
MRSCont = OspreyOverview(MRSCont);

Error while evaluating UIControl Callback.

Reference to non-existent field ‘quantifyTabhandles’.

Error in osp_updateQuantifyWindow (line 28)
gui.upperBox.quant.Info =

Error in osp_onListSelection (line 44)

Error while evaluating UIControl Callback.

Hi Paul,

This shouldn’t be a problem. And the whole structure of Osprey is closer to FID-A than to Gannet.

Ok. I was already expecting this to happen during the set up. We will most likely implement an optional flag into the jobFile where you will be able to specify a basis set, because the automated process seems to fail from time to time. Theoretically, you are able to load your own .BASIS file, but it is most likely going to fail during the LC model process (as we have only tested it on our own basis sets and naming conventions). I’m currently working on this feature and I’ll let you know when we are more confident about its functionality.

So the Quantify button is calling two Osprey functions. The OspreyQuantify function, which calculates Cr Ratios, water scaled concentrations etc. The OspreyOverview function is also called upon clicking this button, this function creates mean spectra, metabolite distributions etc and it was assuming more than one dataset in the jobFile. I assume you have only supplied a single file which was causing the your problem. I have just uploaded a fix for this.


Just to close a loop - loaded two spectra and two image files and it worked fine. Have yet to download the new version, but will be having a play with a larger data set shortly.
Is there any documentation on how to add metablites to the basis set? e.g. Glucose?

Hi Paul,

Glad it worked well. I’ve been working on an option to specify precisely which metabolites to include in an analysis and which ones to exclude. I’m working on merging those changes at the moment - will keep you posted here.

We also have a function to import LCModel basis sets (.BASIS); although @Helge mentioned to me that it was still a bit buggy.


Hi Paul,

I’ve recently managed to import an external sLASER LCModel .BASIS file (which had different naming conventions etc. from Osprey) into Osprey and got a very nice fit result . If you want to test this out for your own .BASIS files you’ll have to type:
[BASIS] = io_LCMBasis('/Users/helge/Downloads/sead3T_30ms_03Nov2016.BASIS', 1, 'unedited', 'none') into the MATLAB console with the path to your .BASIS file. Then you’ll have to follow the instructions in the console.

Afterwards OspreyFit will pick this basis set automatically, but only if there is no internal basis set with matching parameters. As soon as we have implemented an option to manually pick a specific basis set file, I’ll let you know. Also, this is currently only working for unedited data.