Back to the main page.

Bug 397 - move private/prepare_dipole_grid to ft_prepare_sourcemodel in main directory

Status CLOSED FIXED
Reported 2011-01-13 10:49:00 +0100
Modified 2011-01-14 13:29:58 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P1 normal
Assigned to: Robert Oostenveld
URL:
Tags:
Depends on:
Blocks:
See also:

Robert Oostenveld - 2011-01-13 10:49:10 +0100

this is for the MNE integration. Besides moving, the calling functions need to be changed: roboos@mentat001> grep prepare_dipole_grid *.m */*.m ft_dipolefitting.m: [grid, cfg] = prepare_dipole_grid(cfg, vol, sens); ft_headmodelplot.m: sourcegrid = prepare_dipole_grid(cfg, vol, sens); ft_megrealign.m:grid = prepare_dipole_grid(cfg, volold, data.grad); ft_prepare_leadfield.m:[grid, cfg] = prepare_dipole_grid(cfg, vol, sens); ft_sourceanalysis.m: [grid, cfg] = prepare_dipole_grid(cfg, vol, sens); I think that the best is to change those functions into using a tmpcfg and copy the relevant cfg fields into the tmpcfg. When Searching through the code of prepare_dipole_grid, it turns out that the following cfg fields are being used cfg.grid cfg.mri cfg.headshape cfg.tightgrid cfg.symmetry cfg.smooth cfg.threshold cfg.spheremesh cfg.inwardshift cfg.mriunits cfg.sourceunits Those fields are teh ones that have to be copied into the tmpcfg. The function now takes vol and sens as 2nd and 3rd argument, these should be specified as cfg.vol and cfg.sens (or cfg.grad/elec) for consistency with other functions


Robert Oostenveld - 2011-01-13 11:29:22 +0100

revision 2573 and 2574 (which I just committed) implement the required changes: there is now a function ft_prepare_sourcemodel in the main directory what still needs to be done is - clean documentation inside that function - implement a cfg.method for explicit specification on how the grid should be contstructed


Robert Oostenveld - 2011-01-13 12:09:52 +0100

Since revision 2575 it is possible to read the cortical sheet in fieldtrip style ---------------------------------------------------------- >> cfg cfg = headshape: 'sub10-oct-6-src.fif' >> ft_prepare_sourcemodel(cfg) Reading a source space...[done] Completing triangulation info...[done] Completing selection triangulation info...[done] Reading a source space...[done] Completing triangulation info...[done] Completing selection triangulation info...[done] 2 source spaces read converting units from 'm' to 'cm' 8196 dipoles inside, 0 dipoles outside brain ans = pos: [8196x3 double] tri: [16384x3 int32] unit: 'cm' inside: [1x8196 double] outside: [] >> ft_plot_mesh(grid, 'facecolor', 'skin', 'edgecolor', 'none', 'vertexcolor', 'none') >> camlight