Page 1 of 1

AimsInflate doesn't save sequence [solved]

Posted: Tue Jun 05, 2012 4:32 am
by atsui
Hi,

I'm trying to save a sampling of the inflation sequence generated by AimsInflate, but the intermediate meshes in the sequence don't appear. Here is the command that I issue:

Code: Select all

$ AimsInflate -i 10100_Lhemi.mesh -o inflate_500.mesh -t 500 -Kn 0.01 -Ksp 0.01 -Ksm 0.5 -c curvature_500.tex -S
Parameters:
-----------

Input     : 10100_Lhemi.mesh
Output    : inflate_500.mesh
Iterations: 500
Knormal   : 0.01
Kspring   : 0.01
Ksmooth   : 0.5
Bound     : 5000
Sequence  : 1

Adding time t=1, 10, 20, 40, 80, 160, 320 to the sequence time list
The surface mesh has 26197 nodes


It recognizes that the sequence should be saved, and it also indicates which time steps, but at the end of the process, I can only find a single output file rather than a sequence of files. Do I have to do something differently?

--Alex

Re: AimsInflate doesn't save sequence

Posted: Tue Jun 05, 2012 8:02 am
by Olivier Coulon
Hello,
I think that the file contains the whole sequence. If you open it n a 3D window with anatomist there should be a slider on the side that allows you to see all meshes in the sequence.

olivier

Re: AimsInflate doesn't save sequence

Posted: Tue Jun 05, 2012 9:27 am
by atsui
Wow, that was easy. Thanks for pointing that out for me!

To follow up, how can I extract an individual mesh at a particular time point from the .mesh file containing the sequence, either from Anatomist or AIMS?

--Alex

Re: AimsInflate doesn't save sequence [solved]

Posted: Tue Jun 05, 2012 1:42 pm
by Olivier Coulon
Hi,
it might be possible with a command line but nothing straightforward comes to my mind... You can do a little python programming to do this, but probably you should chose what time step you're interested in, using anatomist, and then re-run the AimsInflate without the -S option and with a -t value that fits your choice... Does this help ?

Olivier

Re: AimsInflate doesn't save sequence [solved]

Posted: Tue Jun 05, 2012 5:28 pm
by atsui
Thanks Olivier,

This is helpful. I think I will follow your idea for the time being, but I'd like to teach myself a bit of python programming as well.

I think I will look into doing some python programming using PyAIMS. There's an example here http://brainvisa.info/doc/pyaims-4.2/examples/mesh_test.py that suggests you should be able to instantiate the mesh and select the vertices/normals/faces at some time point. I'm not really sure what the data type is. I guess it's an AimsTimeSurface_3 but I'm unsure of its API.

--Alex

Re: AimsInflate doesn't save sequence [solved]

Posted: Wed Jun 06, 2012 10:49 am
by Olivier Coulon
Alex,
if you want to use the python API, here is a little starter. First you have to use the python that comes with brainvisa (not the one already on your system). If you want a python shell you can use the ipython that comes with brainvisa as well. Then the following code should help you to load and access vertices, polygons, etc.. of a mesh:

Code: Select all

from soma import aims
r=aims.Reader()
surf=r.read('inflatedMesh.mesh')
t=0
vert=surf.vertex(t)
poly=surf.polygon()


In this code, t is the timestep.
Good luck,

Olivier