Home › Forum › SOFA › Using SOFA › [SOLVED] Export/Save displacement field of a simulation
Tagged: displacement export
- This topic has 6 replies, 3 voices, and was last updated 7 years, 2 months ago by MPfeiffer.
-
AuthorPosts
-
22 May 2017 at 17:17 #9143SisiBlocked
Dear all,
I am using the SOFA to simulate a volumetric deformation of organ in a non-rigid manner. It is done by using FEM. So far the simulation is fine. Since I would like to use the displacement field to deform a image volumne, could you please tell me how to export/save the displacment field of a object?
best,
Siming24 May 2017 at 09:54 #9189SisiBlockedAnybody has any idea to solve this problem?
Please!
best,
Siming30 May 2017 at 16:23 #9226HugoKeymasterHey Sisi,
Sorry for the delayed reply!
About export this thread already explains a lot: exporting state. Let me know if this helps.Hugo
1 June 2017 at 16:13 #9246SisiBlockedHi Hugo,
Thank you for your answer. Meanwhile I have solve this problem in the same way you recommended in the other thread. I use the VTKExporter and VTK can convert the unstructured data to polygon data and then generate a image stencil, which can be use to generate a deformed binary image.
best,
Siming6 September 2017 at 10:24 #9962MPfeifferBlockedHi,
I have a follow-up question:
Instead of exporting a deformed mesh, I want to export the mesh in its original form, but with a displacement field (i.e. export a displacement vector u for each point).
The goal is that when importing in Paraview the geometry of the mesh would not change but instead I would color the vertices using the displacement field.I currently have the following workaround:
Export using VTKExporter, and add “dofs.rest_position” to the “pointsDataFields”:<VTKExporter name="vtkExporter" listening="true" filename="LiverAnimation" edges="1" triangles="1" quads="1" tetras="1" hexas="1" exportEveryNumberOfSteps="1" pointsDataFields="dofs.velocity dofs.rest_position" />
Then in paraview, I can use the “calculator” filter to subtract the rest_position from the coordinates of the points, giving me the displacement.
Can this be done in SOFA instead?
6 September 2017 at 22:51 #9963HugoKeymasterHey @germanunkol,
What you want is to access (and export) at ever time step the displacement field with regards to the rest position (u(t)=x(t)-x_0). I am afraid the simplest way to do it is to use the work around you describe, the displacement information is not directly available in SOFA at my best knowledge. Is this crucial for you to have it in SOFA ?
Best,
Hugo
7 September 2017 at 08:39 #9964MPfeifferBlockedHi Hugo,
I want to process a large amount of simulations which is why I was looking for the quickest way to get the data in the correct format. However, I will need to post-process the data anyway, so adding another step in VTK which removes the deformation and writes it into a separate array instead is not a huge deal. So no, it’s not crucial that I can do it in SOFA, it would just have been convenient.
Thanks for the quick reply, and thanks for clarifying!Cheers,
Micha -
AuthorPosts
- You must be logged in to reply to this topic.