Back to the main page.

Bug 964 - prepare_mesh_segmentation and cfg.tissue

Status CLOSED FIXED
Reported 2011-09-14 21:39:00 +0200
Modified 2011-11-11 11:19:59 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P1 major
Assigned to: Cristiano Micheli
URL:
Tags:
Depends on:
Blocks:
See also:

Johanna - 2011-09-14 21:39:02 +0200

Hi Cristiano, I was about to fix this as Elli suggested (below), and then saw you commented out the line with some other changes today. Does it not crash as reported on the main Mailing list with the line out so that mri.seg doesn't get created? -Johanna Hello Johanna - I'm moving this conversation to dev, since it's primarily a bugfix discussion. In the fix you posted, the `if` statement has at least one problem with it: ... && (~isfield(cfg,'tissue') || ... The field cfg.tissue is always going to exist, becaues of ft_prepare_mesh (line 70): if ~isfield(cfg, 'tissue'), cfg.tissue = []; end You probably want to use ~empty(cfg.tissue) or something similar. Elli


Eliezer Kanal - 2011-09-14 21:49:36 +0200

Do note that it should be `isempty(...)`; there's no `empty` function. I can verify that the mri.seg does not get created, as that's what caused this problem for me.


Jan-Mathijs Schoffelen - 2011-09-17 10:06:49 +0200

I made a tentative patch: @ Cristiano please fix the code as soon as possible. Most likely some code needs to be rewritten for a logical flow of conditional statements.


Cristiano Micheli - 2011-10-13 12:01:11 +0200

(In reply to comment #2) > I made a tentative patch: > > @ Cristiano please fix the code as soon as possible. Most likely some code > needs to be rewritten for a logical flow of conditional statements. Please see the new implementation in private/prepare_mesh_segmentation_new and test file in ./test/test_bug937 Ciao! C


Robert Oostenveld - 2011-11-11 11:19:59 +0100

I closed all bugs that were recently resolved.