Giter Site home page Giter Site logo

Comments (11)

wtclarke avatar wtclarke commented on September 15, 2024 1

With thanks to @schorschinho, I've now discovered that the negative dwell time indicates an encrypted basis set. I've made the decision to not handle these packaged basis sets as they are likely to be inappropriate for analysis of modern data (acquired with different sequences to that which these basis sets were designed for). The next version will throw a more helpful error. The IndexError: list index out of range error will be fixed though.

from fsl_mrs.

wtclarke avatar wtclarke commented on September 15, 2024

HI @weberam2

Could I just double check what version of fsl-mrs you are running? This can be done with fsl_mrs --version.

I have a memory of fixing this at some point, but it's possible it was a related issue.

I think as a work around you could add a space between the equals sign and the -3.999.... TO do this simply opent he .basis file in a text editor.

BW

Will

from fsl_mrs.

changc3 avatar changc3 commented on September 15, 2024

Hi @wtclarke,

I also met the same error when I used LCModel Basis Set. My fsl-mrs version is 1.1.13+0.g612d091.dirty. I also added the a space between the equals sign and the -3.999 but unfortunately it did not work. Could I ask if there is any solution or update about this issue? Thank you very much.

BW
Chang

from fsl_mrs.

wtclarke avatar wtclarke commented on September 15, 2024

@changc3 If you try converting the basis set using basis_tools convert my_lcm_basis.basis does that work?

It sounds like I need to fix up the file reader properly. Is there any chance you could send me your basis file as an example of one that was failing, so Ic an test against it?

Will

from fsl_mrs.

changc3 avatar changc3 commented on September 15, 2024

Hi @wtclarke ,

Thank you for your advice. I tried with the " basis_tools convert my_lcm_basis.basis" but it still did not work. I am now using the press_te25_3t_v3 file downloaded from LCM websites (http://s-provencher.com/pub/LCModel/3t.zip)). Basically, if you don't add space between the equals sign and the -3.999 , both basis_tools and fsl_mrs --data commands gave the same error that could not convert string to float: 'badelt=-3.99999990e-04'. If you add the space between, you could run the basis tool convert to .json but the program will still give you the error as shown below when you run the fsl_mrs --data metab.nii.gz --basis fslbasis --output test no matter whether you use converted basis or the basis downloaded from LCModel websites. Thank you very much and let me know if you need me to provide further info.

Best,
Chang

(fsl_mrs) [user1@cluster1]$ basis_tools convert press.basis home/user1/fslbasis
(fsl_mrs) [user1@cluster1]$ fsl_mrs --data metab.nii.gz --basis fslbasis --output test
Traceback (most recent call last):
File "/home/user1/.conda/envs/fsl_mrs/lib/python3.8/site-packages/fsl_mrs/core/basis.py", line 317, in _resampled_basis
basis = misc.ts_to_ts_ft(self._raw_fids,
File "/home/user1/.conda/envs/fsl_mrs/lib/python3.8/site-packages/fsl_mrs/utils/misc.py", line 247, in ts_to_ts_ft
raise InsufficentTimeCoverageError('Input data covers less time than is requested by interpolation.'
fsl_mrs.utils.misc.InsufficentTimeCoverageError: Input data covers less time than is requested by interpolation. Change interpolation points or dwell time.

from fsl_mrs.

wtclarke avatar wtclarke commented on September 15, 2024

Right, I'll get on this and try and fix this up properly. Thanks for pointing out it doesn't work with the official test basis. That makes it very easy to test against.

from fsl_mrs.

wtclarke avatar wtclarke commented on September 15, 2024

Hi @changc3, do you know whether the data in press_te25_3t_v3 is good? It looks like junk if you simply read the points out from the basis file. The dwelltime (badelt) being negative also seems odd. A negative dwell time has no good physical meaning. The conversion now works on all the other example basis sets in that folder (ie. all with _v1, but not the press with _v3)

from fsl_mrs.

wtclarke avatar wtclarke commented on September 15, 2024

Just to note I can't seem to get anything out of this data with Osprey tools either.

from fsl_mrs.

changc3 avatar changc3 commented on September 15, 2024

Hi @wtclarke ,

Thank you very much for your suggestion and checking. I am not sure if press_te25_3t_v3 is good but previously I have tried to modify badelt to positive value but it still did not work. I just tried with others with _v1 but the other error messages poped out (below). Could I ask if you have some verified basis set or examplePress.json for press sequence or potentially semi laser sequence that we could adapt with different TE? I am thinking maybe it would be easier for us to make sure it's not the basis issue downloaded from the LCModel websites. Let me know if you have other suggestions for how to move on. Thank you.

BW
Chang

(fsl_mrs) [user1@cluster]$ fsl_mrs --data metab.nii.gz --basis gamma_press_te20_3t_v1.basis --output test3
Traceback (most recent call last):
File "/home/user1/.conda/envs/fsl_mrs/bin/fsl_mrs", line 8, in
sys.exit(main())
File "/home/user1/.conda/envs/fsl_mrs/lib/python3.8/site-packages/fsl_mrs/scripts/fsl_mrs.py", line 203, in main
basis = mrs_io.read_basis(args.basis)
File "/home/user1/.conda/envs/fsl_mrs/lib/python3.8/site-packages/fsl_mrs/utils/mrs_io/main.py", line 112, in read_basis
basis, names, header = lcm.readLCModelBasis(filename)
File "/home/user1/.conda/envs/fsl_mrs/lib/python3.8/site-packages/fsl_mrs/utils/mrs_io/lcm_io.py", line 122, in readLCModelBasis
data[:, idx] = np.roll(data[:, idx], -shifts[idx])
IndexError: list index out of range

(fsl_mrs) [user1@cluster]$ basis_tools convert gamma_press_te20_3t_v1.basis home/user/test/fslbasis Traceback (most recent call last):
File "/home/user1/.conda/envs/fsl_mrs/bin/basis_tools", line 8, in
sys.exit(main())
File "/home/user1/.conda/envs/fsl_mrs/lib/python3.8/site-packages/fsl_mrs/scripts/basis_tools.py", line 166, in main
args.func(args)
File "/home/user1/.conda/envs/fsl_mrs/lib/python3.8/site-packages/fsl_mrs/scripts/basis_tools.py", line 204, in convert
basis_tools.convert_lcm_basis(args.input, args.output)
File "/home/user1/.conda/envs/fsl_mrs/lib/python3.8/site-packages/fsl_mrs/utils/basis_tools.py", line 39, in convert_lcm_basis
basis = mrs_io.read_basis(path_to_basis)
File "/home/user1/.conda/envs/fsl_mrs/lib/python3.8/site-packages/fsl_mrs/utils/mrs_io/main.py", line 112, in read_basis
basis, names, header = lcm.readLCModelBasis(filename)
File "/home/user1/.conda/envs/fsl_mrs/lib/python3.8/site-packages/fsl_mrs/utils/mrs_io/lcm_io.py", line 122, in readLCModelBasis
data[:, idx] = np.roll(data[:, idx], -shifts[idx])
IndexError: list index out of range

from fsl_mrs.

wtclarke avatar wtclarke commented on September 15, 2024

As per my comment above this should now be fixed in v1.1.14

from fsl_mrs.

changc3 avatar changc3 commented on September 15, 2024

Thank you very much.

from fsl_mrs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.