Page 1 of 1

AimsMesh: ima TO mesh

Posted: Mon Mar 08, 2010 4:13 pm
by Simon Toralba
Hi everyone,

Thanks to BrainVISA and its modules contributors for creating such great tools.
I'm a new user, and I need some help:

I have to convert a GIS volume (.ima made with Brainrat tools) to a mesh file, so that I can visualize it in the 3d window of Anatomist.
So, I used the command :

AimsMesh -i inputfile.ima -o outputfile.mesh

As result, I get thousands of mesh files , that Anatomist can't display of course.

How can I put these meshes together?
Is there an other way to visualize the objects of my .ima file in the 3d window?

Thanks a lot,


Re: AimsMesh: ima TO mesh

Posted: Mon Mar 08, 2010 6:13 pm
by Yann Cointepas
What is the content of your image ? Is it a binary image or an image of labels representing ROIs ? If not (for instance if your image is an MR image), you should not use AimsMesh but create a fusion object in Anatomist (for instance a Cut Mesh fusion) to combine your image and your mesh.

Anyway, Anatomist should be able to display the meshes produced by AimsMesh. You should be able to load them all and put them in a 3D window. What is hapenning exaclty when you do that ?

Re: AimsMesh: ima TO mesh

Posted: Mon Mar 08, 2010 6:21 pm
by Yann Cointepas
My suggestion to fusion your image with a mesh is a bit stupid because you do not have such a mesh. To build such a mesh, you may have to do some kind of segmentation before using AimsMesh.

Re: AimsMesh: ima TO mesh

Posted: Tue Mar 09, 2010 8:55 am
by Dominique Geffroy

You also could use the volume rendering feature to see your image in 3D. It is explained here in the Anatomist tutorial :


Re: AimsMesh: ima TO mesh

Posted: Thu Apr 01, 2010 1:53 pm
by Simon Toralba

I haven't solved my problem yet or tried what you told me to do (because 3D rendering is only the final phase of my project), but I 'll report my solutions as soon as I work on it again. Anyway, thanks for the help.


Re: AimsMesh: ima TO mesh

Posted: Fri May 21, 2010 11:14 am
by Simon Toralba
Hello everybody

Volume rendering in anatomist seems to be impossible, it is much too heavy.

I understand why I got thousands of meshes : AimsMesh was working on all labels of my volume (65536).

Then I made a better segmentation so that my objects are filled in 255 on background=0, it takes place on an hundred of 2000x2000pix grey-scale S16 images, turned into a volume (.ima).

But when I run AimsMesh onto this volume, it bugs after few objects on 15-16 slices converted :

AimsMesh -i cavern.ima --smooth 1 -l 255 -L 255 --decimation 1 --deciReductionRate 96 --debugLevel 1 -o cavern.mesh

libaimsvida.dll.3.2.1: Could not load DLL libaimsvida.dll.3.2.1
libaimsvida.dll.3.2: Could not load DLL libaimsvida.dll.3.2
libaimsdicom.dll.3.2.1: Could not load DLL libaimsdicom.dll.3.2.1
libaimsecat.dll.3.2.1: Could not load DLL libaimsecat.dll.3.2.1
libaimsfdf.dll.3.2.1: Could not load DLL libaimsfdf.dll.3.2.1
libaimsjpeg.dll.3.2.1: Could not load DLL libaimsjpeg.dll.3.2.1
libaimstiff.dll.3.2.1: Could not load DLL libaimstiff.dll.3.2.1
libaimsqtformats.dll.3.2.1: Could not load DLL libaimsqtformats.dll.3.2.1
libaimsminc.dll.3.2.1: Could not load DLL libaimsminc.dll.3.2.1
libaimsply.dll.3.2.1: Could not load DLL libaimsply.dll.3.2.1
libaimsnifti.dll.3.2.1: Could not load DLL libaimsnifti.dll.3.2.1
libaimsgifti.dll.3.2.1: Could not load DLL libaimsgifti.dll.3.2.1
libconnectomist_aims_plugin.dll.3.2.1: Could not load DLL libconnectomist_aims_plugin.dll.3.2.1

reading image : done
resolutions : ( 0.0005 mm, 0.0005 mm, 0.006 mm )
label inferior : 255
label superior : 255
reading slice : 70
getting interface : done
processing mesh : [ 255, 5 ] extended neighborhood


AimsMesh_bug.jpg (14.67 KiB) Viewed 6882 times

It allows me to display few objects :

AimsMesh result1.jpg
AimsMesh result1.jpg (35.16 KiB) Viewed 6882 times

Are my objects too large for AimsMesh?

A solution would be to mesh each object one by one before merging it all in one piece using AimsZCat, but there might be a better way...


Re: AimsMesh: ima TO mesh

Posted: Tue May 25, 2010 4:23 pm
by Simon Toralba
AimsZCat is clearly not the appropriate tool to merge meshes...

Anyway, I have labelled each object with a number, so that AimsMesh can create meshes one by one. It bugs on some big objects. ex :

AimsMesh -i 117-186_mx1187.ima -l 194 -L 194 -o label194.mesh --decimation 1 --deciReductionRate 97 --smooth 1

reading image : done
resolutions : ( 0.0005 mm, 0.0005 mm, 0.0065 mm )
label inferior : 194
label superior : 194
reading slice : 70
getting interface : done
processing mesh : [ 194, 1 ] extended neighborhoodSt9bad_alloc

Does someone have an solution for this problem??


Re: AimsMesh: ima TO mesh

Posted: Wed May 26, 2010 9:14 pm
by riviere
Hi Simon,

You say you have images of 2000x2000x100 voxels ? Whew, I understand you have problems (especially on the Windows version which apparently doesn't manage very well memory). Just one of your images is almost 1Gb in size, and a 32 bit program can only deal with 2Gb - if a program needs to duplicate a volume, or make large meshes, you probably ran out of memory. Then you probably need a 64 bit version of BrainVisa, and we only have one for Linux. If you only have a Windows machine, you could maybe try running Linux in a virtual machine.
Alternately you could perhaps undersample your image to make it smaller, you would lose some precision in resolution, but if you are meshing just for visualization it might be enough ?
Otherwise (without memory problems) what you have done seems OK, and AimsZCat is the tool for merging meshes.


Re: AimsMesh: ima TO mesh

Posted: Thu May 27, 2010 10:22 am
by Simon Toralba
Thank you very much Denis

Now I think that I have all I need to finish my work.

BV rules!!