[FieldTrip] Load BIDS motion data

Cross, Kathryn A. KCross at mednet.ucla.edu
Mon Aug 11 18:02:56 CEST 2025


I am trying to load BIDS formatted motion data and am  unsure of the correct way to do this.
When I try to use ft_read_data I am receiving the below error.
Is my input wrong? It seems to be trying to read a tsv file as a json in line 317 of ft_read_header. I have tried a few variations of headerformat and dataformat arguments without success.

Thank you in advance for any advice!

Katy


data = ft_read_data('sub-CM01_task-reaching_tracksys-apdm_run-1_motion.tsv','dataformat','bids_tsv');

208 [filename, headerfile, datafile] = dataset2files(filename, dataformat);
found matching BIDS sidecar 'G:\PROJECTS\Cueing_Noninvasive\data\bids\sub-CM01\motion\sub-CM01_task-reaching_tracksys-apdm_run-1_motion.tsv'
reading 'G:\PROJECTS\Cueing_Noninvasive\data\bids\sub-CM01\motion\sub-CM01_task-reaching_tracksys-apdm_run-1_motion.tsv'
Error using loadjson>error_pos
JSONLAB:JSON:InvalidFormat: Outer level structure must be an object or an array: 3<error>

Error in loadjson (line 143)
                pos=error_pos('Outer level structure must be an object or an array',inputstr,pos);

Error in ft_read_json (line 45)
  json = loadjson(filename);

Error in ft_read_header (line 317)
      data_json = ft_read_json(sidecar);

Error in ft_read_data (line 223)
  hdr = ft_read_header(filename, 'headerformat', headerformat, 'checkmaxfilter', checkmaxfilter, 'password', password, 'cache', cache);




________________________________

UCLA HEALTH SCIENCES IMPORTANT WARNING: This email (and any attachments) is only intended for the use of the person or entity to which it is addressed, and may contain information that is privileged and confidential. You, the recipient, are obligated to maintain it in a safe, secure and confidential manner. Unauthorized redisclosure or failure to maintain confidentiality may subject you to federal and state penalties. If you are not the intended recipient, please immediately notify us by return email, and delete this message from your computer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20250811/f8fae625/attachment.htm>


More information about the fieldtrip mailing list