Hi everyone,
I’m trying to import an anatomy previously segmented with CAT12 into Brainstorm, but I’m running into an issue.
My workflow is the following:
-
I first import the raw MRI to extract the SCS values from
subjectimage.mat. -
Then I call the function
import_anatomy_catto load the CAT12 folder:
imported_anatomy = import_anatomy_cat(iSubject, cat_folder, 15000, 0, SCS, 0, 2, 1);
When I run this in MATLAB directly, it seems to work without problems.
However, I’m building a Python script using the MATLAB Engine, and even though I follow the exact same steps, I get the following error during the CAT12 import:
Incorrect number or types of inputs or outputs for function findChild.
Error in panel_protocols>UpdateNode (line 628)
nodeSubject = nodeRoot.findChild('subject', iSubject, -1, 0);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in panel_protocols (line 46)
eval(macro_method);
^^^^^^^^^^^^^^^^^^^
Error in db_add_surface (line 73)
panel_protocols('UpdateNode', 'Subject', iSubject);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in import_surfaces (line 226)
iNewSurfaces(end+1) = db_add_surface(iSubject, BstTessFileShort, NewTess.Comment);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in import_anatomy_cat_2019 (line 280)
[iLh, BstTessLhFile, nVertOrigL] = import_surfaces(iSubject, TessLhFile, 'GII-WORLD', 0);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in import_anatomy_cat (line 30)
errorMsg = import_anatomy_cat_2019(varargin{:});
No method 'findChild' with matching signature found for class 'org.brainstorm.tree.BstNode'.
I'm not sure why this happens only when running the process through the MATLAB Engine in Python.
Has anyone encountered this before or knows what might be causing this?
Thank you in advance!

