Skip to content

BIDS MEG CTF importer - #1463

Open
MaximeBICMTL wants to merge 1 commit into
aces:mainfrom
MaximeBICMTL:bids-meg-ctf-importer
Open

BIDS MEG CTF importer#1463
MaximeBICMTL wants to merge 1 commit into
aces:mainfrom
MaximeBICMTL:bids-meg-ctf-importer

Conversation

@MaximeBICMTL

@MaximeBICMTL MaximeBICMTL commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Extracted from #1397
Builds on #1462

Description

This PR adds support for MEG CTF import to the BIDS LORIS importer.

Thanks to previously merged PRs, no SQL patch is required to test the importer and view its data in the LORIS electrophysiology browser. However, note that this visualization may look incomplete (flat-looking signals and no sensor map). As there are still some PRs needed in the front-end to adapt the LORIS electrophysiology browser front-end to MEG data.

A MEG CTF acquisition is not a file but actually a directory. Unfortunately the renaming of CTF acquisitions is non-trivial and there does not seem to be a reliable code or tool to do so in Python (there is a function in mne-bids but it is obviously incomplete/incorrect). As such, the feature to rename BIDS CTF directories is added in the LORIS BIDS utilities, the code to do so being copied from Matlab.

Testing

This PR has been tested with the Brainstorm data sample (public data) and the MPN dataset (private data). Integration tests are to be added later.

Here is the output for the Brainstorm data sample. Note that the data sample is not used as-is, the subject label and participants.tsv file need to be modified to match the LORIS candidate identifier format.

/data/loris/bids_imports/MEG_BIDS_Brainstorm_data_sample_BIDSVersion_1.4.1
├── dataset_description.json
├── participants.tsv
├── README
└── sub-BS0001
    └── ses-V1
        ├── anat
        │   └── sub-BS0001_ses-V1_T1w.nii.gz
        ├── meg
        │   ├── sub-BS0001_ses-V1_task-AEF_run-01_channels.tsv
        │   ├── sub-BS0001_ses-V1_task-AEF_run-01_meg.ds
        │   │   ├── BadChannels
        │   │   ├── ChannelGroupSet.cfg
        │   │   ├── ClassFile.cls
        │   │   ├── MarkerFile.mrk
        │   │   ├── sub-BS0001_ses-V1_task-AEF_run-01_meg.acq
        │   │   ├── sub-BS0001_ses-V1_task-AEF_run-01_meg.eeg
        │   │   ├── sub-BS0001_ses-V1_task-AEF_run-01_meg.hc
        │   │   ├── sub-BS0001_ses-V1_task-AEF_run-01_meg.hist
        │   │   ├── sub-BS0001_ses-V1_task-AEF_run-01_meg.infods
        │   │   ├── sub-BS0001_ses-V1_task-AEF_run-01_meg.meg4
        │   │   └── sub-BS0001_ses-V1_task-AEF_run-01_meg.res4
        │   ├── sub-BS0001_ses-V1_task-AEF_run-02_channels.tsv
        │   └── sub-BS0001_ses-V1_task-AEF_run-02_meg.ds
        │       ├── BadChannels
        │       ├── ChannelGroupSet.cfg
        │       ├── ClassFile.cls
        │       ├── MarkerFile.mrk
        │       ├── sub-BS0001_ses-V1_task-AEF_run-02_meg.acq
        │       ├── sub-BS0001_ses-V1_task-AEF_run-02_meg.eeg
        │       ├── sub-BS0001_ses-V1_task-AEF_run-02_meg.hc
        │       ├── sub-BS0001_ses-V1_task-AEF_run-02_meg.hist
        │       ├── sub-BS0001_ses-V1_task-AEF_run-02_meg.infods
        │       ├── sub-BS0001_ses-V1_task-AEF_run-02_meg.meg4
        │       ├── sub-BS0001_ses-V1_task-AEF_run-02_meg.newds
        │       └── sub-BS0001_ses-V1_task-AEF_run-02_meg.res4
        └── sub-BS0001_ses-V1_scans.tsv

7 directories, 30 files

@MaximeBICMTL MaximeBICMTL added this to the 30.0.0 milestone Jul 16, 2026
@github-actions github-actions Bot added Language: Perl Issue or PR related to the Perl codebase Language: Python Issue or PR related to the Python codebase Package: BIDS importer PR or issue related to the BIDS importer Package: Utilities PR or issue related to the LORIS-agnostic utilities Package: BIDS utilities PR or issue related to the BIDS utilities labels Jul 16, 2026
@MaximeBICMTL
MaximeBICMTL force-pushed the bids-meg-ctf-importer branch 4 times, most recently from 82445bc to abe4d5a Compare July 19, 2026 07:11
@MaximeBICMTL
MaximeBICMTL force-pushed the bids-meg-ctf-importer branch from abe4d5a to b463f53 Compare July 21, 2026 05:25
@MaximeBICMTL
MaximeBICMTL force-pushed the bids-meg-ctf-importer branch 2 times, most recently from 602bff2 to 61978a8 Compare August 11, 2026 14:05
@MaximeBICMTL
MaximeBICMTL force-pushed the bids-meg-ctf-importer branch from 61978a8 to f9db852 Compare August 11, 2026 14:14
@MaximeBICMTL
MaximeBICMTL marked this pull request as ready for review August 11, 2026 14:15
@MaximeBICMTL MaximeBICMTL added Complexity: Complex Issue or PR that requires a great effort to implement, review, or test Category: Feature Issue or PR that aims to introduce a new feature labels Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Category: Feature Issue or PR that aims to introduce a new feature Complexity: Complex Issue or PR that requires a great effort to implement, review, or test Language: Perl Issue or PR related to the Perl codebase Language: Python Issue or PR related to the Python codebase Package: BIDS importer PR or issue related to the BIDS importer Package: BIDS utilities PR or issue related to the BIDS utilities Package: Utilities PR or issue related to the LORIS-agnostic utilities

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant