AimsMesh: ima TO mesh

AIMS library and commands usage

Moderators: denghien, riviere

Post Reply
User avatar
Simon Toralba
Posts: 7
Joined: Wed Mar 03, 2010 5:54 pm
Location: Caen, France

AimsMesh: ima TO mesh

Post 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,

Simon
User avatar
Yann Cointepas
Posts: 316
Joined: Tue Jan 20, 2004 2:56 pm
Location: Neurospin, Saint Aubin, France
Contact:

Re: AimsMesh: ima TO mesh

Post 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 ?
User avatar
Yann Cointepas
Posts: 316
Joined: Tue Jan 20, 2004 2:56 pm
Location: Neurospin, Saint Aubin, France
Contact:

Re: AimsMesh: ima TO mesh

Post 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.
Dominique Geffroy
Site Admin
Posts: 161
Joined: Thu Mar 01, 2007 4:22 pm
Location: IFR 49 - Neurospin, Gif-sur-Yvette, France
Contact:

Re: AimsMesh: ima TO mesh

Post by Dominique Geffroy »

Hi,

You also could use the volume rendering feature to see your image in 3D. It is explained here in the Anatomist tutorial : http://brainvisa.info/doc/anatomist-3.2 ... 06s09.html

Dominique
User avatar
Simon Toralba
Posts: 7
Joined: Wed Mar 03, 2010 5:54 pm
Location: Caen, France

Re: AimsMesh: ima TO mesh

Post by Simon Toralba »

Hello,

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.

Simon
User avatar
Simon Toralba
Posts: 7
Joined: Wed Mar 03, 2010 5:54 pm
Location: Caen, France

Re: AimsMesh: ima TO mesh

Post 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


->bug
AimsMesh_bug.jpg
AimsMesh_bug.jpg (14.67 KiB) Viewed 20290 times

It allows me to display few objects :

AimsMesh result1.jpg
AimsMesh result1.jpg (35.16 KiB) Viewed 20290 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...

Simon
User avatar
Simon Toralba
Posts: 7
Joined: Wed Mar 03, 2010 5:54 pm
Location: Caen, France

Re: AimsMesh: ima TO mesh

Post 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??

Simon
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: AimsMesh: ima TO mesh

Post 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.

Denis
User avatar
Simon Toralba
Posts: 7
Joined: Wed Mar 03, 2010 5:54 pm
Location: Caen, France

Re: AimsMesh: ima TO mesh

Post by Simon Toralba »

Thank you very much Denis

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

BV rules!!
Post Reply