Convert brainstorm channel .xyz file or sfp file into mne raw fif

External Email - Use Caution

Dear MNE community,

I want to use a set of electrode channel locations for my subjects. I have channel location files in format of .xyz and .sfp generated from brainstorm (already coregistered), does anyone know how to convert to fif file? I can setup montage by reading sfp files, but I don't know how to replace the raw.info<http://raw.info> using the montage information. Also how to get the trans.fif file?

Thank you very much for your time

Best,

Feng Liu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20181206/c69c04a7/attachment.html

External Email - Use Caution

see:

https://martinos.org/mne/dev/generated/mne.channels.read_montage.html

and then

raw.set_montage

should do the job.

HTH
Alex

External Email - Use Caution

Hi Alex,

Thank you for your reply. I can read sfp files using raw.set_montage, do you know should I manually replace the raw.info with the montage information, in the end, I want to build the forward model using mne.make_forward_solution(), as you know this function requires raw.info as a mandatory input. I thought there should be a link from montage to raw.info.

Best regards,
Feng

Sorry that I think it is more helpful to post the error message.

montage = mne.channels.read_montage( '/home/scratch/brainstorm_db/Protocol01/data/106a_recon/BioSemi_128_A01.sfp')
raw.set_montage(montage=montage)

ValueError: None of the sensors defined in the montage were found in the info structure. Check the channel names.

This is the structure of raw.info:

<Info | 19 non-empty fields
    bads : list | MEG 2443, EEG 053
    ch_names : list | MEG 0113, MEG 0112, MEG 0111, MEG 0122, MEG 0123, ...
    chs : list | 376 items (GRAD: 204, MAG: 102, STIM: 9, EEG: 60, EOG: 1)
    comps : list | 0 items

I think when I use setup_montage, it will check the original channel names, it will assign the value only if the name under montage match the name under raw.info['ch_names']. So do I need to delete all the raw.info['ch_names'] and re-assign channels names?

Best,

Feng Liu

External Email - Use Caution

what are you trying to do?

it seems that you use the sample dataset info for your EEG data which
should not be necessary.

Alex

Hi Alex,

I am trying to compare the forward models and signal changes among control vs patients, I only have the T1 scans. I have to make assumed locations for all the channels. I have done recon all, I need something like raw.info and trans file to get it done. If you have any suggestions, I would appreciate it a lot.

Best,
Feng

External Email - Use Caution

I would suggest your read our documentation about Measurement Info,
coregistration and how to use freesurfer

since you're at MGH you can certainly go see Sheraz Khan for help

Alex

External Email - Use Caution

Sure, definitely. I will read through the documentation, if I can't figure out, I will ask Sheraz, he knows everything.

Thanks again,

Best
Feng