error when loading surface.vtk generated in matlab isosurface

57 views
Skip to first unread message

Camille Lemen

unread,
Jan 25, 2018, 2:10:10 PM1/25/18
to scalismo-faces
Hi,

I am trying to export a mesh generated in matlab with isosurface to scalismo. I noticed scalismo only reads vtk so I exported the 3D surface with https://www.mathworks.com/matlabcentral/fileexchange/31030-surface2vtk (I also tried with https://www.mathworks.com/matlabcentral/fileexchange/22602-export-triangulation-to-paraview and am getting the same error).
I scalismo, I ran:
val vol = MeshIO.readMesh(new File("/Path/to/AFLW_image00046.vtk")).get
But I am getting an NPE with this stacktrace:
java.lang.NullPointerException
  at scalismo.utils.MeshConversion$$anonfun$vtkPolyDataToTriangleMeshCommon$1.apply(Conversions.scala:169)
  at scalismo.utils.MeshConversion$$anonfun$vtkPolyDataToTriangleMeshCommon$1.apply(Conversions.scala:157)
  at scala.util.Try$.apply(Try.scala:192)
  at scalismo.utils.MeshConversion$.vtkPolyDataToTriangleMeshCommon(Conversions.scala:157)
  at scalismo.utils.MeshConversion$.vtkPolyDataToTriangleMesh(Conversions.scala:213)
  at scalismo.io.MeshIO$.readVTK(MeshIO.scala:167)
  at scalismo.io.MeshIO$.readMesh(MeshIO.scala:50)
  ... 30 elided

Any idea why that would be? Or an alternative to load this matlab isosurface to scalismo?

Thanks,

Cami.

Camille Lemen

unread,
Jan 25, 2018, 4:38:34 PM1/25/18
to scalismo-faces
I was actually able to load it by saving it in stl.

Camille Lemen

unread,
Jan 25, 2018, 9:03:05 PM1/25/18
to scalismo-faces
Actually, I found that the problem is not related to format but the texture. Whenever I add texture to the volume, I get this stacktrace in scalismo. Any idea?


Le jeudi 25 janvier 2018 11:10:10 UTC-8, Camille Lemen a écrit :

Andreas Forster

unread,
Jan 26, 2018, 11:31:41 AM1/26/18
to Camille Lemen, scalismo-faces
Dear Camille,

Scalismo does not yet support VTK stored meshes with color or texture. So you can not use scalismo.ui.MeshIO.readMesh to read a colored mesh. Scalismo-faces has some support for the *.ply format. So if you want to work with color then please try the ply format. Use

scalismo.faces.io.MeshIO.read(new File("your/mesh.ply"))

to read a mesh with texture or color. Please note also that the support in the ScalismoUI is yet missing to show colored meshes.

I hope my answer brings you further.

Best regards
Andreas


--
You received this message because you are subscribed to the Google Groups "scalismo-faces" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalismo-faces+unsubscribe@googlegroups.com.
To post to this group, send email to scalismo-faces@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalismo-faces/91cf5c2c-ad3b-4e1d-b0d0-eb2de8b3eef8%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
*****************************************
Dr. Andreas Morel-Forster
Departement Mathematik und Informatik
Spiegelgasse 1
CH-4051 Basel
PHONE: +41 61 207 05 52
MAIL: Andreas.Forster@unibas.ch
*****************************************
Reply all
Reply to author
Forward
0 new messages