[FieldTrip] Simbio works with ft_volumereslice but leadfield

Carsten Wolters carsten.wolters at uni-muenster.de
Thu Apr 14 11:26:48 CEST 2016


Dear Rajat,

we will need a little bit more informations where you are stuck or where 
the calculations are way too long?

In ft_prepare_headmodel the FEM stiffness matrix is computed, which 
should not take much time.

In ft_prepare_sourcemodel, a so-called FE transfer matrix is computed. 
To do so, for each electrode (but reference)
a FEM linear equation system needs to be solved. The time for it thus 
scales with your number of electrodes.
A fully-populated matrix will be resulting that has "number of 
electrodes -1" many rows and "number of FE nodes" many columns.
For a reasonable number of electrodes and with your big memory (32 GB), 
this should
not cause any trouble, but ft_prepare_sourcemodel might be the 
computationally most expensive
step (but has to be done only once for a given FE model and electrode 
setup, so just start it in the
evening).

Once the transfer matrix is computed, each FEM forward computation is 
extremenly fast and therefore also the setup of the
leadfield matrix with ft_prepare_leadfield. This should be the case, 
because for each source,
only a right-hand-side in the size "number of FE nodes", but with only 
about 30 nonzeros, has
to be computed and multiplied with the transfer  matrix, which takes all 
together only milliseconds.
So a 128^3 grid should not cause any trouble, as long as the transfer 
matrix fits in the memory
(which should also be the case with 32GB), so that the computer doesn't 
need to swap.

Best regards
      Carsten

