Back to the main page.

Bug 2359 - ft_prepare_sourcemodel should be extended with cortical sheet manipulation options, like spherify

Status CLOSED FIXED
Reported 2013-11-01 11:53:00 +0100
Modified 2014-02-24 10:56:35 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P3 normal
Assigned to: Robert Oostenveld
URL:
Tags:
Depends on:
Blocks:
See also:

Robert Oostenveld - 2013-11-01 11:53:30 +0100

as discussed with Vladimir, there is in SPM a function that spherifies a cortical sheet; % Copyright (C) 2008, Robert Oostenveld % $Id: spm_eeg_inv_mesh_spherify.m 4701 2012-03-22 16:47:05Z guillaume $ there is also the need to move cortical sheet vertices that are too close to the surface or even stick out. The idea here is to take the surface, move it inward by ~4mm, determine the points that stick out, move them inward. This results in a cortical sheet with vertices that are at least 4mm away from the surface, which should make it robust for numerical errors in BEM solutions. Both the spherify and the cfg.inwardshift related correction method should be implemented in ft_prepare_sourcemodel for SPM12.


Robert Oostenveld - 2013-11-01 11:54:19 +0100

this data can be used for testing, and esp. the cortex_20484 together with the iskull_2562 mac001> cd matlab/spm8-release/canonical/ mac001> ll total 11072 -rw-r--r-- 1 roboos staff 902981 Mar 16 2005 avg152PD.nii -rw-r--r-- 1 roboos staff 902981 Mar 16 2005 avg152T1.nii -rw-r--r-- 1 roboos staff 902981 Mar 16 2005 avg152T2.nii -rw-r--r-- 1 roboos staff 902981 Mar 16 2005 avg305T1.nii -rw-r--r-- 1 roboos staff 576128 Feb 19 2009 cortex_20484.surf.gii -rw-r--r-- 1 roboos staff 134715 Feb 19 2009 cortex_5124.surf.gii -rw-r--r-- 1 roboos staff 215831 Feb 19 2009 cortex_8196.surf.gii -rw-r--r-- 1 roboos staff 68946 Feb 19 2009 iskull_2562.surf.gii -rw-r--r-- 1 roboos staff 68922 Feb 19 2009 oskull_2562.surf.gii -rw-r--r-- 1 roboos staff 68702 Jul 23 2009 scalp_2562.surf.gii -rw-r--r-- 1 roboos staff 902981 Oct 23 2006 single_subj_T1.nii -rw-r--r-- 1 roboos staff 2571 Apr 1 2009 spm_mesh.man


Robert Oostenveld - 2013-11-01 14:26:52 +0100

*** Bug 2346 has been marked as a duplicate of this bug. ***


Robert Oostenveld - 2013-11-07 09:16:37 +0100

when making the test script, I noticed that ft_read_headshape thinks that iskull_2562.surf.gii is a caret_surf file (because of the surf in the middle) and it subsequently failed to probe the potentially accompanying files (since it is not fully consistent with caret file naming convention). There was an error with "tok" being too short, I fixed it.


Robert Oostenveld - 2013-11-07 11:33:26 +0100

I encountered the bug #2369 for which I implemented a workaround in bounding mesh (always convert the inputs to double).


Robert Oostenveld - 2013-11-08 09:17:45 +0100

mac001> svn commit Sending forward/ft_inside_vol.m Sending forward/ft_voltype.m Adding forward/private/headsurface.m Sending forward/private/lmoutrn.m Sending forward/private/pinvNx2.m Sending forward/private/plinprojn.m Sending forward/private/ptriprojn.m Adding forward/private/surfaceorientation.m Sending ft_prepare_sourcemodel.m Sending plotting/ft_plot_vol.m Sending private/headsurface.m Adding private/lmoutrn.m Adding private/mesh_spherify.m Adding private/pinvNx2.m Adding private/plinprojn.m Sending private/project_elec.m Adding private/ptriprojn.m Sending private/retriangulate.m Adding private/routlm.m Adding (bin) private/routlm.mexglx Adding (bin) private/routlm.mexmac Adding (bin) private/routlm.mexmaci Adding (bin) private/routlm.mexmaci64 Adding (bin) private/routlm.mexw32 Adding (bin) private/routlm.mexw64 Sending private/surfaceorientation.m Sending test/test_bug1794.m Transmitting file data .......... Committed revision 8739.


Robert Oostenveld - 2013-11-08 09:30:41 +0100

mac001> svn commit Adding test/test_bug2359.m Transmitting file data . Committed revision 8741. I also added a test script. I believe that with these commits this issue has been completely addressed. Please see the test script on how to use it. oh, now that I think of it: I should still document it in the help... done. mac001> svn commit Sending ft_prepare_sourcemodel.m Sending test/test_bug2359.m Transmitting file data .. Committed revision 8742.


Robert Oostenveld - 2013-11-08 10:58:36 +0100

Moving functionality from ft_prepare_sourcemodel to ft_inside_vol caused some function dependencies to break. I just fixed those: mac001> svn commit Adding forward/private/find_mesh_edge.m Adding forward/private/find_triangle_neighbours.m Adding forward/private/icosahedron.m Adding forward/private/icosahedron162.m Adding forward/private/icosahedron2562.m Adding forward/private/icosahedron42.m Adding forward/private/icosahedron642.m Adding forward/private/ksphere.m Adding forward/private/projecttri.m Adding forward/private/retriangulate.m Sending private/find_mesh_edge.m Sending private/find_triangle_neighbours.m Sending private/icosahedron2562.m Sending private/ksphere.m Sending private/retriangulate.m Committed revision 8743.


Robert Oostenveld - 2014-02-24 10:56:35 +0100

I closed several bugs at once that all have been resolved for some time. If you disagree, please reopen.