Code Monkey home page Code Monkey logo

fsl_mrs_fmrs_demo's People

Contributors

wtclarke avatar

Stargazers

 avatar

Watchers

 avatar  avatar

fsl_mrs_fmrs_demo's Issues

Problem with fsl_dynmrs

Hi William,
I am trying to run fsl_dynmrs command with my data but I get an error message. The same problem appears for a demo data (sub0_stim.nii.gz, design_mat.csv & fmrs_model.py). I've just realized that I haven't used the provided basis set but slaser's basis from Your other repository. I provide the message below and kindly ask for Your support.

fsl_dynmrs --data test.nii --basis ../sLASER_3T_28ms.basis --dyn_config ./fmrs_model.py --time_variables ./designmat.csv --baseline_order 2 --metab_groups Mac --output ./out --report --overwrite Traceback (most recent call last): File "/usr/local/bin/fsl_dynmrs", line 8, in <module> sys.exit(main()) File "/usr/local/lib/python3.7/site-packages/fsl_mrs/scripts/fsl_dynmrs.py", line 195, in main dyn_res = dyn.fit(init=init, verbose=args.verbose) File "/usr/local/lib/python3.7/site-packages/fsl_mrs/dynamic/dynmrs.py", line 262, in fit x0 = self.vm.mapped_to_free(init['x']) File "/usr/local/lib/python3.7/site-packages/fsl_mrs/dynamic/variable_mapping.py", line 524, in mapped_to_free bounds=bounds).x File "/usr/local/lib/python3.7/site-packages/scipy/optimize/_minimize.py", line 627, in minimize **options) File "/usr/local/lib/python3.7/site-packages/scipy/optimize/tnc.py", line 377, in _minimize_tnc bounds=new_bounds) File "/usr/local/lib/python3.7/site-packages/scipy/optimize/optimize.py", line 262, in _prepare_scalar_function finite_diff_rel_step, bounds, epsilon=epsilon) File "/usr/local/lib/python3.7/site-packages/scipy/optimize/_differentiable_functions.py", line 140, in __init__ self._update_fun() File "/usr/local/lib/python3.7/site-packages/scipy/optimize/_differentiable_functions.py", line 233, in _update_fun self._update_fun_impl() File "/usr/local/lib/python3.7/site-packages/scipy/optimize/_differentiable_functions.py", line 137, in update_fun self.f = fun_wrapped(self.x) File "/usr/local/lib/python3.7/site-packages/scipy/optimize/_differentiable_functions.py", line 134, in fun_wrapped return fun(np.copy(x), *args) File "/usr/local/lib/python3.7/site-packages/fsl_mrs/dynamic/variable_mapping.py", line 508, in loss pred = func(x) TypeError: model_glm() got an unexpected keyword argument 't'

Environment built with the following Dockerile:
`FROM python:3.7

RUN apt-get update
RUN apt-get install -y git

RUN git clone https://git.fmrib.ox.ac.uk/fsl/fsl_mrs.git
WORKDIR "/fsl_mrs"
RUN pip install .`

sub0_stim.nii.gz is not a gzip file

Hi, Clarke, I am so interested in the topic of functional MRS, I tried to study the code you shared in the "main_demo.ipynb", but come across some problems. When I load the demo data, It is reported that "sub0_stim.nii.gz is not a gzip file". I also can't open the demo data with FSLeyes. appreciate it if you can give me some tips. details are listed below:


from fsl_mrs.utils import mrs_io

data represents a NIfTI-MRS file in memory

data = mrs_io.read_FID('simulated_data/sub0_stim.nii.gz')

what's in the data?

print(data.shape)


ImageFileError Traceback (most recent call last)
Cell In[9], line 4
1 from fsl_mrs.utils import mrs_io
3 # data represents a NIfTI-MRS file in memory
----> 4 data = mrs_io.read_FID('simulated_data/sub0_stim.nii.gz')
6 # what's in the data?
7 print(data.shape)

File ~/.conda/envs/fsl_mrs/lib/python3.8/site-packages/fsl_mrs/utils/mrs_io/main.py:88, in read_FID(filename)
86 filename = Path(os.readlink(filename))
87 try:
---> 88 return nifti_mrs.NIFTI_MRS(filename)
89 except (nifti_mrs.NotNIFTI_MRS, fslpath.PathError):
90 data_type, id_ext = _check_datatype(Path(filename))

File ~/.conda/envs/fsl_mrs/lib/python3.8/site-packages/fsl_mrs/core/nifti_mrs.py:106, in NIFTI_MRS.init(self, *args, **kwargs)
103 args = list(args)
104 filename = Path(args[0]).name
--> 106 super().init(*args, **kwargs)
108 # Store original filename for reports etc
109 self._filename = filename

File ~/.conda/envs/fsl_mrs/lib/python3.8/site-packages/fsl/data/image.py:1238, in Image.init(self, image, name, header, xform, loadData, calcRange, threaded, dataSource, loadMeta, dataMgr, **kwargs)
1236 if isinstance(image, (str, Path)):
1237 image = op.abspath(addExt(image))
-> 1238 nibImage = nib.load(image, **kwargs)
1239 dataSource = image
1240 saved = True

File ~/.conda/envs/fsl_mrs/lib/python3.8/site-packages/nibabel/loadsave.py:105, in load(filename, **kwargs)
103 matches, msg = _signature_matches_extension(filename, sniff)
104 if not matches:
--> 105 raise ImageFileError(msg)
107 raise ImageFileError(f'Cannot work out file type of "{filename}"')

ImageFileError: File /home/rshuang/Amy/test/fsl_mrs_fmrs_demo/simulated_data/sub0_stim.nii.gz is not a gzip file

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.