Am 13.04.2016 um 16:25 schrieb Rajat Thomas:
> Dear all,
>
> Last week I asked for help with Simbio and after following the suggestion of volume reslicing magically the
> simbio based headmodel was created.
>
> But my leadfield calculations are taking way too long.
> It is a 128^3 grid and am running it on my desktop. (2.4 GHz, plenty of memory 32GB)
>
> Could anyone give me a rough ball park on how long it should take to create a leadfield?
>
> Thank you.
> Rajat
>
>
>
> Rajat Mani Thomas
> Social Brain Lab
> Netherlands Institute for Neuroscience
> Amsterdam
>
> ________________________________________
> From: fieldtrip-bounces at science.ru.nl <fieldtrip-bounces at science.ru.nl> on behalf of fieldtrip-request at science.ru.nl <fieldtrip-request at science.ru.nl>
> Sent: 08 April 2016 12:00
> To: fieldtrip at science.ru.nl
> Subject: fieldtrip Digest, Vol 65, Issue 7
>
> Send fieldtrip mailing list submissions to
>          fieldtrip at science.ru.nl
>
> To subscribe or unsubscribe via the World Wide Web, visit
>          http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> or, via email, send a message with subject or body 'help' to
>          fieldtrip-request at science.ru.nl
>
> You can reach the person managing the list at
>          fieldtrip-owner at science.ru.nl
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of fieldtrip digest..."
>
>
> Today's Topics:
>
>     1. Re: FEM using Simbio (Johannes Vorwerk)
>     2. Re: FEM using Simbio (Cristiano Micheli)
>     3. Dipole fitting (Giovanni Pellegrino)
>     4. Birmingham-Illinois BRIDGE Fellowships (Ole Jensen)
>     5. Using FieldTrip to analyse LFP recordings in rat
>        (laetitia.lalla at inserm.fr)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 7 Apr 2016 14:25:42 +0200
> From: Johannes Vorwerk <j.vorwerk at uni-muenster.de>
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Subject: Re: [FieldTrip] FEM using Simbio
> Message-ID: <435735E3-7D87-4DD6-A2C1-E2BBFBBF4B44 at googlemail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi,
>
> this question was already answered in this thread
>
> http://mailman.science.ru.nl/pipermail/fieldtrip/2016-March/010274.html <http://mailman.science.ru.nl/pipermail/fieldtrip/2016-March/010274.html>
>
> If ft_volumereslice is not applied before the mesh generation, the afterwards applied transformation might flip the directions of the mesh, leading to the described error.
>
> Best,
>          Johannes
>
>> Am 06.04.2016 um 16:03 schrieb Carsten Wolters <carsten.wolters at uni-muenster.de>:
>>
>> Dear Rajat,
>>
>> the element-node cards of SimBio-NeuroFEM need to follow certain orientations (see www.simbio.de <http://www.simbio.de/>).
>>
>> If you do not want to struggle with meshing/ordering, use the SimBio-VGRID mesher
>> http://vgrid.simbio.de/ <http://vgrid.simbio.de/>
>> that follows the required ordering of nodes. You might use this mesher to produce 1mm geometry-adapted FEM meshes
>> that show good overall performance, see
>> http://www.sci.utah.edu/~wolters/PaperWolters/2007/WoltersEtAl_IEEE_TBME_2007.pdf <http://www.sci.utah.edu/~wolters/PaperWolters/2007/WoltersEtAl_IEEE_TBME_2007.pdf>
>> and
>> http://www.sci.utah.edu/~wolters/PaperWolters/2016/WagnerLuckaVorwerkHerrmannNolteBurgerWolters_NeuroImage_2016.pdf <http://www.sci.utah.edu/~wolters/PaperWolters/2016/WagnerLuckaVorwerkHerrmannNolteBurgerWolters_NeuroImage_2016.pdf>
>> (latter was just accepted by NeuroImage).
>>
>> Best regards
>>        Carsten
>>
>> Am 06.04.2016 um 15:10 schrieb Rajat Thomas:
>>> Dear all,
>>>
>>> Has anyone used the FEM approach to Headmodels using Simbio recently?
>>>
>>> If so, I get this error:
>>> "Elements have wrong orientation or are degenerated"
>>>
>>> Any ideas?
>>>
>>> cfg        = [];
>>> cfg.method ='simbio';
>>> cfg.conductivity = [0.33 0.14 1.79 0.01 0.43];   % order follows mesh.tissyelabel
>>> vol        = ft_prepare_headmodel(cfg, mesh);
>>>
>>> And;
>>> ?
>>> disp(mesh)
>>>              hex: [545883x8 double]
>>>              pnt: [569722x3 double]
>>>           labels: [545883x1 double]
>>>           tissue: [545883x1 double]
>>>      tissuelabel: {'csf'  'gray'  'scalp'  'skull'  'white'}
>>>             unit: 'mm'
>>>              cfg: [1x1 struct]
>>>
>>> Any help would be highly appreciated.
>>>
>>> Rajat
>>>
>>>
>>>
>>>
>>>
>>>
>>> Rajat Mani Thomas
>>> Social Brain Lab
>>> Netherlands Institute for Neuroscience
>>> Amsterdam
>>>
>>>
>>> _______________________________________________
>>> fieldtrip mailing list
>>> fieldtrip at donders.ru.nl <mailto:fieldtrip at donders.ru.nl>
>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip <http://mailman.science.ru.nl/mailman/listinfo/fieldtrip>
>> <carsten_wolters.vcf>_______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl <mailto:fieldtrip at donders.ru.nl>
>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip <http://mailman.science.ru.nl/mailman/listinfo/fieldtrip>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160407/2ea995ee/attachment-0001.html>
>
> ------------------------------
>
> Message: 2
> Date: Thu, 7 Apr 2016 17:36:37 +0200
> From: Cristiano Micheli <michelic72 at gmail.com>
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Subject: Re: [FieldTrip] FEM using Simbio
> Message-ID:
>          <CADW7XCAQONsZ_ujPhkffskZ+j-mnHnAzunS68CdKU6MLSosUPA at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi Rajat
>
> My guess is that the orientations of your hexahedrons are not correct.
> According to a low-level file's internal rules, elements' orientations have
> to abide strict rules (not sure what exactly the contraints are in this
> case though...).
> I had same problems when for example the triangular boundaries used to
> define the 3d hexahedral mesh were not topologically correct, to start with.
> Admittedly this approach requires a lot of technical expertise.
> Can I ask you what do you need a FEM model for?
>
> Regards
> Cris Micheli
>
>
>
>
> On Wed, Apr 6, 2016 at 3:10 PM, Rajat Thomas <r.thomas at nin.knaw.nl> wrote:
>
>> Dear all,
>>
>>
>> Has anyone used the FEM approach to Headmodels using Simbio recently?
>>
>>
>> If so, I get this error:
>> "Elements have wrong orientation or are degenerated"
>>
>> Any ideas?
>>
>> cfg        = [];
>>
>> cfg.method ='simbio';
>>
>> cfg.conductivity = [0.33 0.14 1.79 0.01 0.43];   % order follows
>> mesh.tissyelabel
>>
>> vol        = ft_prepare_headmodel(cfg, mesh);
>>
>>
>> And;
>>
>> ?
>> disp(mesh)
>>              hex: [545883x8 double]
>>              pnt: [569722x3 double]
>>           labels: [545883x1 double]
>>           tissue: [545883x1 double]
>>      tissuelabel: {'csf'  'gray'  'scalp'  'skull'  'white'}
>>             unit: 'mm'
>>              cfg: [1x1 struct]
>>
>>
>> Any help would be highly appreciated.
>>
>> Rajat
>>
>>
>>
>>
>>
>>
>> Rajat Mani Thomas
>> Social Brain Lab
>> Netherlands Institute for Neuroscience
>> Amsterdam
>>
>> _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl
>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160407/4adfe55a/attachment-0001.html>
>
> ------------------------------
>
> Message: 3
> Date: Thu, 7 Apr 2016 15:02:05 -0400
> From: Giovanni Pellegrino <giovannipellegrino at gmail.com>
> To: fieldtrip at science.ru.nl
> Subject: [FieldTrip] Dipole fitting
> Message-ID:
>          <CAN6FyLVw=e7gOOvGDo47fT3j0frr8FUAEcsm55O8ZzqA=u8GDw at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Dear Fieldtrippers,
>
> Do you know if the FieldTrip Dipole Fitting has been compared to the CTF,
> Elekta, BESA or Curry? Are you aware of any study on this topic?
>
> Thanks in advance for your help
>
> Giovanni
>
> --
> Giovanni Pellegrino, MD
> Multimodal Functional Imaging Laboratory
> Montreal Neurological Institute, McGill University
> Address: 332 Duff Medical Building, 3775 rue University, Montreal, QC, H3A
> 2B4, Canada
> Phone: (514) 398?1678
> Fax: (514) 398?7461
> Email: giovannipellegrino at gmail.com, giovanni.pellegrino2 at mcgill.ca
> Homepage: http://www.bic.mni.mcgill.ca/ResearchLabsMFIL/PeopleGiovanni
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160407/d01144bd/attachment-0001.html>
>
> ------------------------------
>
> Message: 4
> Date: Fri, 8 Apr 2016 09:23:46 +0200
> From: Ole Jensen <ole.jensen at donders.ru.nl>
> To: fieldtrip at science.ru.nl
> Subject: [FieldTrip] Birmingham-Illinois BRIDGE Fellowships
> Message-ID: <57075C82.8030309 at donders.ru.nl>
> Content-Type: text/plain; charset=utf-8; format=flowed
>
> Dear all,
>
> I would like to point you to a set of Birmingham-Illinois BRIDGE
> Fellowships providing some exciting research and career prospects:
> http://www.birminghamillinoisbridge.org/index.php/fellows/
>
> In particular the areas 'Cognition and Ageing' and 'Brain Trauma' could
> be relevant for candidates with EEG/MEG expertise.
>
> All the best,
>
> Ole
>
> --
> Prof. dr. Ole Jensen
> http://www.neuosc.com
>
>
>
> ------------------------------
>
> Message: 5
> Date: Fri, 08 Apr 2016 10:27:58 +0200
> From: laetitia.lalla at inserm.fr
> To: fieldtrip at science.ru.nl
> Subject: [FieldTrip] Using FieldTrip to analyse LFP recordings in rat
> Message-ID: <628babdc107aebd4cc7588ea87ce5ea6 at inserm.fr>
> Content-Type: text/plain; charset="utf-8"
>
>
>
> Hello everyone,
>
> my name is Laetitia and I'm a Phd student in Marseille (France). I'm
> doing in-vivo recording in freely-moving rats : I implant them with 2
> electrodes deep into 2 different regions of the brain. I'm studying the
> Local Field Potentials and I want to use FieldTrip to analyse the data.
>
> To simplify :
>
> - I have 2 rats.
>
> - Each rat did 20 sessions of the task (on 20 different days).
>
> - Each session consists of 20 trials of condition 1 and 20 trials of
> condition 2.
>
> I have 2 questions.
>
> 1) I have the feeling it would be meaningless to do "source
> reconstruction" because my electrodes are already deep inside my
> "source" and the LFP I am recording is very local. (My electrodes have
> 32 channels separated by 20-200 ?m. The LFP is very very similar across
> all the channels, so I averaged over the 32 channels to have one signal
> for each region.)
>
> However, I see that 2 different functions exist for the statistics :
> FT_FREQSTATISTICS AND FT_SOURCESTATISTICS. So far, I've been using
> ft_freqstatistics but I encounter some issues (for exemple, doingIch werde nachfragen. Es wird doch immer in ft_prepare_sourcemodel
>        die Transfermatrix gerechnet, sodass
>
>        in ft_prepare_leadfield nur noch Multiplikationen dieser
>        Transfermatrix mit den vielen rechten Seiten
>
>        gerechnet wird, was ja schnell gehen sollte. Ich frage, wo es
>        hakt.
>
>        
> monte-carlo permutation test to assess the imaginary coherence). I
> thought of computing it manually, but I'm thinking that maybe more stuff
> are implemented in ft_sourcestatisctics ?
>
> ? Are these 2 functions fundamentally different or do they call the same
> sub-fonctions (and my problem has actually nothing to do with that) ?
>
> 2) I'm a bit confused with the vocabulary from EEG and MEG studies (I'm
> not used to it yet...). From what I understood, in human studies, you
> can do comparison for a single subject (across trials) or across
> subjects. But I have 3 levels of comparisons in my design :
>
> - WITHIN A SESSION, I WANT TO COMPARE ACROSS TRIALS (the 20 trials of
> condition 1 VS the 20 trials of condition 2).
>
> - WITHIN A RAT, I WANT TO COMPARE ACROSS SESSIONS (between the 2
> conditions)
>
> - then - in the very end - ACROSS RATS. But I have only 2 rats so far,
> so I will deal with this later.
>
> I'm a bit confused when reading the tutorials and the mailing list,
> especially when it comes to the statistics... For example : this is from
> an email from 2013 by Eric Maris about "Nonparametric statistical
> testing of phase coherence"
> (http://mailman.science.ru.nl/pipermail/fieldtrip/2013-April/006401.html)
> "To compare coherence between conditions across subjects (instead of
> trials), you need a different statfun: depsamplesT (for a
> within-subjects design; subjects have participated in all conditions) or
> indepsamplesT (for a between-subjects design; subjects have participated
> in only one condition)."
>
> ? If I want to compare across sessions (for a same rat), can I actually
> consider that my different sessions are "subjects"? And then compare
> coherence "across subjects" would be doing it "across sessions" ? And I
> would be in a "within-subject design" since my sessions involve the 2
> conditions every time ?
>
> I realise that it may be very confusing... I hope you will understand my
> problem !
>
> And if anyone already applied fieldtrip functions to do statistics on a
> different framework that the usual EEG/MEG, please let me know !
>
> Thanks a lot,
>
> Laetitia Lalla
>
> PhD Student in Neuroscience
>
> INMED, Marseille, France
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160408/2aed96c1/attachment-0001.html>
>
> ------------------------------
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
> End of fieldtrip Digest, Vol 65, Issue 7
> ****************************************
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

-------------- next part --------------
A non-text attachment was scrubbed...
Name: carsten_wolters.vcf
Type: text/x-vcard
Size: 402 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160414/c38dc401/attachment-0002.vcf>


More information about the fieldtrip mailing list