Back to the main page.
Bug 1432 - ft_prepare_singleshell and ft_prepare_headmodel give different results
Status | CLOSED FIXED |
Reported | 2012-04-17 13:55:00 +0200 |
Modified | 2012-06-12 12:59:45 +0200 |
Product: | FieldTrip |
Component: | core |
Version: | unspecified |
Hardware: | PC |
Operating System: | Windows |
Importance: | P3 normal |
Assigned to: | Cristiano Micheli |
URL: | |
Tags: | |
Depends on: | |
Blocks: | |
See also: |
Eelke Spaak - 2012-04-17 13:55:27 +0200
Whereas the test script test_ft_prepare_singleshell prescribes they should produce identical results. This part of the test script runs fine (note that I added (and committed) the rmfield() calls to remove the cfg): % with an MRI in the input cfg = []; cfg.method = 'singleshell'; vol1 = ft_prepare_headmodel(cfg, mri); cfg = []; vol1b = ft_prepare_singleshell(cfg, mri); % the following needs to be done to be able to make the comparison vol1 = rmfield(vol1, 'cfg'); vol1b = rmfield(vol1b,'cfg'); success = success && isequal(vol1, vol1b); if ~success error('ft_prepare_singleshell and ft_prepare_headmodel gave different outputs'); end But this then fails (vol2 and vol2b are not equal): % with a filename in the input cfg = []; cfg.method = 'singleshell'; cfg.hdmfile = hdmfile; vol2 = ft_prepare_headmodel(cfg); cfg = []; cfg.headshape = hdmfile; vol2b = ft_prepare_singleshell(cfg); % the following needs to be done to be able to make the comparison vol2 = rmfield(vol2, 'cfg'); vol2b = rmfield(vol2b,'cfg'); success = success && isequal(vol2, vol2b); if ~success error('ft_prepare_singleshell and ft_prepare_headmodel gave different outputs'); end See: >> vol2 vol2 = bnd: [1x1 struct] type: 'nolte' unit: 'cm' >> vol2b vol2b = bnd: [1x1 struct] type: 'nolte' unit: 'cm' So far so good, but: >> vol2.bnd ans = pnt: [21285x3 double] fid: [1x1 struct] unit: 'cm' >> vol2b.bnd ans = pnt: [21285x3 double] tri: [42566x3 double] And I don't know what the desired/best behaviour is, or if both are equally good. I checked out ft_datatype_headmodel for clues, but could not find any.