Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bruker PRESS (ParaVision 3.5) #146

Open
peter-mri opened this issue Jul 15, 2024 · 5 comments
Open

Bruker PRESS (ParaVision 3.5) #146

peter-mri opened this issue Jul 15, 2024 · 5 comments

Comments

@peter-mri
Copy link

I have some MRS data from Bruker (ParaVision360 v 3.5), PRESS sequence. Both single coil and array.
Either way I'm getting this error:

spec2nii bruker 8/pdata/1/2dseq

Traceback (most recent call last):
File "/home/peter/fsl/lib/python3.11/site-packages/spec2nii/bruker.py", line 81, in yield_bruker
d.query(queries)
File "/home/peter/fsl/lib/python3.11/site-packages/brukerapi/dataset.py", line 713, in query
raise FilterEvalFalse
brukerapi.exceptions.FilterEvalFalse: FilterEvalFalse

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/peter/fsl/bin/spec2nii", line 10, in
sys.exit(main())
^^^^^^
File "/home/peter/fsl/lib/python3.11/site-packages/spec2nii/spec2nii.py", line 701, in main
spec2nii(*args)
File "/home/peter/fsl/lib/python3.11/site-packages/spec2nii/spec2nii.py", line 297, in init
args.func(args)
File "/home/peter/fsl/lib/python3.11/site-packages/spec2nii/spec2nii.py", line 670, in bruker
self.imageOut, self.fileoutNames = read_bruker(args)
^^^^^^^^^^^^^^^^^
File "/home/peter/fsl/lib/python3.11/site-packages/spec2nii/bruker.py", line 44, in read_bruker
for data, orientation, dwelltime, meta, name in yield_bruker(args):
File "/home/peter/fsl/lib/python3.11/site-packages/spec2nii/bruker.py", line 83, in yield_bruker
raise ValueError(f'Bruker dataset {d.path} is not suitable for conversion to mrs_nifti')
ValueError: Bruker dataset 8/pdata/1/2dseq is not suitable for conversion to mrs_nifti

I'm using spec2nii version 0.7.4 (can't figure how to update to current version...)

I'm happy to share the data if it helps.
Cheers,
Peter

@wtclarke
Copy link
Owner

Hi Peter,

Yes please to data, though I can't promise any quick fixes.

Also, is this the new version of PV360? I've heard that quite a few things have changed.

Will

@peter-mri
Copy link
Author

Thanks Will! There's no major rush. I've attached file from PRESS data from a single channel (volume) coil. These are from a "fat" phantom, so don't look for familiar peaks...
We got version 3.5 a few months ago, so it should be out for at least half a year, if not longer. Unfortunately there seems to be changes from version to version... Unfortunately I don't know the details of differences between various v3.x versions.
There's no fid file (instead, there's a 64bit fid_proc.64). I've also loaded the data in Bruker's TopSpin software for viewing, which creates additional files (in pv2tsdata), those may not always be available...

The one piece of information from Bruker forum that may or may not help:
Group Delay parameter which is normally in the ACQP file as ##$GRPDLY. In PV360 this parameter is set to -1. The correct value (76.0833) is found in the ACQ_RxFilterInfo parameter in the ACQP file as:
##$ACQ_RxFilterInfo=( 2 )
(76.0833333333333, 0, 8, 19.8698903048866, 31) (0, 15.0833333333333, 27,19.8698903048866, 31)
The complex fid data must be shifted by the Group Delay (=round(76.0833)) indices and zeros appended to the array to keep the fid size fixed to the original value.

8.zip

@Microdeep-ZL
Copy link

Hi, I have problem converting 13C NSPECT spectra, too. I'm using ParaVision 6.0.1
It's the same error message "Bruker dataset 2dseq is not suitable for conversion to mrs_nifti"
I'm attempting to convert my 2dseq into nifti-mrs manually now. If you need the sample data to diagnose the problem, I can attach it here as well.

@Microdeep-ZL
Copy link

It seems the problem arises because one of the three conditions ["@type=='2dseq'", "@is_spectroscopy==True", "@is_complex==True"] is not met. In my case, my 2dseq is Magnitude, not complex. Is it possible to fix this?

@Microdeep-ZL
Copy link

unfortunately, after I reconstructed it to complex, I still got an error. But this time the error is different

$ spec2nii bruker -m 2DSEQ 2dseq
Traceback (most recent call last):
  File "/home/nmr/.conda/envs/fslmrs/bin/spec2nii", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/nmr/.conda/envs/fslmrs/lib/python3.12/site-packages/spec2nii/spec2nii.py", line 701, in main
    spec2nii(*args)
  File "/home/nmr/.conda/envs/fslmrs/lib/python3.12/site-packages/spec2nii/spec2nii.py", line 297, in __init__
    args.func(args)
  File "/home/nmr/.conda/envs/fslmrs/lib/python3.12/site-packages/spec2nii/spec2nii.py", line 670, in bruker
    self.imageOut, self.fileoutNames = read_bruker(args)
                                       ^^^^^^^^^^^^^^^^^
  File "/home/nmr/.conda/envs/fslmrs/lib/python3.12/site-packages/spec2nii/bruker.py", line 44, in read_bruker
    for data, orientation, dwelltime, meta, name in yield_bruker(args):
                                                    ^^^^^^^^^^^^^^^^^^
  File "/home/nmr/.conda/envs/fslmrs/lib/python3.12/site-packages/spec2nii/bruker.py", line 84, in yield_bruker
    yield from _proc_dataset(d, args)
  File "/home/nmr/.conda/envs/fslmrs/lib/python3.12/site-packages/spec2nii/bruker.py", line 121, in _proc_dataset
    d = FrameGroupMerger().merge(d, 'FG_COMPLEX')
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nmr/.conda/envs/fslmrs/lib/python3.12/site-packages/brukerapi/mergers.py", line 21, in merge
    raise ValueError(f'Dataset does not contain {fg} frame group')
ValueError: Dataset does not contain FG_COMPLEX frame group

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants