Siemens .IMA - single average and multiple averages

Hi @Helge and @admin,

I have two questions about using Siemens .IMA files.

For one data set, I have a single .IMA file per subject. When loading the data, I get the following error. In debug mode, out.seq is correctly assigned STEAM, so I’m wondering if seq should be out.seq?

Unrecognized function or variable ‘seq’.

Error in io_loadspec_dicom (line 325)
if strcmp(seq,‘PRESS’) || strcmp(seq,‘STEAM’) || strcmp(seq,‘SLASER’)

Error in osp_LoadDICOM (line 67)
raw = io_loadspec_dicom(MRSCont.files{metab_ll,kk});

Error in OspreyLoad (line 185)
[MRSCont] = osp_LoadDICOM(MRSCont);

Error in osp_onLoad (line 33)
MRSCont = OspreyLoad(MRSCont);

Error while evaluating UIControl Callback.

For another data set, I have fMRS with individual averages saved as .IMA (90 .IMA files per subject). Can Osprey be used to average these data? It seems to be looking for a single .IMA per subject, but I’m not sure.

Thanks!

Hi Meredith,

Thanks for this bug report - yeah, seq in these final statements ought to be replaced with seqtype or out.seq @Helge.

About your second question - is your job file pointing towards a folder of IMAs instead of a single IMA? In that case, it should automatically load all of them, interpret them as single transients, and align/average them down the line. Can you try using the seqtype bugfix and report back?

Thanks,
Georg

Hi Georg,

I tried the seqtype fix for the single .IMA and ran into this error:

Invalid field name: ‘’.

Error in read_dcm_header (line 56)
dcmHeader.(C{1}) = value;

Error in io_loadspec_dicom (line 32)
DicomHeader = read_dcm_header(filesInFolder{1});

Error in osp_LoadDICOM (line 80)
raw_ref = io_loadspec_dicom(MRSCont.files_ref{ref_ll,kk});

Error in OspreyLoad (line 185)
[MRSCont] = osp_LoadDICOM(MRSCont);

Error in osp_onLoad (line 33)
MRSCont = OspreyLoad(MRSCont);

Error while evaluating UIControl Callback.

For the fMRS, I am pointing to a folder.

OK this seems odd, looking at the error message it seems like it’s not finding any pair-value lines in the file that is specified in files_ref.

  1. What are the files and files_ref entries in the job file, and
  2. What is your file/folder structure looking like (you will probably have to place the single IMA files for the files and files_ref in separate folders)?

These are my entries in the job file:

files = {‘/Users/mar0046/Desktop/REID_K01_SUB387/ima/SVS_ST_VAPOR_643_BASELINE_32AVG_0011’};
files_ref = {‘/Users/mar0046/Desktop/REID_K01_SUB387/ima/SVS_ST_VAPOR_643_BASELINE_RFOFF_0012’};

I tried a different subject, and it loaded okay for the single averaged .IMA :thinking:

Can you confirm that there are absolutely no other files other than DICOM in these folders?

Confirmed. Only the .IMA, and there does not appear to be any hidden files.

Can you e-mail me the file (de-identified) that causes this problem?

Sent!

For the multi-IMA fMRS data, I successfully loaded all the averages for one subject. When I click on “Process data” I get this error:

Unrecognized field name “averaged”.

Error in OspreyProcess (line 191)
if raw.averages > 1 && raw.flags.averaged == 0

Error in osp_onProc (line 35)
MRSCont = OspreyProcess(MRSCont);

Error while evaluating UIControl Callback.

Thanks!

Hi Meredith,

I’ve just committed a bugfix to the develop branch of our Osprey repository that fixed the processing for your single-IMA datasets. - give this one a try (it’ll make it into the next master release too). I have no idea why this error occurs, but essentially our DICOM parser stumbles over a corrupted line that is only present in one of the four files you shared (super-odd). Effectively, it now just skips parsing a line that it can’t make sense of.

The fix also contains a blind shot at dealing with the multi-IMA issue you reported in your last post, so I’m not 100% sure this will work because I didn’t have a dataset to test on, but please have a pop at it.

Cheers,
Georg

I’ll give it a try this week! Thanks!

Hi Georg,

Everything is running. The multi-IMA loaded and successfully went through the “process data” step. Thanks for the fixes!

Meredith

1 Like

Hi Georg,

A related update. I was assisting a student who is using Gannet for segmentation, and he ran into the same error with the DICOM header. I did a quick fix on read_dcm_header in Gannet using your Osprey fix, and then he ran into a second similar error (Invalid field name: ‘0’.) that was also fixed by adding the try/catch to “case 2” at line 63.

Meredith

2 Likes

thanks - tagging @mmikkel

Hi @Meredith,

Would you mind emailing me me those fixes you applied for Gannet? My email is mam4041[at]med[dot]cornell[dot]edu

Sent! I don’t know what is causing the differences in the headers, and it seems to be sporadic.

1 Like

Hi @admin and @Helge,

I got the Invalid field name: ’ ’ error again with another Siemens IMA spectrum. In Osprey’s read_dcm_header.m script, I added the same change you previously made (try-catch for case 1 at line 55) to case 2 at line 63, and it seems to have fixed the problem.

1 Like

Thanks so much for this fix! I’m constantly amazed by how differently a supposedly standardized file format can behave after all. :wink:

Yes! :smile: So far, we’ve only run into issues with case 1 and case 2 for two different labs/studies/voxels but seemingly random subjects. All are Siemens 7T STEAM, but I haven’t identified any other pattern as to why it happens. :woman_shrugging:

1 Like