Back to the main page.
Bug 3195 - make a fast implementation of inside/outside detection of source model points in a FEM volume conduction model of the head
Status | CLOSED FIXED |
Reported | 2016-10-31 10:18:00 +0100 |
Modified | 2017-01-17 11:29:45 +0100 |
Product: | FieldTrip |
Component: | forward |
Version: | unspecified |
Hardware: | PC |
Operating System: | Mac OS |
Importance: | P5 normal |
Assigned to: | Robert Oostenveld |
URL: | |
Tags: | |
Depends on: | |
Blocks: | |
See also: |
Robert Oostenveld - 2016-10-31 10:18:58 +0100
Robert Oostenveld - 2016-10-31 11:58:43 +0100
I made a branch and some pull requests, see https://github.com/fieldtrip/fieldtrip/pull/249
Robert Oostenveld - 2016-11-01 10:26:08 +0100
yesterday I worked with Simon on the detection of inside/outside. Using convex hulls we now have a better method than the previous which is not slower, and which also works for tetraheders.
Robert Oostenveld - 2016-11-01 10:26:50 +0100
In testing the inside/outside detection, I tried it out with a 3D grid. It turned out that basedonresolution does not work for hex/tet. This fixes it. [bug3195-fem 80c2d27] ENH - also support creating 3D grid with dimensions based on hexahedral or tetrahedral mesh, see http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=3195 1 file changed, 19 insertions(+), 19 deletions(-)
Robert Oostenveld - 2016-11-01 10:28:36 +0100
[bug3195-fem d6fde4a] ENH - also support tetraheders (rename tet to hex), prune dipole positions prior to making inside/outside detection (makes it more efficient for regular 3D grids). See http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=3195 2 files changed, 72 insertions(+), 18 deletions(-) create mode 100644 test/test_bug3195.m
Robert Oostenveld - 2016-11-01 10:32:28 +0100
mac011> git push X11 forwarding request failed on channel 0 Counting objects: 9, done. Delta compression using up to 4 threads. Compressing objects: 100% (9/9), done. Writing objects: 100% (9/9), 2.29 KiB | 0 bytes/s, done. Total 9 (delta 6), reused 0 (delta 0) remote: Resolving deltas: 100% (6/6), completed with 5 local objects. To github.com:robertoostenveld/fieldtrip.git 4470c61..d6fde4a bug3195-fem -> bug3195-fem I have pushed it to my github account. @Simon, could you pull it and test it in more detail on your data? thanks Robert
Simon - 2016-11-01 10:40:53 +0100
Tested it also and realised if a source is located in an non-brain element which touches a brain element it could happen that the source will be tagged inside. comment on the pr #249
Simon - 2016-11-01 10:41:16 +0100
Got it also fixed send a pr.
Robert Oostenveld - 2016-11-02 09:03:43 +0100
mac011> git commit -a bug3195-fem 358594e] FIX - prune both hexaheders and vertices, continue with brain only. See https://github.com/fieldtrip/fieldtrip/pull/249#discussion_r86086965 1 file changed, 27 insertions(+), 15 deletions(-) mac011> git push X11 forwarding request failed on channel 0 Counting objects: 4, done. Delta compression using up to 4 threads. Compressing objects: 100% (4/4), done. Writing objects: 100% (4/4), 856 bytes | 0 bytes/s, done. Total 4 (delta 3), reused 0 (delta 0) remote: Resolving deltas: 100% (3/3), completed with 3 local objects. To github.com:robertoostenveld/fieldtrip.git d6fde4a..358594e bug3195-fem -> bug3195-fem @Simon, could you once more have a look?
Simon - 2016-11-02 10:56:41 +0100
I tested the function and it works for me in the case of a hexahedral mesh and an adapted hexahedral mesh. (In reply to Robert Oostenveld from comment #8)
Robert Oostenveld - 2016-11-02 11:03:08 +0100
(In reply to Simon from comment #9) Ok, I'll merge
Robert Oostenveld - 2016-11-02 11:05:33 +0100
(In reply to Robert Oostenveld from comment #10) I have merged and closed the PR. In the process of testing I did notice that the iso2mesh functionality in ft_prepare_mesh was suboptimal, both for triangulated surfaces and also for tetrahedral meshes. Somehow it results in meshes that and not evenly distributed, i.e. fine at the bottom and coarse at the top. That is something I won't fix now, but relevant to remember.