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

Supporting CNTs (Neuroscan) files #922

Closed
yjmantilla opened this issue Dec 1, 2021 · 8 comments · Fixed by #924
Closed

Supporting CNTs (Neuroscan) files #922

yjmantilla opened this issue Dec 1, 2021 · 8 comments · Fixed by #924

Comments

@yjmantilla
Copy link
Contributor

yjmantilla commented Dec 1, 2021

Describe the problem

Hi mne-bids team. I was wondering if there was any reason for not supporting CNTs. I have run into some problems when using write_raw_bids and I noticed it was not on the list of eeg extensions:

eeg_manufacturers = {'.vhdr': 'BrainProducts', '.eeg': 'BrainProducts',
'.edf': 'n/a', '.EDF': 'n/a', '.bdf': 'Biosemi',
'.BDF': 'Biosemi',
'.set': 'n/a', '.fdt': 'n/a',
'.lay': 'Persyst', '.dat': 'Persyst',
'.EEG': 'Nihon Kohden'}

Is there a reason for not supporting it beyond not being included on this dictionary?

@welcome
Copy link

welcome bot commented Dec 1, 2021

Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴🏽‍♂️

@agramfort
Copy link
Member

agramfort commented Dec 1, 2021 via email

@yjmantilla
Copy link
Contributor Author

yjmantilla commented Dec 1, 2021

Thanks @agramfort , I meant as an input format (that is, I want to convert from cnt to any of the accepted bids formats).

Right now I think it is giving an error when it extracts the .cnt extesion and is not able to pass the ALLOWED_INPUT_EXTENSIONS check:

mne-bids/mne_bids/write.py

Lines 1365 to 1383 in 4c0755c

if not allow_preload:
raw_fname = raw.filenames[0]
if '.ds' in op.dirname(raw.filenames[0]):
raw_fname = op.dirname(raw.filenames[0])
# point to file containing header info for multifile systems
raw_fname = raw_fname.replace('.eeg', '.vhdr')
raw_fname = raw_fname.replace('.fdt', '.set')
raw_fname = raw_fname.replace('.dat', '.lay')
_, ext = _parse_ext(raw_fname)
# force all EDF/BDF files with upper-case extension to be written as
# lower case
if ext == '.EDF':
ext = '.edf'
elif ext == '.BDF':
ext = '.bdf'
if ext not in ALLOWED_INPUT_EXTENSIONS:
raise ValueError(f'Unrecognized file format {ext}')

Maybe I'm doing something wrong, Im just opening the file with the read_raw mne function and passing the Raw object to the write_raw_bids function .

@yjmantilla
Copy link
Contributor Author

Here is a colab with the replication of the error I get:

https://colab.research.google.com/drive/1cKaSnQglJwdLL-isNBlN6z5p_LixvkJN?usp=sharing

@hoechenberger
Copy link
Member

@sappelhoff WDYT?

@sappelhoff
Copy link
Member

Hi @yjmantilla :)

I think if we are supporting Nihon Kohden and Persyst, we might as well support CNT ... as long as all of these non-supported file formats get auto-converted into a BIDS supported format. Could be an added feature in a PR?

@agramfort
Copy link
Member

agramfort commented Dec 1, 2021 via email

@yjmantilla
Copy link
Contributor Author

@sappelhoff Thanks!

I could test what happens if one naively just adds the .cnt format to the MANUFACTURERS dictionary, and start from there what would be required to accept support cnt .

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

Successfully merging a pull request may close this issue.

4 participants