isi-nmr / brukerapi-python Goto Github PK
View Code? Open in Web Editor NEWA Python package providing I/O interface for Bruker data sets
License: MIT License
A Python package providing I/O interface for Bruker data sets
License: MIT License
Hi,
I'm trying to load 2dseq
files that are complex (got them from a custom reco in ParaVision), but in the end the data I get is magnitude data.
I think it one could try to test if the data 2x the expected size in the deserialize
function of Schema2dseq
and then perform either complex reco or just continue.
Dataset is missing the scheme_id property. We can offer some help, please contact us via
Hey, not sure how to fix this
I’m working on packaging this project as python-brukerapi
for Fedora Linux. We try to offer man pages for command-line tools whenever possible.
I can easily write a set of man pages for the bruker
executable by hand in groff_man(7)
format and maintain them downstream in Fedora. However:
argparse-manpage
, similar to Donders-Institute/multiecho#19?python3.11 -m venv _e
. _e/bin/activate
pip install -e .
pip install pytest
python -m pytest
================================================ test session starts =================================================
platform linux -- Python 3.11.4, pytest-7.4.0, pluggy-1.2.0
rootdir: /home/ben/src/forks/brukerapi-python
collected 7 items
test/test_dataset.py s.EE [ 57%]
test/test_jcampdx.py s [ 71%]
test/test_random_access.py s [ 85%]
test/test_split.py s [100%]
======================================================= ERRORS =======================================================
__________________________________________ ERROR at setup of test_data_load __________________________________________
request = <SubRequest 'test_data' for <Function test_data_load>>
@pytest.fixture()
def test_data(request):
> return request.param
E AttributeError: 'SubRequest' object has no attribute 'param'
test/conftest.py:60: AttributeError
__________________________________________ ERROR at setup of test_data_save __________________________________________
request = <SubRequest 'test_data' for <Function test_data_save>>
@pytest.fixture()
def test_data(request):
> return request.param
E AttributeError: 'SubRequest' object has no attribute 'param'
test/conftest.py:60: AttributeError
================================================== warnings summary ==================================================
[…]
============================================== short test summary info ===============================================
ERROR test/test_dataset.py::test_data_load - AttributeError: 'SubRequest' object has no attribute 'param'
ERROR test/test_dataset.py::test_data_save - AttributeError: 'SubRequest' object has no attribute 'param'
================================ 1 passed, 4 skipped, 15 warnings, 2 errors in 4.72s =================================
Hello,
I tried to use your API to load a FID.
To try it, I used your example here https://github.com/isi-nmr/brukerapi-python/blob/master/examples/read_fid.ipynb
all works, till I try print(dataset.TE)
there the error message is AttributeError: 'Dataset' object has no attribute 'TE'
perhaps you have a clue, where I made a mistake.
I'm running on version 0.1.2.0
Thanks Minnten
Hello,
I came across spec2nii, and we are interested to use it in order to extract the MRS voxel into the nifti format. Trying to use it I have stumbled along the following errors:
spec2nii bruker -m FID 8/fid
Traceback (most recent call last):
File "/home/spectro/anaconda3/bin/spec2nii", line 10, in
sys.exit(main())
File "/home/spectro/anaconda3/lib/python3.7/site-packages/spec2nii/spec2nii.py", line 666, in main
spec2nii(*args)
File "/home/spectro/anaconda3/lib/python3.7/site-packages/spec2nii/spec2nii.py", line 283, in init
args.func(args)
File "/home/spectro/anaconda3/lib/python3.7/site-packages/spec2nii/spec2nii.py", line 635, in bruker
self.imageOut, self.fileoutNames = read_bruker(args)
File "/home/spectro/anaconda3/lib/python3.7/site-packages/spec2nii/bruker.py", line 44, in read_bruker
for data, orientation, dwelltime, meta, name in yield_bruker(args):
File "/home/spectro/anaconda3/lib/python3.7/site-packages/spec2nii/bruker.py", line 79, in yield_bruker
parameter_files=['method'])
File "/home/spectro/anaconda3/lib/python3.7/site-packages/brukerapi/dataset.py", line 199, in init
self.load()
File "/home/spectro/anaconda3/lib/python3.7/site-packages/brukerapi/dataset.py", line 273, in load
self.load_data()
File "/home/spectro/anaconda3/lib/python3.7/site-packages/brukerapi/dataset.py", line 521, in load_data
self._data = self._read_data()
File "/home/spectro/anaconda3/lib/python3.7/site-packages/brukerapi/dataset.py", line 531, in _read_data
return self._schema.deserialize(data, self._schema.layouts)
File "/home/spectro/anaconda3/lib/python3.7/site-packages/brukerapi/schemas.py", line 162, in deserialize
data = self._acquisitions_to_encode(data, layouts)
File "/home/spectro/anaconda3/lib/python3.7/site-packages/brukerapi/schemas.py", line 200, in _acquisitions_to_encode
return np.reshape(data, layouts['encoding_space'], order='F')
File "<array_function internals>", line 6, in reshape
File "/home/spectro/anaconda3/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 299, in reshape
return _wrapfunc(a, 'reshape', newshape, order=order)
File "/home/spectro/anaconda3/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 58, in _wrapfunc
return bound(*args, **kwds)
ValueError: cannot reshape array of size 16384 into shape (4096,1)
On another dataset the last line of the message was:
ValueError: cannot reshape array of size 8192 into shape (2048,1)
The other lines being similar. Any hint?
Thank you,
Benoit
the 34th file of the pv601 datasets (FID_EPSI), the storage is [12288, 4] (4*12288) but the binary file contains 3145728 numbers. what happens to the rest of the data?
In the latest numpy version (1.24.1) the use of 'np.float' raises an error. 'np.float' is e.g. used in brukerapi/schemas.py: line 580.
According to the DepricationWarning from an earlier numpy version, this is a quick fix:
DeprecationWarning: np.float
is a deprecated alias for the builtin float
. To silence this warning, use float
by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64
here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.