Error in use GannetLoad

I am a student who encountered issues while using GANNET to read IMA files from Siemens machines. I would appreciate your assistance in resolving this problem.

It is said “Referencing a non-existent field: ucRemoveOversampling”.
Error read_dcm_header(line135)
DicomHeader.removeOS = dcmHeader.sSpecpara.ucRemoveOversampling;

That`s whta I type in the matlab:MRS_struct = GannetLoad({‘metab/unpress.ima’}, {‘water/unpress.ima’});

Requesting a solution, and thanks again.

I’m not so familiar with Gannet, but when I look in the code, following steps are done:
1.: In ‘DiscernDataType.m’, p.vendor should be set to ‘Siemens_dicom’ for ‘.ima’.
2.: In the main script, loadfun should be set to ‘loadFun = @SiemensDICOMRead’ for ‘Siemens_dicom’
3.: In ‘SiemensDICOMRead.m’, the function ‘read_dcm_header’ will be called.
These presentation of the steps serves only for the purpose to show that the call of ‘read_dcm_header’ is right here.

I guess that this information is missing in your .ima file. To check this, you can write your own script based on ‘read_dcm_header.m’ till line 85. In the dcmHeader structure you can look if this field exists.
At the scanner, have you removed oversampling? What syngo version do you have at the scanner?
When you haven’t removed oversampling you can try in the ‘read_dcm_header.m’ file to replace
'DicomHeader.removeOS = dcmHeader.sSpecPara.ucRemoveOversampling; ’
DicomHeader.removeOS = dcmHeader.sSpecPara.ucRemoveOversampling;
DicomHeader.removeOS = 0;

and look if it works.


1 Like

I have checked my code according to your guidance and didn’t find any issues. Thank you for your help.

it is what matlab say:

Thanks for your reply and will check my .ima files. :+1:

The ‘DiscernDataType.m’, ‘SiemensDICOMRead.m’ and the man script are all consistent with what you said, but it still doesn`t work.
I have three folders, each containing three files.
what mat say

Hi Gao,
from your paths above, I don’t understand this folder structure now.
It’s very difficult to say where the problem is with this information. Your .ima couldn’t be read and the error from line 729 is very unspecific. But also a log file should be written (see line 730). This should hopefully be able to limit the error.


Hi @Gao,

I was away at ISMRM in Toronto last week, so I didn’t have time to review your issue until now.

Could you please provide me with full details of your acquisition/study/computer? That is, the sequence you are using, the metabolite of interest, the version of Gannet and MATLAB you are using, the operating system you are using, etc.

But I can first say that I highly recommend not using IMA files with Gannet. I highly suggest you always export your data in the TWIX format (.dat files).


Hi mmikkel,
Thank you very much for your reply. The scan sequence I have is MEGA-PRESS, and the metabolite I am focusing on is GABA(i have checked the GannetPreInitialise.m and sure it is the same with the examples on the website). My gannet version is 3.3.0, MATLAB version is 2016b, and the operating system is WIN10.
Best wishes

If you can, could you please share your data with me? My email is

I have send the data to your email, thank you very much!!

Hi @Gao,

You should have 128 .ima files in each of your folders. Could you please double-check that you’ve exported all your data correctly?


Thank you, i`ve learned from your reply, i will check the files with the MRI technician again.