Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add convenience function to write certain EEG metadata #1168

Open
hoechenberger opened this issue Sep 19, 2023 · 3 comments
Open

Add convenience function to write certain EEG metadata #1168

hoechenberger opened this issue Sep 19, 2023 · 3 comments

Comments

@hoechenberger
Copy link
Member

Describe the problem

Working with EEG data, I find myself writing the following to ensure more complete metadata:

        bp_written = mne_bids.write_raw_bids(...)

        # Update EEG metadata
        bp_eeg_json = bp_written.update(extension=".json")
        updated_eeg_metdata = {
            "EEGReference": "Oz",
            "EEGGround": "Fpz",
            "CapManufacturer": "EasyCap",
            "ManufacturersModelName": "actiCHamp"
        }
        mne_bids.update_sidecar_json(bids_path=bp_eeg_json, entries=updated_eeg_metdata)

Since this information (reference, ground electrode, amplifier and cap manufacturer) should ideally always be written for EEG, it would be great to make this easier for users.

Describe your solution

Add a new method BIDSPath.update_eeg_metadata() to conveniently add this information:

def update_eeg_metadata(
    *,
    amplifier_model: str,
    cap_manufacturer: str,
    reference: str,
    ground: str,
) -> None:
    ...

Describe possible alternatives

Add this functional to write_raw_bids(), but I don't think we'll want to have so many new parameters.

Additional context

This is related to #713

@agramfort
Copy link
Member

I find that it overfits the EEG use case and it makes us maintain a mapping between our parameter names and the BIDS standard.

my 2c

@hoechenberger
Copy link
Member Author

Any other ideas on how we could make the process easier for users then? I think we're making it too hard for users to produce datasets with "complete" metadata

@sappelhoff
Copy link
Member

I follow the same workflow as you @hoechenberger.

I think that if we don't want to add a convenience function to the code base (in order to avoid overfitting for EEG), perhaps we can add an example on how to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants