Page 1 of 1

Issue with the mesh format for the latest version

Posted: Wed Jun 06, 2012 2:15 pm
by PeterK
There seems to be a niggling problem with the mesh files created by the latest version of brainvisa (4.2.x). If I attempt to read it as an AIMs format, the number of normal vectors is set to 0. Opening and saving it with anatomist restores the good state of the mesh. Was there a recent change in the AIMs mesh format? This issue only showed up on the latest releases of bvisa, the older versions (4.1 and preceding) seem to produce meshes of consistent format.

Re: Issue with the mesh format for the latest version

Posted: Thu Jun 07, 2012 7:52 am
by atsui
Hello,

I just wanted to add some context to the issue that Peter is referring to. I am using his RIC toolbox to estimate cortical thickness, which makes use of gray matter and white matter meshes generated at the end of the Morphologist 2012 pipeline. It seems like it asserts something about the mesh size and the number of normals but fails for some reason:

Code: Select all

[atsui@quark tmp]$ RicCorticalThicknessByNormal --gm Lhemi.mesh --wm Lwhite.mesh -m thread --bv --sm both -o out/ --mind 0.2 --maxd 8 --ft
Mesh size and normals size are not equal exiting
Error reading fileLhemi.mesh
I found the error strange because I remember it had worked perfectly when I tested it with meshes before, but I think they might have been generated from Morphologist 2011 from an older version of Brainvisa.

Peter, what exactly is being checked at the beginning? Are you using the C++ API?

--Alex

Re: Issue with the mesh format for the latest version

Posted: Thu Jun 07, 2012 2:38 pm
by PeterK
atsui wrote:Hello,

I just wanted to add some context to the issue that Peter is referring to. I am using his RIC toolbox to estimate cortical thickness, which makes use of gray matter and white matter meshes generated at the end of the Morphologist 2012 pipeline. It seems like it asserts something about the mesh size and the number of normals but fails for some reason:

Code: Select all

[atsui@quark tmp]$ RicCorticalThicknessByNormal --gm Lhemi.mesh --wm Lwhite.mesh -m thread --bv --sm both -o out/ --mind 0.2 --maxd 8 --ft
Mesh size and normals size are not equal exiting
Error reading fileLhemi.mesh
I found the error strange because I remember it had worked perfectly when I tested it with meshes before, but I think they might have been generated from Morphologist 2011 from an older version of Brainvisa.

Peter, what exactly is being checked at the beginning? Are you using the C++ API?

--Alex
Alex,
We check to make sure that the number of vertices = number of normals. It seems like the number of normals is set to zero in these meshes. Opening and saving them in anatomist resets this number to the correct one.

Re: Issue with the mesh format for the latest version

Posted: Tue Jun 12, 2012 10:08 am
by riviere
Hi,
I will check that. Normals are actually optional in the .mesh format, and Anatomist rebuilds them if they are not here, which explains why they come back once loaded and saved back by anatomist. In a Aims program the function to do so is quite simple: just call the updateNormals() method on the mesh (either in python or C++). But we will take care of correctly generating them directly in Morphologist.
Denis

Re: Issue with the mesh format for the latest version

Posted: Wed Jan 23, 2013 11:55 am
by joost
Hi Denis,

could you give a concrete example of how to use python to update the normals for an existing brainvisa mesh?

merci,
-joost

Re: Issue with the mesh format for the latest version

Posted: Fri Jan 25, 2013 8:46 am
by denghien
Hi Joost,

You will find some examples in this part of documentation at the "Meshes" section:
http://brainvisa.info/doc/aimsdata-4.3/ ... ing%pyaims .


Isa