This package is meant to assemble methods for handling 2D and 3D statistical shape models, which are often used in medical computer vision.
Currently, PCA based shape models are implemented, as introduced by Cootes et al1.
Given a set of shapes of the form ndim x nlandmarks x nshapes
, a PCA shape model is constructed using:
using ShapeModels
landmarks = ShapeModels.examplelandmarks(:hands2d)
model = PCAShapeModel(landmarks)
shapes = modeshapes(model, 1) # examples for first eigenmode
[plotshape(shapes[:,:,i], "b.") for i = 1:10]
plotshape(meanshape(model), "r.")
Example computed with outlines of metacarpal bones:
model = PCAShapeModel(shapes)
compute a shape modelnmodes(model)
get number of modes of the model, including rotation, scaling and translationmodesstd(model)
get standard deviations of modesshape(model, coeffs)
compute a shape given a vectorcoeffs
oflength(nmodes(a))
meanshape(model)
get the shape which represents the mean of all shapesmodeshapes(model, mode)
get 10 shapes from -3std to 3std of mode numbermode
Helper functions for plotting. They require the PyPlot
package to be installed.
axisij()
set the origin to top-leftplotshape(shape)
plot a single shapeplotshapes(shapes)
plot several shaped in individual subfigures
1 T.F. Cootes, D. Cooper, C.J. Taylor and J. Graham, "Active Shape Models - Their Training and Application." Computer Vision and Image Understanding. Vol. 61, No. 1, Jan. 1995, pp. 38-59.