mne-bids: modifying .ds directory name in BIDS dataset

  • MNE version: 1.6.0
  • operating system: Linux

Hello,

I’ve recently been using mne-bids on some MEG I’ve acquired, and have a conceptual question rather than a technical issue; the BIDS conversion process is relatively straightforward.

I have CTF (.ds) data that when converted to BIDS appears like this tree structure:

|--- sub-01_task-bart_run-01_meg.ds/
|------ BadChannels
|------ ClassFile.cls
|------ MarkerFile.mrk
|------ sub-01_task-bart_run-01_meg.acq
|------ sub-01_task-bart_run-01_meg.hc
|------ sub-01_task-bart_run-01_meg.infods
|------ sub-01_task-bart_run-01_meg.meg4
|------ sub-01_task-bart_run-01_meg.newds
|------ sub-01_task-bart_run-01_meg.res4
|------ bad.segments
|------ params.dsc
|------ processing.cfg

I would like to modify the subject ID to sub-001 after the conversion process; however, I recall being told that changing the .ds directory file name can severe the link between it and the corresponding files within. Is this therefore improper to modify the directory and file names by simply using the Unix mv command, or does mne-bids have a specific method for achieving this (it appears this function may be relevant)? As someone new to MEG, I’m unfamiliar with these conventions.

Thanks for the assistance.

why is it not possible to convert with exactly that subject label already (“001”) ?

indeed, that’s what mne-bids does under the hood. So in case you really want to change the names AFTER conversion, I recommend you make use of that code :slight_smile:

1 Like

For my case, yes, I would simply specify my preferred subject ID in mne_bids.write_raw_bids, but I’m envisioning a scenario where a user has a BIDS dataset without the raw data available, and wants to modify the naming convention (for whatever reason). For MRI modality data, simply changing the file names isn’t a problem, so long as it’s consistent.

If that’s the case then I’ll make use of that copyfile_ctf function. It seems to be performing a simple move/rename procedure, but that’s good for me to know. Thanks for the clarification!

1 Like