<div dir="ltr">Dear Tyler,<div>Perhaps you'll find this old post helpful:</div><div><br></div><div><a href="http://mailman.science.ru.nl/pipermail/fieldtrip/2014-January/007437.html">http://mailman.science.ru.nl/pipermail/fieldtrip/2014-January/007437.html</a><br>
</div><div><br></div><div>it holds a piece of code that uses the iso2mesh option added by Daniel Wong, <span style="color:rgb(0,0,0)">Sarang Dalal, and Robert Oostenveld, that solves such cases of intersecting meshes.</span></div>
<div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">Hope this helps!</span></div><div><span style="color:rgb(0,0,0)">Best,</span></div><div><span style="color:rgb(0,0,0)">roey</span></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 30, 2014 at 5:17 AM, Tyler Grummett <span dir="ltr"><<a href="mailto:tyler.grummett@flinders.edu.au" target="_blank">tyler.grummett@flinders.edu.au</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello all,<br>
<br>
Thank you for the quick replies, I greatly appreciate it.<br>
<br>
I recalculated vol using the following code:<br>
<br>
mri = ft_read_mri( 'Subject01.mri');<br>
mri = ft_volumenormalise( [], mri);<br>
mri = ft_volumereslice([], mri);<br>
cfg = [];<br>
cfg.write      = 'no';<br>
cfg.coordsys   = 'mni';<br>
segmentedmri = ft_volumesegment(cfg, mri);<br>
<br>
cfg = [];<br>
cfg.method = 'openmeeg';<br>
vol = ft_prepare_headmodel(cfg, segmentedmri);<br>
<br>
However I got the following error when using openmeeg (I followed the instructions on how to install the binary files from openmeeg).<br>
<br>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!<br>
!!!!!!!!!!! WARNING !!!!!!!!!!!<br>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!<br>
Mesh is self intersecting !<br>
Mesh Info :<br>
        # points : 3000<br>
        # triangles : 5996<br>
        Euler characteristic : 2<br>
        Min Area : 2.44949<br>
        Max Area : 58.4166<br>
Self intersection for mesh number 0<br>
<br>
C:\Users\grum0003\AppData\Local\Temp>om_minverser ./tp6461637d_b0c5_4880_9da7_46771d35b5bc.bin ./tp844032d5_1439_4794_b28e_c554e265bca8.bin<br>
om_minverser version 2.1.0 (799) compiled at Aug 17 2011 19:50:11<br>
<br>
<br>
| ------ om_minverser<br>
| ./tp6461637d_b0c5_4880_9da7_46771d35b5bc.bin<br>
| ./tp844032d5_1439_4794_b28e_c554e265bca8.bin<br>
| -----------------------<br>
Exception: Unable to open the file ./tp6461637d_b0c5_4880_9da7_46771d35b5bc.bin for reading Doing my best....<br>
Error using fread<br>
Invalid file identifier.  Use fopen to generate a valid file identifier.<br>
the call to "ft_prepare_headmodel" took 21 seconds<br>
<br>
<br>
I am still able to generate a boundary element model (see attached). Please inform me if they are correct. I had some issues with ft_sensorrealign and using openmeeg. However it is looking a lot better.<br>
<br>
I just tried to prepare the leadfield and got the following error:<br>
<br>
*************************<br>
<br>
No system matrix is present, calling the Nemo Lab pipeline...<br>
om_assemble version 2.1.0 (799) compiled at Aug 17 2011 19:50:41<br>
<br>
Not enough arguments<br>
Please try "om_assemble -h" or "om_assemble --help "<br>
<br>
Writing sensor coordinates...<br>
Error using fprintf<br>
Invalid file identifier.  Use fopen to generate a valid file identifier.<br>
<br>
Error in ft_leadfield_openmeeg (line 113)<br>
            fprintf(fid,'%s\t%.15f\t%.15f\t%.15f\n', sens.label{ii}, sens.chanpos(ii,:));<br>
<br>
Error in ft_compute_leadfield (line 442)<br>
        lf = ft_leadfield_openmeeg(pos, vol, sens);<br>
