Save statistical shape model using "StatisticalModelIO.writeStatisticalTriangleMeshModel3D"

38 views
Skip to first unread message

Michael Lennon

unread,
Aug 11, 2021, 4:21:08 AMAug 11
to scalismo
Hi,

This might be a basic question but I am unable to find an example of saving a statistical shape model.  I am trying to save a SSM created using data as per code below.  When I try and read the file called "test.h5" I get an error message.  Tried both via IDE and also manually loading in the UI.  Any quick suggestion how to save the model so I can reload it easily in another project?

val modelFromDataCollection = PointDistributionModel.createUsingPCA(dc)
StatisticalModelIO.writeStatisticalTriangleMeshModel3D(modelFromDataCollection, new java.io.File("datasets/test.h5"),"/datsets" )

Capture.JPG

Cedric Hemom

unread,
Aug 11, 2021, 5:51:02 AMAug 11
to scalismo
val dc = DataCollection.fromTriangleMesh3DSequence(refMesh_origin_save, Transform_Meshes)
val modelFromDataCollection = PointDistributionModel.createUsingPCA(dc)
val SSM_Pancreas_File= new java.io.File("D:/"+"Pancreas_PCA_crop_smooth.h5")
writeStatisticalTriangleMeshModel3D(modelFromDataCollection,SSM_Pancreas_File)

Hi can you try this, i think your path is incorrect.

Michael Lennon

unread,
Aug 11, 2021, 7:46:26 AMAug 11
to Cedric Hemom, scalismo
That worked. Thanks Cedric!

--
You received this message because you are subscribed to a topic in the Google Groups "scalismo" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scalismo/Shx-zfZ5OOk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scalismo+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalismo/3bb91e59-b63c-46fc-b44d-ccbbdf221f80n%40googlegroups.com.

Cedric Hemom

unread,
Aug 11, 2021, 8:36:36 AMAug 11
to scalismo
You're welcome
Reply all
Reply to author
Forward
0 new messages