Home › Forum › SOFA › Using SOFA › [SOLVED] Mapping of behavior model and visual model
- This topic has 4 replies, 2 voices, and was last updated 7 years, 7 months ago by Sisi.
-
AuthorPosts
-
26 April 2017 at 16:28 #9003SisiBlocked
Dear all,
I have generated a FEM model and a .obj model from the same .stl file and integrated them into a .scn file. However, it seems like the orientation and the origin of the FEM model (behavior model) and the .obj model (visual model) are not the same. Which mapping method should I use in this case? Barycentric Mapping seems not work (see the image data).
best,
Siming26 April 2017 at 19:22 #9004HugoKeymasterHi Siming,
If I understand it correctly, you have one .obj model for the visualization and one .stl used for the FEM model, right ?
First of all, why would your two models be not in the same configuration ?
If it comes from Dicom data, you can use the projection matrix saved in the header to register both meshes..Hugo
26 April 2017 at 23:19 #9006SisiBlockedHi Hugo,
Well, I used 3D slicer to generate the .stl model from a DICOM volumn. Based on this .stl file, a .msh file was created with GMSH and a .obj was converted (not with GMSH) from the .stl file. I used the .msh file as MechanicalObject and the .obj file as Visual Object. Actually I expected that the .msh file and the .obj file has the same orientateion and origin, since they were generated from the same .stl model. Obviously not… So I assume this is caused by different meshing and converting algorithm. Do you think this is possible?
And also, I am not sure if I map the objects correctly to each other in SOFA. And can I use the projection matrix directly in SOFA? How?
best,
Siming27 April 2017 at 00:19 #9009HugoKeymasterHi Siming,
Yes, it is highly possible, that’s why I wrote above: Dicom images include the orientation of the image. When exporting a mesh, depending on the extension, this orientation is saved or not.
I remember there is a way to extract the orientation matrix of the Dicom image. Can you find it ?
With this orientation, you can align both .obj and .stl meshes. To do so in SOFA, you need to use the translation and rotation data of the loader (i.e. MeshObjLoader and MeshSTLLoader) you are using.
Best,
Hugo
27 April 2017 at 22:19 #9019SisiBlockedHi Hugo,
Thank you for your hints. Seems like the programm I used to convert the .stl file to .obj file changed the transformation matrix of the original .stl file. So I fix my problem finally in a more trivial way: instead of using the .obj file a the visual model, I use the .stl file as the visual model. Since the .msh file was generated from the .stl file and GMSH does not change the transformation matrix of the model by default while generate a volumetric mesh, the .msh and .stl models have the same orientation and origin, therefore aligned perfectly to each other.
Thanks for your support!!
best,
Siming -
AuthorPosts
- You must be logged in to reply to this topic.