<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Roy,<div class=""><br class=""></div><div class="">without going into details, and from the top of my head some thoughts:</div><div class=""><br class=""></div><div class="">@1: Why do you need the other channel types in the topo? Would it make more sense to plot them separately? In that case, you can use a selection with cfg.channel for the desired channels in the plot function (or any other function).</div><div class=""><br class=""></div><div class="">@2: I guess there aren’t any restrictions. There are some conventions for the MEG gradiometers and magenetometers (see e.g. here: <a href="https://www.fieldtriptoolbox.org/reference/ft_chantype/" class="">https://www.fieldtriptoolbox.org/reference/ft_chantype/</a>).</div><div class=""><br class=""></div><div class="">@3: As before, I think you can specify the reference channel array. For example, if you want to re-reference channels 1:256 to the average reference, you could set cfg.refchannel = 1:256 in ft_preprocessing. Although in that case all channels will be referenced to the average of 1:256. For more refined referencing choices, ft_apply_montage might be more appropriate: <a href="https://www.fieldtriptoolbox.org/reference/ft_apply_montage/" class="">https://www.fieldtriptoolbox.org/reference/ft_apply_montage/</a> , or keeping the two datasets apart until the referencing is done might be easier.</div><div class=""><br class=""></div><div class="">Best,</div><div class=""><br class=""></div><div class="">Julian<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">Am 01.06.2021 um 13:47 schrieb Roy Cox via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>>:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">hello,<div class=""><br class=""></div><div class="">I'm having some trouble specifying several kinds of EEG recording details/metadata required for further processing. From looking at tutorials, functions, and the mailing list, it appears that Fieldtrip usually determines these things cleverly from the input data, but in my case this information needs to be manually added.</div><div class=""><br class=""></div><div class="">DATA</div><div class="">My data are 8-h continuous 265-channel signals in 

Brainvision format (256 "active" EEG channels, the implicit EEG reference [Cz, flatline], and 8 bipolar physiological signals). Data were originally recorded in EGI's mff format, but have since been downsampled and converted to Brainvision (no doubt resulting in some loss of metadata).</div><div class=""><br class=""></div><div class="">After reading data into Fieldtrip, I'm left with this bare-bones structure:</div><div class=""><br class=""></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""><div class="">data_ft = </div><div class=""><br class=""></div><div class="">  struct with fields:</div><div class=""><br class=""></div><div class="">    fsample: 250</div><div class="">      trial: {[265×7671535 single]}</div><div class="">       time: {[1×7671535 double]}</div><div class="">      label: {1×265 cell}</div><div class="">        cfg: [1×1 struct]</div></blockquote><div class=""><br class=""></div><div class="">Basically the data and channel labels (as present in the Brainvision file), nothing more.</div><div class=""><br class=""></div><div class="">ELECTRODE LOCATIONS<br class=""></div><div class="">I get my EEG electrode coordinates from reading the header of one of the original mffs:</div><div class=""><br class=""></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""><div class="">hdr_mff = ft_read_header(mff_file)</div><div class="">elec_eeg=hdr_mff.elec</div><div class=""><br class=""></div><div class="">elec_eeg = </div><div class=""><br class=""></div><div class="">  struct with fields:</div><div class=""><br class=""></div><div class="">     chanpos: [257×3 double]</div><div class="">    chantype: {257×1 cell}</div><div class="">    chanunit: {257×1 cell}</div><div class="">     elecpos: [257×3 double]</div><div class="">       label: {257×1 cell}</div><div class="">        type: 'egi256'</div><div class="">        unit: 'cm'</div></blockquote><div class=""><br class=""></div><div class="">So this reflects the 256+1 EEG electrodes, but not the physiological signals (presumably because the mff file doesn't - and couldn't - hold this information). I can turn these EEG coordinates into an EEG layout that looks accurate (and very similar to the EGI template layout provided in Fieldtrip):</div><div class=""><br class=""></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""><div class="">cfg = [];</div><div class="">cfg.elec = elec_eeg;</div><div class="">mff_layout = ft_prepare_layout(cfg);</div><div class="">figure</div><div class="">ft_plot_layout(mff_layout);</div></blockquote><div class=""><br class=""></div><div class="">So far so good.</div><div class=""><br class=""></div><div class="">Q1: how do I add (mock) location information for the bipolar phys signals? I imagine I'll run into trouble if channel/electrode counts don't match between ft_data and elec_eeg. It would also be nice to be able to create a layout that includes the phys signals (which means they should be present in the elec_eeg struct). Do I manually expand the elec_eeg fields from 257 to 265? Suggestions for mock values that work well with ft_prepare_layout?</div><div class=""><br class=""></div><div class="">CHANNEL TYPES</div><div class="">Q2: how/where do I specify that the 8 phys channels are not EEG? Can elec_eeg.chantype be set to "non-eeg" or even more specific types (e.g., we have ecg, emg, etc..)? I can't find an overview of allowed channel types. And is it only the elec_eeg structure that needs this info, or do I need to specify it elsewhere too? (Ultimately, I'd like to be able to use ft_selectdata to select specific channel types etc.)</div><div class=""><br class=""></div><div class="">REFERENCE</div><div class="">Q3: how/where do I indicate that the first 256 channels are referenced to channel 257 (Cz, which is flatline), and that channels 258-265 are bipolar channels, such that later re-referencing works as intended? (I know having the EEG refence channel explicitly in the data is uncommon, so perhaps it needs to be deleted?)</div><div class=""><br class=""></div><div class="">Thanks for any input!</div><div class=""><br class=""></div><div class="">Best,</div><div class="">Roy</div><div class=""><br class=""></div></div>
_______________________________________________<br class="">fieldtrip mailing list<br class=""><a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">https://doi.org/10.1371/journal.pcbi.1002202<br class=""></div></blockquote></div><br class=""></div></body></html>