schorschinho / osprey

All-in-one toolbox for processing of magnetic resonance spectroscopy data.
https://schorschinho.github.io/osprey
MIT License
57 stars 43 forks source link

[BUG] - osp_fitInitialise fails with LCModel .BASIS data #730

Closed alexcraven closed 5 months ago

alexcraven commented 5 months ago

Describe the bug

osp_fitInitialise variously mixes char and cell array data types for MRSCont.opts.fit.basisSetFile, causing it to fail when using a basis set is supplied in .BASIS format:

Brace indexing is not supported for variables of this type.

Error in osp_fitInitialise (line 345)
            basisSetFile{1} = MRSCont.opts.fit.basisSetFile{1};

To Reproduce Steps to reproduce the behavior:

  1. Create a new job for unedited sequence, LCModel method, and basis set in .BASIS format
  2. Proceed to fit
  3. Disappointment ensues.

Possible workaround

Convert MRSCont.opts.fit.basisSetFile to a cell array around line 340 of osp_fitInitialise

                if (~isa(MRSCont.opts.fit.basisSetFile,'cell'))
                    MRSCont.opts.fit.basisSetFile={MRSCont.opts.fit.basisSetFile}
                end 

The situation probably gets more complicated if using LCM BASIS-format basis sets for edited data (where multiple basis sets would be expected).

HJZollner commented 5 months ago

Quick question. How did you create the jobfile? From the GUI?

For edited data multiple basis set files are defined as cell anyway so that should work.

alexcraven commented 5 months ago

Yes, from the GUI.

I just tried the same procedure but with MEGA-edited data (so, interactive jobfile generator, sequence type MEGA)... "basis set file" only lets me add one BASIS file at a time, but "basis set folder" behaves correctly (I guess this is later expanded to a cell)