diff --git a/README.md b/README.md index 18e1c0ad..2aef37a7 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ![build](https://github.com/unibas-gravis/scalismo/actions/workflows/ci.yml/badge.svg) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/ch.unibas.cs.gravis/scalismo_3/badge.svg)](https://maven-badges.herokuapp.com/maven-central/ch.unibas.cs.gravis/scalismo_3) [![Gitter](https://badges.gitter.im/unibas-gravis/scalismo.svg)](https://gitter.im/unibas-gravis/scalismo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) Scalismo is a library for statistical shape modeling and model-based image analysis in Scala, developed by the -[Graphics and Vision Research Group](http://gravis.cs.unibas.ch) at the [University of Basel](http://www.unibas.ch). It is based on the the concept of [Probabilistic Morphable Models](https://gravis.dmi.unibas.ch/PMM/). +[Graphics and Vision Research Group](https://shapemodelling.cs.unibas.ch/web/about-gravis) at the [University of Basel](http://www.unibas.ch). The vision of the project is to provide an environment for modelling and image analysis which @@ -13,7 +13,7 @@ The vision of the project is to provide an environment for modelling and image a ## Documentation -* The [Scalismo website](https://unibas-gravis.github.io/scalismo-microsite) contains comprehensive documentation including a series of [tutorials](https://unibas-gravis.github.io/scalismo-microsite/tutorials.html), [API doc](http://unibas-gravis.github.io/scalismo/latest/api/index.html) and links to further ressources and papers. +* The [Scalismo website](https://scalismo.org) contains comprehensive documentation including a series of [tutorials](https://scalismo.org/docs), [API doc](http://unibas-gravis.github.io/scalismo/latest/api/index.html) and links to further ressources and papers. ## How can I help? While scalismo is already fully usable for shape modeling and simple image processing task, its functionality is currently targeted @@ -24,7 +24,7 @@ We welcome contributions to scalismo. Please check the [Contributor's guide](con We are also always grateful if you report bugs or if give us feedback on how you use scalismo in your work and how you think we can improve it. ## Maintainers -The project is developed and maintained by the [Graphics and Vision Research group](https://gravis.dmi.unibas.ch), [University of Basel](https://www.unibas.ch) in collaboration with [Shapemeans GmbH](https://www.shapemeans.com). +The project is developed and maintained by the [University of Basel](https://www.unibas.ch) in collaboration with [Shapemeans GmbH](https://www.shapemeans.com). The current maintainers of the project (people who can merge pull requests) are: * [Ghazi Bouabene](https://github.com/ghazi-bouabene) @@ -48,5 +48,5 @@ The design of the registration approach used in scalismo is strongly influenced ## Copyright and License All code is available to you under the Apache license, version 2, available at http://www.apache.org/licenses/LICENSE-2.0. -Copyright, University of Basel, 2015. +Copyright, University of Basel, 2023. diff --git a/build.sbt b/build.sbt index fe7cc295..a6b8faa5 100644 --- a/build.sbt +++ b/build.sbt @@ -1,6 +1,6 @@ import sbt.Resolver -ThisBuild / version := "0.92-RC1" +ThisBuild / version := "0.92.0" Test / parallelExecution := false diff --git a/src/main/scala/scalismo/numerics/Sampler.scala b/src/main/scala/scalismo/numerics/Sampler.scala index 56e1a847..7c641c98 100644 --- a/src/main/scala/scalismo/numerics/Sampler.scala +++ b/src/main/scala/scalismo/numerics/Sampler.scala @@ -33,11 +33,16 @@ trait Sampler[D] { val numberOfPoints: Int /** - * sample n points (x_1, ... x_n), yielding an sequence of (x_i, p(x_i)), i=1..n , p is the probability density + * generates a sequence of [[numberOfPoints]] sample points (x_i, p(x_i)), i=1..n , where p is the probability density * function according to which the points are sampled */ def sample(): IndexedSeq[(Point[D], Double)] + /** + * generates a sequence of [[numberOfPoints]] points. + */ + def samplePoints(): IndexedSeq[Point[D]] = sample().map(_._1) + def volumeOfSampleRegion: Double } @@ -149,8 +154,8 @@ case class UniformMeshSampler3D(mesh: TriangleMesh[_3D], numberOfPoints: Int)(im case class FixedPointsUniformMeshSampler3D(mesh: TriangleMesh[_3D], numberOfPoints: Int)(implicit rng: Random) extends Sampler[_3D] { override val volumeOfSampleRegion = mesh.area - val samplePoints = UniformMeshSampler3D(mesh, numberOfPoints).sample() - override def sample() = samplePoints + val samplePointsWithProbability = UniformMeshSampler3D(mesh, numberOfPoints).sample() + override def sample() = samplePointsWithProbability } case class FixedPointsMeshSampler3D(mesh: TriangleMesh[_3D], numberOfPoints: Int)(implicit rand: Random) @@ -161,7 +166,7 @@ case class FixedPointsMeshSampler3D(mesh: TriangleMesh[_3D], numberOfPoints: Int val meshPoints = mesh.pointSet.points.toIndexedSeq - def samplePoints = for (i <- 0 until numberOfPoints) yield { + override def samplePoints() = for (i <- 0 until numberOfPoints) yield { val idx = rand.scalaRandom.nextInt(mesh.pointSet.numberOfPoints) meshPoints(idx) } @@ -173,7 +178,7 @@ case class FixedPointsMeshSampler3D(mesh: TriangleMesh[_3D], numberOfPoints: Int lastSampledPoints match { case Some(lastSampledPoints) => lastSampledPoints case None => { - val pts = samplePoints.map(pt => (pt, p)) + val pts = samplePoints().map(pt => (pt, p)) lastSampledPoints = Some(pts) pts } @@ -232,8 +237,8 @@ case class FixedPointsUniformTetrahedralMeshSampler3D(mesh: TetrahedralMesh[_3D] rng: Random ) extends Sampler[_3D] { override val volumeOfSampleRegion = mesh.volume - val samplePoints = UniformTetrahedralMeshSampler3D(mesh, numberOfPoints).sample() - override def sample() = samplePoints + val samplePointsWithProbability = UniformTetrahedralMeshSampler3D(mesh, numberOfPoints).sample() + override def sample() = samplePointsWithProbability } case class FixedPointsTetrahedralMeshSampler3D(mesh: TetrahedralMesh[_3D], numberOfPoints: Int)(implicit rand: Random) @@ -244,7 +249,7 @@ case class FixedPointsTetrahedralMeshSampler3D(mesh: TetrahedralMesh[_3D], numbe val meshPoints = mesh.pointSet.points.toIndexedSeq - def samplePoints = for (i <- 0 until numberOfPoints) yield { + override def samplePoints() = for (i <- 0 until numberOfPoints) yield { val idx = rand.scalaRandom.nextInt(mesh.pointSet.numberOfPoints) meshPoints(idx) } @@ -256,11 +261,10 @@ case class FixedPointsTetrahedralMeshSampler3D(mesh: TetrahedralMesh[_3D], numbe lastSampledPoints match { case Some(lastSampledPoints) => lastSampledPoints case None => { - val pts = samplePoints.map(pt => (pt, p)) + val pts = samplePoints().map(pt => (pt, p)) lastSampledPoints = Some(pts) pts } - } } }