<br>
Error in ft_prepare_leadfield (line 187)<br>
      lf = ft_compute_leadfield(grid.pos(grid.inside(batch),:), sens, vol, 'reducerank',<br>
      cfg.reducerank, 'normalize', cfg.normalize, 'normalizeparam', cfg.normalizeparam);<br>
*************************<br>
<br>
So it looks like I need to sort this issue out before I can proceed.<br>
<br>
Thank you for all your help again!<br>
<div class=""><br>
Tyler<br>
<br>
*************************<br>
<br>
Tyler Grummett ( BBSc, BSc(Hons I))<br>
PhD Candidate<br>
Brain Signals Laboratory<br>
Flinders University<br>
Rm 5A301<br>
Ext 66124<br>
<br>
________________________________________<br>
</div>From: <a href="mailto:fieldtrip-bounces@science.ru.nl">fieldtrip-bounces@science.ru.nl</a> <<a href="mailto:fieldtrip-bounces@science.ru.nl">fieldtrip-bounces@science.ru.nl</a>> on behalf of Matt Craddock <<a href="mailto:matt.craddock@uni-leipzig.de">matt.craddock@uni-leipzig.de</a>><br>

Sent: Friday, 27 June 2014 8:21 PM<br>
To: <a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a><br>
Subject: Re: [FieldTrip] Fwd:  Beamformer confusion<br>
<div class="HOEnZb"><div class="h5"><br>
Hi Tyler,<br>
<br>
 From the plot, it looks like the volume conductor is singlesphere but<br>
the sourcemodel is derived from the standard boundary element model, and<br>
the electrodes are then not aligned to either of them. First up, I'd<br>
suggest using the standard BEM as your volume conductor and see if that<br>
helps. The electrode positions may be the next thing to fix - they might<br>
re-align automatically properly, in which case you won't need to do<br>
anything. If they have standard 1020/1005 co-ordinates, they should be<br>
aligned fine already, but if not you could try replacing the positions<br>
in your dataset with the standard positions (i.e. if you have an Fp1,<br>
take the Fp1 co-ordinates from the templates in the<br>
fieldtrip\template\electrode directory).<br>
<br>
Cheers,<br>
Matt<br>
<br>
On 27/06/2014 06:41, Eelke Spaak wrote:<br>
> PS: Forwarding your figure to the list.<br>
><br>
 ><br>
> ---------- Forwarded message ----------<br>
> From: Eelke Spaak <<a href="mailto:eelke.spaak@donders.ru.nl">eelke.spaak@donders.ru.nl</a>><br>
> Date: 27 June 2014 07:40<br>
> Subject: Re: [FieldTrip] Beamformer confusion<br>
> To: Email discussion list for the FieldTrip project <<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a>><br>
><br>
><br>
> Hi Tyler,<br>
><br>
> First, please send your messages to the list, so that others may<br>
> benefit (now or in the future through the archives).<br>
><br>
> Then, regarding your plot, indeed I think there might be something<br>
> wrong (though I am not sure). You are looking for a proper alignment<br>
> between the sensors (I have colored them red to be able to better<br>
> see), the source model (grid points for beamforming) and the volume<br>
> conductor model (translucent mesh; sphere in your case). I have never<br>
> used a single sphere model myself, so I cannot really comment on<br>
> whether the sphere aligns properly. However, I would suspect not,<br>
> since there are grid points located outside the sphere. Also, the<br>
> sensors might not be properly located, some are intersecting the body<br>
> of grid points.<br>
><br>
> But I do seem to recall that sensors are automatically projected to<br>
> the volume conductor surface in the case of EEG. Maybe someone who has<br>
> EEG source modelling experience can comment on this (and your figure)?<br>
> I usually only work with MEG, so I don't have the same intuition for<br>
> your kind of plot as with an analogous plot for MEG.<br>
><br>
> The following tutorial might be very helpful for you, by the way:<br>
> <a href="http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg" target="_blank">http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg</a><br>
><br>
> Best,<br>
> Eelke<br>
><br>
> On 27 June 2014 03:06, Tyler Grummett <<a href="mailto:tyler.grummett@flinders.edu.au">tyler.grummett@flinders.edu.au</a>> wrote:<br>
>> Hello Eelke,<br>
>><br>
>> Thank you for replying to my email.<br>
>><br>
>> I have attached an image with the requested sourcemodel positions and sensor positions.<br>
>><br>
>> I dont really know how to interpret the figures to be honest.<br>
>><br>
>> I have attached a .fig figure so that you can have a play with it.<br>
>><br>
>> Tyler<br>
>><br>
>> *************************<br>
>><br>
>> Tyler Grummett ( BBSc, BSc(Hons I))<br>
>> PhD Candidate<br>
>> Brain Signals Laboratory<br>
>> Flinders University<br>
>> Rm 5A301<br>
>> Ext 66124<br>
>><br>
>> ________________________________________<br>
>> From: <a href="mailto:fieldtrip-bounces@science.ru.nl">fieldtrip-bounces@science.ru.nl</a> <<a href="mailto:fieldtrip-bounces@science.ru.nl">fieldtrip-bounces@science.ru.nl</a>> on behalf of Eelke Spaak <<a href="mailto:eelke.spaak@donders.ru.nl">eelke.spaak@donders.ru.nl</a>><br>

