Importing MEG data preprocessed with SPM

Dear Brainstorm Community,

I have MEG data preprocessed in SPM and already epoched (recorded in a Yokogawa system). I would like to import these datasets and perform source modeling in brainstorm. Due to the epoched file, the in_fopen_spm function would not work. I was trying to write code myself to import it anyhow. First, I used the in_fopen_spm function to create a channel file (that works, however so far the fiducials and MEG sensor array seem to be in different coordinate systems, as the head model is visualized much smaller than the helmet- this seemed to be the case for continuous SPM data as well). Second, I import the single trials using a default data structure and filling the information from the spm file (see attached). Would you be able to help me to include all necessary information, that I might also need later on for source reconstruction and check the source localization issue with me? Let me know if I should send some raw data. Thank you for your help, Bahne

in_fopen_spm_bb.m (7.0 KB)
custom_import_spmdata.m (2.6 KB)

Hi Bahne, do you have the same issue with the helmet size when you use the "Review raw file" option in the GUI?

Hi @Raymundo.Cassani , thank you very much for your reply! yes, when I use the review file option with an SPM file (continuous) and want to visualize the head model, I also have the issue. When I review the actual raw file (*.con) using review raw file option, the head model is visualized correctly. This however also gives me several location entries in the channel file .channel array, which do not appear in the spm file, when reviewed as raw file. I now use the channel file from the raw file for the preprocessed and epoched spm data that I import as trials. I just copy the channel info for the MEG channels from the raw data file read into brainstorm via the usual way into a new channel file that I put into the import folder. I am however not sure, if I can simply do that without loosing information or falsifying amplitudes/locations etc that SPM assumes?! Thank you, Bahne

Hi all, I do not need further assistance with that. I moved forward, cleaning the data manually myself, so I don't need to import preprocessed data. Still might be useful to implement a solution for SPM preprocessed data in the future. Thanks, Bahne