val reference : TriangleMesh[_3D] = ???
val trainingData : Seq[TriangleMesh[_3D]] = ???
val dataCollection : DataCollection[_3D, TriangleMesh, EuclideanVector[_3D]] = DataCollection.fromTriangleMesh3DSequence(reference, trainingData)
val model = PointDistributionModel.createUsingPCA(dataCollection)
val generalisation : Double = ModelMetrics.generalization(model, dataCollection).get
val specificity : Double = ModelMetrics.specificity(model, trainingData, 10)
// Variance captured in first 5 components
val variance : Double = breeze.linalg.sum(model.gp.variance(0 to 5))
--
You received this message because you are subscribed to the Google Groups "scalismo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalismo+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalismo/d28b13b0-ab65-4c27-89f2-a461be5721bcn%40googlegroups.com.
def readMeshesFromDirectory(directory : java.io.File) : Seq[TriangleMesh[_3D]] = {
val plyFiles = directory.listFiles().filter(file => file.getName.endsWith(".ply"))
for (plyFile <- plyFiles) yield {
MeshIO.readMesh(plyFile).get
}
}
readMeshesFromDirectory(new java.io.File("directoryContainingMeshes"))
To view this discussion on the web visit https://groups.google.com/d/msgid/scalismo/d1bb0671-efc3-4814-8326-bc491e7a2bc0n%40googlegroups.com.
val trainingSet : Seq[TriangleMesh[_3D]] = ???Best regards,
for (mesh <- trainingSet) {
println(mesh.pointSet.numberOfPoints)
}
To view this discussion on the web visit https://groups.google.com/d/msgid/scalismo/0ad21d78-ef91-4e85-af92-b5aef4153c38n%40googlegroups.com.
scalismo.statisticalmodel.dataset.CrossValidation
To view this discussion on the web visit https://groups.google.com/d/msgid/scalismo/1ffea6b9-3d66-4c64-ac2c-20b3564bc543n%40googlegroups.com.
val referenceMesh: TriangleMesh[_3D] = ???
val trainingMeshes: Seq[TriangleMesh[_3D]] = ???
val dataCollection = DataCollection.fromTriangleMesh3DSequence(referenceMesh, trainingMeshes)
// computes whatever metric is appropriate to compare the left out mesh with the model.
// For generalisation it is a projection into the model, followed by the distance
def evalFun(pdm : PointDistributionModel[_3D, TriangleMesh], mesh : TriangleMesh[_3D]) : Double = {
MeshMetrics.avgDistance(pdm.project(mesh), mesh)
}
val generality_full = Crossvalidation.leaveOneOutCrossvalidation(dataCollection, evalFun)
To view this discussion on the web visit https://groups.google.com/d/msgid/scalismo/07abcb0a-c1dc-4b3c-90c2-2c7c8937f225n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalismo/7baef859-40b8-45b2-9f50-60fb7813fe07n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalismo/df71bbd5-61e4-47f2-9ebc-2cb02a48ae4cn%40googlegroups.com.
def evalFun(pdm : PointDistributionModel[_3D, TriangleMesh], mesh : TriangleMesh[_3D]) : Double = {
MeshMetrics.avgDistance(pdm.truncate(3).project(mesh), mesh)
}
val generality = Crossvalidation.leaveOneOutCrossvalidation(dc, evalFun)
val generality_vector = for (i <- 0 until generality.length) yield (generality(i).head)
val avg_generality = generality_vector.sum / generality_vector.length
To view this discussion on the web visit https://groups.google.com/d/msgid/scalismo/d4103e00-7d18-4b55-be56-9eeacf5dcae3n%40googlegroups.com.
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/SR5TKFxJc1Y/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/CAPvL3iE2XaCUJ7ijE__HfHH1JMgCkwYEThcZAzM%3DPhWOioTEpw%40mail.gmail.com.
Thank you Marcel for sharing what I want,But still now I have a question specially in the code line 2 that is "val trainingData : Seq[TriangleMesh[_3D]] = ???"The path of my training data was at "C:\\Users\\user\\Documents\\minimal-scalismo-seed-master\\data\\2Projecetd Meshes\\"When I try to declare the path as shown belowval trainingData : Seq[TriangleMesh[_3D]] = MeshIO.readMesh(new File("C:\\Users\\user\\Documents\\minimal-scalismo-seed-master\\data\\2Projecetd Meshes\\")).getIt says an error, it says required: "Seq[TriangleMesh[_3D]] found: TriangleMesh [_3D]".I tried a lot to fix it but it challenges me. So what would be the correct path declaration based on the training data directory that I mentioned above?With regards,
To view this discussion on the web visit https://groups.google.com/d/msgid/scalismo/d1bb0671-efc3-4814-8326-bc491e7a2bc0n%40googlegroups.com.