>> Sent: Thursday, 26 June 2014 11:17 PM<br>
>> To: FieldTrip discussion list<br>
>> Subject: Re: [FieldTrip] Beamformer confusion<br>
>><br>
>> Hi Tyler,<br>
>><br>
>> You write that you end up with the same result "whatever data you<br>
>> process", so I suspect the raw EEG/MEG data is not to blame.<br>
>><br>
>> Rather, I suspect something is wrong with your leadfield or one of its<br>
>> ingredients: the volume conductor model, source model, or<br>
>> electrode/gradiometer definitions. It's probably a good idea to check<br>
>> whether these three ingredients all line up. Could you plot them in<br>
>> one set of axes, as described at the end of this section:<br>
>> <a href="http://fieldtrip.fcdonders.nl/tutorial/beamformingextended#computing_the_sourcemodel" target="_blank">http://fieldtrip.fcdonders.nl/tutorial/beamformingextended#computing_the_sourcemodel</a><br>
>> ?<br>
>><br>
>> Best,<br>
>> Eelke<br>
>><br>
>> On 26 June 2014 10:00, Tyler Grummett <<a href="mailto:tyler.grummett@flinders.edu.au">tyler.grummett@flinders.edu.au</a>> wrote:<br>
>>> Hello Fieldtrip,<br>
>>><br>
>>><br>
>>> I have been using the LCMV beamformer in fieldtrip for some time now, so I<br>
>>> have experience with it.<br>
>>><br>
>>><br>
>>> I am facing an issue where whatever data I process I get an image identical<br>
>>> to attachment 'sourceplot.png'. We have tried visual SSR, memory tasks,<br>
>>> tactile tasks etc.<br>
>>><br>
>>> Also, whatever I do with the data, the same issue occurs (filtering etc).<br>
>>><br>
>>><br>
>>> Attachment 'original_data.png' shows the data before going into the<br>
>>> beamformer, and 'virtual_data.png' shows the data after it has run through<br>
>>> beamformer.<br>
>>><br>
>>><br>
>>> We have tried filtering in every possible combination ie lowpass = 40/30/20,<br>
>>> highpass = 1/10/20, we even did a highpass of 100 and it<br>
>>><br>
>>> was still identical.<br>
>>><br>
>>><br>
>>> We dont think this is a fault of the beamformer, but we cant work out how to<br>
>>> get rid of the issue. It is overpowering the other data.<br>
>>><br>
>>><br>
>>> We have also had a look at some spectra of the brain region with the high<br>
>>> power and a brain region that doesnt have the high power and it appears<br>
>>><br>
>>> as though there is higher power over all frequencies.<br>
>>><br>
>>><br>
>>> Before asking:<br>
>>><br>
>>> -There isnt any muscle, the data was recorded from a paralysed person.<br>
>>><br>
>>> -We have tried it on CAR'd data and data that hasnt been CAR'd<br>
>>><br>
>>><br>
>>> We are all out of ideas.<br>
>>><br>
>>><br>
>>> Kind regards,<br>
>>><br>
>>><br>
>>> Tyler<br>
><br>
<br>
--<br>
Dr. Matt Craddock<br>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></div></div><br>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br></div>