Errors Processing NIFTI MRS in BIDS format

jobNIfTIMRS.m (17.6 KB)

Hello,

We are trying to process NIFTI MRS data that is already in BIDS format. However, when running the NIFTIMRS job file, we are getting the following errors:

Here are our files in BIDS format:

I’ve attached the job file to this post. If you can please assist, we’d greatly appreciate it! We hope to batch process this data.

Many thanks!!
Rhi

Thanks for giving Osprey a shot. The loop in the job file definitely doesn’t pick up your files (resulting in an empty MRSCont.files array causing the error).

I can’t quite make sense of the command data_folder = fileparts(which(fullfile('/media/network_mriphysics/Brenda/ENIGMA_MRS/DATA_BIDS/','sub-01/ses-01/mrs','jobNIfTIMRS.m'))); - what are you trying to do here and what is the overarching folder structure above the folder shown in the screenshot? Is it correctly organized in /sub-xx/ses-yy/mrs format that the subsequent commands

dir_metabolite    = dir([sess(ll).folder filesep sess(ll).name filesep 'mrs' filesep subs(kk).name '_' sess(ll).name '_SVS.nii.gz']);
files(counter)      = {[dir_metabolite(end).folder filesep dir_metabolite(end).name]};

demand?

Hello,

Thank you so much for your response and sorry for the delay on our end in replying! We had run into some additional issues initially when batch processing the data, but have now been able to resolve them and run it successfully!

Just to answer your questions:

  • can’t quite make sense of the command data_folder = fileparts(which(fullfile('/media/network_mriphysics/Brenda/ENIGMA_MRS/DATA_BIDS/','sub-01/ses-01/mrs','jobNIfTIMRS.m'))); - what are you trying to do here and what is the overarching folder structure above the folder shown in the screenshot?

    • We were trying to break down the file path to the data folder with the subfolders indicated, but were able to resolve this issue by just giving it the full path.
  • Is it correctly organized in /sub-xx/ses-yy/mrs format that the subsequent commands

    • Yes, with a slight modification, we were able to print out the directory structure.

We’ll be sure to reach out if we have any additional questions. Thanks so much!

1 Like

Great to hear that it works now!