Back to the main page.

Bug 954 - bug in ft_prepare_singleshell in fieldtrip version 20110911

Status CLOSED FIXED
Reported 2011-09-12 13:39:00 +0200
Modified 2011-09-14 14:26:21 +0200
Product: FieldTrip
Component: forward
Version: unspecified
Hardware: All
Operating System: All
Importance: P1 normal
Assigned to: Johanna
URL:
Tags:
Depends on:
Blocks:
See also:

Andreas Wollbrink - 2011-09-12 13:39:46 +0200

using the same input arguments (cfg and seg) ft_prepare_singleshell behaves differently for version 20110901 and 20110911 I used the following setup: seg = dim: [256 256 256] transform: [4x4 double] coordsys: 'ctf' unit: 'mm' anatomy: [256x256x256 double] brain: [256x256x256 logical] cfg: [1x1 struct] cfg = []; in fieldtrip-20110901 the command vol = ft_prepare_singleshell(cfg, seg); returns a perfect volume conductor model. in fieldtrip-20110911 it stops with the error message: ??? Reference to non-existent field 'seg'. Error in ==> prepare_mesh_segmentation at 63 [mrix, mriy, mriz] = ndgrid(1:size(mri.seg,1), 1:size(mri.seg,2), 1:size(mri.seg,3)); Error in ==> ft_prepare_mesh at 124 bnd = prepare_mesh_segmentation(cfg, mri); Error in ==> ft_prepare_singleshell at 89 vol.bnd = ft_prepare_mesh(cfg, mri);


Johanna - 2011-09-13 10:05:34 +0200

I think this may be my fault, as I commented out line 25 in prepare_mesh_segmentation, (which Cristiano and I discussed together) in order to solve a problem that others were having, regarding having a cfg.tissue=[1 2 3] and then this line erroneously setting it back to only =1. I have put that line back in, and it now states: if ~isfield(mri,'tissue') && any(ismember(fieldnames(mri),{'gray' 'brain' 'scalp'})) && (~isfield(cfg,'tissue') || length(cfg.tissue)==1), cfg.tissue=1;end Hopefully this will solve both problems for now?