geometric invariants for bone fragment refitting via face ......four invariants have been examined,...
TRANSCRIPT
Geometric Invariants For Bone Fragment Refitting Via Face Matching
Riley O’Neill
Dr. Shakiban
University of St. Thomas
In cooperation with the University of Minnesota:
Katrina Yezzi-Woodley, Jeff Calder, Peter J. Olver, Pedro Angulo-Umaña, Bo Hessburg
September 1st, 2018
Abstract
In an effort to match the faces of bone fragments for reassembly, numerous geometric invariants
have been prepared for discrete implementation on triangulated meshes in MATLAB and
explored for robustness. Four invariants have been examined, ranging from the more elementary
cumulative distance and surface area histograms, which are less robust measures for
triangulations formed from CT scans, to an entirely new method of calculating a volume
invariant, as well as the principal curvature via Principal Component Analysis. The principal
curvature and volume invariants are sufficiently robust for face matching, and algorithms for
face matching shall be developed and synthesized with those for curve matching in the coming
weeks.
Introduction and Objectives
Bones are of crucial importance to understanding life on earth. They are of the few vestiges left
by prehistoric eras and the foremost evidence we have for conjectures regarding the evolutionary
path of terrestrial existence and existence of extinct or unknown species. Were not bones
reposited in ancient mud pits, the notion of a dinosaur would not even permeate modern
consciousness, and many discount the potential existence of bigfoot by the lack of any bones
found. Bones also show where we and others have come from, what we have done, and
potentially foreshadow where we are going. Particularly for the field of anthropology, bones
shed light on ancient average lifespans, hunting patterns (both what hominids hunted and what
hunted them), causes of death (both modern and ancient), and hominid distribution. In a study
published in 2017, a group of researchers unearthed a mastodon in California they claim proves
hominids were in America 130,000 years ago -115,000 years earlier than originally thought
(Zimmer, 2017). The bones appear to have been broken with stone tools (the trademark method
of hominids for getting bone marrow), which were found in the vicinity (Zimmer, 2017). Using
similar tools on elephant bones, the team found the breakages were indeed similar, but the study
remains hotly contested (Zimmer, 2017). As hominids were only thought to have left Africa
40,000 years ago, these bone fragments could fundamentally alter human history.
Bones are breakable - a fact that is both fabulous and troubling for using them to study
ancient life. This fact is fabulous for getting at the conditions of other ages; anthropologists
examine fragment break angles (those on an edge that broke (yes, vague)) to attempt to ascertain
the actor of breakage (who or what broke it: hominid, animal, cave collapse, fall to death, saw,
lava explosion, alien laser, etc.). However, this fact is troubling for both determining break actors
and putting bones back together (to configure species, bone structure, and figure out what broke
entire bone) - sites with bone assemblages can be comprised of hundreds of thousands of
fragments, a fact that can make bone reassembly and study a tedious and time-consuming task.
Anthropologists employ devices hailing from the Victorian era called goniometers (see
Appendix A:1 for picture), or protractors by another name, for both bone reassembly (refitting)
and break angles, but this barely aids the process. To this day, anthropologists describe refitting
as “Painstaking” (Bartram and Marean, 1999), “Time consuming” (Vaquero et al., 2017), and
“Difficult to manage logistically” (Morin et al., 2005). In the age of machine learning and
advanced image processing, how can mathematics be applied to expediate and refine both the
ascertainment of break actors and bone reassembly processes?
As this is a tremendously large and daunting task, we’ve split the project between the break
actors and fragment refitting. For fragment refitting, we have four main end goals: that it
automatically identify potential fits, do so without any beforehand knowledge (not telling the
program 2 fragments go together, so it could function for mass bone assemblages), do so
expediently and reliably (which often can get to be a tradeoff), and not be too difficult or
impractical to implement (that the bone scans don’t have to be ridiculously high resolution).
However, before this can be done, we have to possess data that can be used for matching, which
is the first goal of the project - feature extraction. Numerous means of feature extraction exist, so
we’ve again split the current refitting work into two: curve matching and face matching. My
work has been primarily concerned with face matching, although I’ve broken my fair share of
bones as well (see appendix 1.2 for proof and more information on the bone breaking process).
Background and Methodology
Automated bone refitting has never before been successfully attempted. A brief initiative at
Arizona State University did embark on feature extraction for lithics, ceramics, and bones with
the aim of eventual refitting (Schurmans et al., 2002), but this program seems to have never
come to fruition. However, ceramic and lithic refitting has made substantial progress in
subsequent years. Ceramic and lithic refitting and face differentiation has primarily used
measures of roughness for surface differentiation (Rasheed & Nordin, 2015). However, this
doesn’t work for bones as the majority of the pertinent bone breakages are comparatively smooth
and clean, and thus less discernible in texture (one exception would be for trabecular bone, but
such is not the norm). Others employ predictive methods based off common pottery forms and
distinctive shapes (spheres, cylinders, rectangles, etc.), but we don’t necessarily know what
kind/shape the bone will be as we’re piecing it back together, and bones aren’t such perfect
constructs. Lithic reassembly has further found success with a qualitative approach, using some
probability and several properties like material composition and scar count. Tragically, bones are
not quite as qualitatively unique as rocks.
Thus, we turn to the quantitative, where a number of more advanced mathematical
techniques are employed. Just as done for ceramics and lithics, we employ computerized 3D
models for feature extraction and matching, using DAVID or CT cans (see Appendix 1.3 for
more about DAVID). From these scans, we generate 3D models. As fragment matching must
occur in a 3-dimensional space and it would be frankly ludicrous to attempt to devise concise
equations for each and every elaborate bone fragment surface, we convert the 3D models into
triangulated meshes in MATLAB (see appendix 2.1 for visuals of both). Triangulations serve as
a convenient way of estimating the bone surfaces with triangles for ease of numerical
implementation via discrete differential geometry. The vertices (points) used for these models
are taken factoring into account extrema and averages for a given area, yet the point values vary
slightly from mesh to mesh - even if two fragments perfectly match in real life (no missing
pieces), the triangulations may not match exactly. Furthermore, the chance these triangulations
are in the same orientation is effectively zero without a priori knowledge. As such, we demand
robust geometric invariants, or properties of a surface that will not change with parameterization
or orientation, to match the fragment surfaces.
Curve matching follows from the pioneering work of Grim et. al’s (2016) 2D and 3D puzzle
solving algorithms using the signature curvature of a surface. The signature curvature is a
geometric invariant whereby the curvature is plotted against the derivative of the curvature. Here
we take the curve that best encompasses a break face, take the signature curvature, and match it
to the the corresponding surface’s for matching. So far, this method is very noise sensitive but
has successfully matched some fragments and is still being refined. Face matching, however
encompasses a much larger category of invariants:
1. Cumulative Distance Histograms
Euclidean distance is the most basic of geometric invariants. In aiming to characterize surfaces in
3 dimensions, this is perhaps the readiest go-to. While we could potentially just examine the
maximum and minimum distances across a given face, this doesn’t work for mass bone
assemblages - numerous fragment faces could bear the same maximum and minimum distances,
and one face may not fit to the entirety of another. To remedy the former issue, we employ
cumulative distance histograms. Histograms are charming, simple constructs that plot the
number of an eligible parameter incrementally, usually in the form of a bar graph. For a fixed
region, distance histograms merely plot the number of points at or within a distance parameter
(can be set a single value or at a range) of a given point or points. For for characterizing surfaces,
we like cumulitize this and do every point on a surface, which does often mean double and triple
and sextuple counting the same point. However, these plots tend to say more about the number of
points used than the surface they describe, which is unideal for our triangulations devised from
bone scans as the quantity of points and their distribution can vary tremendously for an unrefined
mesh. Thus, we normalize with cumulative distance histograms, as put forth by Brinkman and
Olver (2012):
(1.1) H(r) = N-2 #{ D(p1,p2) < r }
Where the histogram value H at a given distance r is provided by the number of distances D from
one point to another less than or equal to r (more simply, the number of points within r for each
point) and the total number of points N (Brinkman and Olver, 2012). Graphing this against r
produces a plot that doesn’t alter with regard to the number of points used or the orientation of
the surface. Thus, we have our first invariant (figure 1).
Figure 1: Cumulative Distance histogram. Value of H plotted on y axis, r on x axis. (all figures
can be found on larger scale in Appendix 4, and all code functions are listed in appendix 3).
As the distance is the direct product of the triangulations are devised by the software
(particularly around extrema still), this exhibits the greatest variation of all our methods
presented here (and thus is the least robust); some comparatively substantial range of error would
have to be implemented before potential use in face matching. While this is perhaps a sufficient
metric to test if two known regions of the bone surfaces go together, determining exactly what
portions of the bone fragments those are remains extremely difficult with this method alone, as
plots would need to be generated for every progressively cropped region. Starting from our face
segmentation algorithms with a-priori knowledge on which fragments go together and compiling
distance histograms for each identified face of each fragment would provide a better vantage for
user input matching, but this is not the end solution we are looking for.
2. Surface Area
Averaging and integrating has a smoothing effect (Pottmann et al., 2006), so conceivably the
surface area would be more conducive to face matching. This is where the triangulation begins to
make things wonderful. The area of a triangle is simply half the cross product of two of its legs:
(2.1) |T| = .5( V1 x V2)
V1 and V2 are simply the vectors from one vertex to the other two on the triangle, so we can very
easily approximate the surface area of both the whole fragment surface as well as select regions.
Were the triangulations completely perfect, this could be used for mesh matching. For a 100,000
point triangulation of a sphere of radius 5, the total surface area by this approximation is about
4% off from the actual surface area. Similar to the distance, we can also do cumulative
histograms of this (figure 2), which should be more robust than just a sum of the area in a given
range, here plotting the value of the surface areas within a given radius of a point for every point
(which again is better for verifying face matches than predicting them). However, the the
triangles that make up the triangulations are generally quite similar, so this isn’t always a
fabulous way to go.
Figure 2: cumulative surface area histogram. Surface area within a given radius on y axis
against the radius on the x. Note how similar it is in shape to the volume invariant for the same
bone surface.
3. The Volume Invariant
3.1: Estimating from triangulation
The volume invariant has been by far the most laborious and fruitful development of the
summer. While the total volume of a closed surface is invariant on its own, this tells us next to
nothing about what it can be attached to, so it is not worth calculating. Rather, if we can
configure the volume just on the interior and the exterior within a given distance of the surface,
then we can configure what region goes to what region easily relatively easily and more robustly.
Figure 3: One ball Br shown on the surface of a triangulation. We’re aiming for the volume just
inside the surface, so the portion in the upper half. (See Appendix 2.2 for more representations).
Figure 4: Triangles contained within the radius of this ball.
A method by the name Monte Carlo was devised some years ago for this purpose. For a ball Br
of radius r centered at a given vertex on the mesh, the volume on the mesh’s interior (Figure 3)
is estimated by taking a random sampling of points within r and simply asking “are you in, or are
you out?” (this really should be called the Heidi Klum method). The portion inside can then
merely be taken as the fraction of the points inside times the total volume of the ball. This,
however, is only as strong as the number of points tried, and takes a long time if accuracy is
desired, particularly for large meshes. However, we’ve produced a better way of approximating
that doesn’t require any probability. By the Divergence Theorem, which shows that the surface
area of a closed surface is but the derivative of its volume (just as the area of a sphere is the
integral of its surface area), we can solve for the volume inside the surface by using the triangles
the sphere encompasses (Figure 4). This yields the following equations (as derived by Calder,
2018):
(3.1.1).
Where x is a point in barycentric notation, v is its outward normal vector, and gamma is .5 for
smooth surfaces. A first evaluation of this for a triangulated surface yields the following:
(3.1.2)
(3.1.3)
Where xi yi zi are the coordinates describing a triangle face center within the radius r for a given
vertex, vix , v
iy , v
iz, refer to the components of the outward normal, and |Ti| refers to the surface
area of the triangle (Calder, 2018). For a single ball on a spherical mesh, the portion of the
volume inside the mesh is shown to be an exact quantity (Hulin and Troyanov, 2003):
(3.1.4)
Where Vol(Bp) connotes the volume of the ball of radius t at point p and Bp+ connotes the
volume of the ball inside the sphere of radius R (Hulin and Troyanov, 2003). With this, we can
quite easily test our invariant on a spherical mesh (Figure 5).
Figure 5: a ball on a sphere mesh.
Testing the exact value against the calculated yields the following plots:
Figures 6 & 7: graph of the internal volume of ball of radius r (aka t) on sphere mesh of radius
R. as well as relative error (note axes do not start at 0).
This indicates this first approximation is frankly horrible. While we could just simply add a
constant term, for a bone surface that may not be the case, so we needed to develop something
more accurate. As averaging and integrating have a smoothing effect (Pottmann et al., 2006), we
then try taking (3.1.3) at each vertex of a triangle in range of a given vertex (Calder, 2018):
(3.1.5)
This yields the following plots:
Figures 8 & 9: 3 point approximation for one triangle.
All that’s seemingly changed is the calculation is an overestimate instead of an underestimate by
the same error, which isn’t tremendously encouraging. However, instead of averaging for the
whole triangle, we can subdivide it into 3, average those, and sum for a better approximation of
the whole (Calder, 2018):
(3.1.6)
Testing this yields the following plot:
Figures 10 & 11: 3 triangle subdivisions.
Which is slightly improved, but still poor. Continuing with a similar procedure to (3.6) only for 9
and 12 triangle divisions for each yields the following plots respectively:
Figures 12 & 13: 9 triangle subdivisions.
.
Figures 14 & 15: 12 triangle subdivisions.
Clearly the 12 triangle approximation offers the best correlation yet. As I was preparing for the
lugubrious task of coding 18, 24, 32 triangle subdivisions, I thought I may as well try 4 and 6
triangles:
Figures 16 & 17: four triangle subdivisions.
Figures 18 & 19: 6 triangle subdivisions. Really quite good.
As the six triangle approximation offers the closest and easiest calculation to the actual value,
clearly this is the way to go. While it may at first seem counterintuitive that fewer triangle
divisions would yield a better approximation, the rationale is actually very simple: 6 triangle
subdivisions most effectively reduce the side lengths of each triangle. With the 3, 9, and 12
triangle divisions, l side of each triangle still remained unshortened.
3.2 Analytic Expression for Gamma
Still, a gap remains in the plot. To better try and bridge this gap, we develop an expression for
gamma, which works from the fraction of the adjacent triangles’ (figure 20) surface area inside
the sphere (formal derivation can be found in Calder, 2018).
Figure 20: adjacent triangles for a small ball. Graphic source: (Calder, 2018)
Working in spherical coordinates defined by (Calder, 2018):
(3.2.1)
We use the expression (Calder, 2018):
(3.2.2)
Where:
(3.2.3)
(3.2.4)
(3.2.5)
(3.2.1 – 3.2.5 all from Calder, 2018)
Running gamma and the six-triangle approximation on the sphere mesh produces the following
plots:
Figures 21 & 22: Gamma run with six triangle subdivisions on a sphere.
Note that these are almost identical to the plots received when running just the triangle
subdivisions with .5 for gamma, but that the difference between the simulation and the exact
decreases slightly as the radius increases. As the sphere is as regular a triangulation as possible,
this serves as a testament to it working. Only when run on more irregular bone fragment
triangulations should gamma make a more notable difference.
3.3 Bulk and Adaptive Mesh Refinement
To minimize the number of necessary computations and maximize the accuracy of the volume
invariant, we’ve developed an algorithm for iterative mesh refinement. Working from the error
tolerance of the function (see again Calder, 2018 for formal derivation):
(3.3.1)
Where zi is the coordinate of the triangle face center (in barycentric), vi is still the normal vector
to the triangle, r is still the radius of the ball, epsilon (the curvy E) is the error tolerance between
r and 1 (r is less than 1), Sr is the area of the triangle, and Mi is (Calder, 2018):
(3.3.2)
Where x is the distance from the given center vertex of a ball to a vertex of a given triangle
within the ball (Calder, 2018).
The methods for mesh refinement are still being… refined. Originally we sought a bulk
refinement process for if a triangle would ever need to be refined by producing a large MATLAB
matrix of 1’s and 0’s to determine if a triangle would ever need refining for the whole
triangulation, which was quick and efficient for small things, but for point lists in the order of
28,000 in length (which many fragments even exceed), generating 28,000 by 28,000 arrays of 1’s
and 0’s for refinement exceeded MATLAB’s memory. Ways to do this with only an overarching
loop using shorter cell arrays of points with the range search function are also being explored but
have yet to cumulate in anything fabulous.
Doing adaptive mesh refinement for every single sphere so far has worked for large
triangulations but takes a very long time - eons compare to just implementing the six triangle
approximation. Particularly around sharp corners on the meshes, the program tends to get caught
up over refining, creating hundreds of thousands of triangles if epsilon is too close to the radius
and potentially crashing MATLAB. As the program takes so long to run, we haven’t yet
sufficiently optimized epsilon, but will do so in the coming weeks.
3.4 Spherical Volume Invariant Matching
Figure 23 - How face matching would work with the volume invariant. More spheres
encompassing all valid matches for a face surface would of course be employed for the
orientation. Graphic source: (Hessburg, 2018).
As shown in figure 23, face matching from the volume invariant would follow from trying to
match the interior volume of the sphere for one surface to the exterior volume of another’s on a
point to point basis, similar to outright surface area matching. In an ideal situation of perfect
meshes, for every point on one mesh, the other match would be searched to see where its
spherical volume invariant value matches the other point. From potential matches, the
neighboring points would be examined to see if they match (to both verify the match and obtain
the translation and rotation values for visualizing the match). From the immediate neighbors,
successively more distant neighbors would be examined, and on a sort of “x amount of strike
basis” the match could be verified. Equally doable, the mesh could be traversed from a given
point until the invariant values no longer match, which would also show the extent of the
potential face match on a point to point basis. However, as not all of the vertices of one
triangulation necessarily equate to another by how they are generated by the software, this idyllic
notion is hazier for implementation. While more robust than outright surface area matching, this
still requires a certain range of error and a bout of averaging before potential implementation.
Routes of this are still being explored with averaging the invariant values for a given
neighborhood when traversing the mesh, but have yet to be developed. Finally, cumulative
volume histograms done with respect to both a changing radius and a fixed radius are also
potential routes for verifying a suggested region match, where the operations work in the same
way as for cumulative surface area and distance histograms.
4. Principal Component Analysis and Principal Curvature
The spherical volume invariant is already a robust estimator of mean curvature (Hulin and
Troyanov, 2003); however, it relates no information directly about the individual curvatures,
Gauss curvature, or principal curvatures (Calder, 2018). Just as there are many ways to achieve
the same surface area for a given area around a vertex of a mesh, there are several ways to
achieve the same volume invariant for a mesh, particularly for relatively plain break surfaces.
This is what makes it necessary to obtain an additional invariant. Principal Component Analysis
refers to a broad category of methods for isolating and extracting crucial elements from data to
find stronger and independent correlations from data (Brems, 2017). In the field of discrete
differential geometry, it has found great use in feature extraction and analysis. Here we
implement it to retrieve the principal curvatures, though these can be devised by other means less
robustly. devising the covariance matrix for br, with x again in barycentric coordinates (Calder,
2018):
(4.1)
(4.2)
(Calder 2018) Where:
(4.3)
(4.4)
(4.5)
Where the eigenvalues of MS,r (lamda1 - lamda3) can be used to solve for the curvatures (Calder,
2018):
(4.6)
(4.7)
(4.8)
Thus (Calder, 2018):
(4.9)
Where k1 and k2 are the principal curvatures at a given face center, H is their mean, and O(r7) is
negligible for this computation. These can be estimated in several other ways as well, but this
should stand as the most robust (Calder, 2018). This, paired particularly with the volume
invariant, should stand as enough information to uniquely characterize bone surfaces for face
matching.
Future Work
In the coming weeks, we will begin to implement these invariants for face matching, with the
end goal of creating a suite of measures that can sufficiently characterize and match bone
fragments. For each alone, implementation can quickly become a dance of error ranges to
provide the optimal range of points or plots - not too many as to be effectively meaningless
returns, but not too few (or none) such as to be too stringent ( a very Goldilocks situation).
However, as more and more invariants are applied, this dance should become less a cumbersome
waltz and more a simple shuffle. While we have great confidence in the volume invariant and
principal curvature combination, we do not resist the notion of integrating these method into our
existing curve matching and distance minimization methods.
Bibliography
Bartram, J. L., & Marean, C. W. (1999). Explaining the “Klasies Pattern”: Kua
Ethnoarchaeology, the Die Kelders Middle Stone Age Archaeofauna, Long Bone
Fragmentation and Carnivore Ravaging. Journal of Archaeological Science, 26(1), 9-29.
doi:10.1006/jasc.1998.0291
Brems, M. (2017). “A One-Stop Shop for Principal Component Analysis – Towards Data
Science.” Towards Data Science, Towards Data Science, 17 Apr.
Calder, Jeff (2018). “notes.” Personal correspondence.
Gray, A., Abbena, E., Salamon, S. (2006). “Modern Differential Geometry of Curves and
Surfaces with MATHEMATICA.” Chapman & Hall/CRC, Taylor and Francis Group.
Grim, A., O’Connor, T., Olver, P. J., Shakiban, C., Slechta, R., & Thompson, R. (2016).
Automatic Reassembly of Three-Dimensional Jigsaw Puzzles. International Journal of
Image and Graphics, 16(02). doi:10.1142/s0219467816500091
Hessburg, 2018. “Volume Invariant matching.” Personal Correspondence.
Huang, Q. X., Flöry, S., Gelfand, N., Hofer, M., & Pottmann, H. (2006). Reassembling
fractured objects by geometric matching. ACM Transactions on Graphics (TOG), 25(3),
569-578. (p. 569 and 573)
Hulin, D., and Troyanov, M. (2003). Mean Curvature and Asymptotic Volume of Small Balls.
The American Mathematical Monthly, Vol. 110, No. 10 (Dec., 2003), pp. 947-950 Taylor
& Francis, Ltd. on behalf of the Mathematical Association of America Stable URL:
E. Morin, T. Tsanova, N. Sirakov, W. Rendu, J.-B. Mallye, and F. Leveque. Bone refits in
stratified deposits: testing the chronological grain at Saint-Cesaire. ́ Journal of
Archaeological Science, 32(7):1083–1098, 2005.
Olver, P. J., and Brinkman, D. (2012). Distance Histograms. The American Mathematical
Monthly, Vol. 119, No. 1, pp. 4-24 Published by: Taylor & Francis, Ltd. on behalf of the
Mathematical Association of America Stable.
Pottmann, H., Wallner, J., Yang, Y.L., Lai. Y.K., Hu, S.M (2006).. “Principal Curvatures from
the Integral Invariant Viewpoint” Industrial Geometry, Forschungsschwerpunkt S92
Report No. 22.
Rasheed, N. A., and Nordin, M. J. (2015). A survey of computer methods in reconstruction of
3d archaeological pottery objects. International Journal of Advanced Research, 3(3):712–
714.
Schurmans, U. A., Razdan, A., Simon, A., Marzke, M., McCartney, P., Van Alfen, D., ... &
Rowe, J. (2002). Advances in geometric modeling and feature extraction on pots, rocks
and bones for representation and query via the internet. BAR International Series, 1016,
191-204. (p. 200 and 201).
Zimmer, Carl. “Humans Lived in North America 130,000 Years Ago, Study Claims.” The New
York Times, The New York Times, 26 Apr. 2017,
www.nytimes.com/2017/04/26/science/prehistoric-humans-north-america-california-
nature-study.html.
APPENDIX 1: some more helpful and interesting pictures and quibs:
1. A goniometer, or a protractor by another name. Particularly for small fragments, these bulky
ends yield crude and imprecise measures. Mathematical analyses of break angles is far more
precise; we’re publishing on this imminently as well.
2. Riley O’Neill breaking bones. Bones were broken using four methods: batting, as though the
bone were a baseball bat striking a rock; hammerstone, where a bone is hit with a rock (in some
instances against another rock (these two techniques emanate hominid methods)); rock dropping
(to simulate cave collapses); and fed to hyenas (to simulate, hyenas). Note the meat and marrow
on the bone. In the hot July sun, the smell was quite something. We first did this in a field at the
University of Minnesota near a path to the Mississippi; general passersby were quite revolted at
the bloody mess we were making, but dogs were quite interested.
2.5. Simulating a cave collapse. I would be remiss if I didn’t include this picture.
3. The DAVID laser scanning apparatus. The Database for Annotation, Visualization and
Integrated Discovery has produced an affordable and effective scanning array that functions from
placing objects on a turntable and scanning them with a posable scanning armature.
APPENDIX 2: more helpful plots.
2.1: 3D surface to triangulation:
A. 3D surface
B. Triangulation of 3D surface
2.2: more spherical volume invariant plots:
Note the small ball towards the top. Now imagine one of these corresponding to every point on
the mesh.
APPENDIX 3: MATLAB Code
1. Code I’ve Written:
General Purpose (more or less):
refine_mesh.m - Inputs: T, triangulation, column array k with 0 or 1 for each triangle
corresponding to triangulation’s connectivity list. Refines triangles with 1 into 6 and returns
refined triangulation.
tri_areas.m - returns column array of areas of each triangle of input triangulation.
face_centers2.m - works on triangulations with less than 3 triangles (really petty improvement,
but nice for testing).
face_normal2.m - as refine_mesh.m is completely ignorant towards orienting the points in the
triangle connectivity list in right order (for now), this returns a list of outward face normals
working from a center point, which can be taken as input (handy for extracted, refined
patches), or is automatically calculated from averaging the points. (it seemed far more
ingenious at the time, but I don’t think we’re using refined meshes for patch extractions :/).
Fix_normals.m - takes input triangulation and optional center point (else will determine by
averaging as in face_normal2.m), and returns triangulation with corrected connectivity list.
Should be added to refine_mesh.m. Removes necessity for face_normal2.m.
sphere_mesh.m - generates a triangulation of a sphere with input radius and number of points.
Fabulous for testing.
Distance
Buildhistvec.m -takes point list as input. Plots runs:
cummhist.m - builds
Surface area
surface_area_invariant.m - finds within given range r
surface_area_histogram.m - histogram
Volume
~ SVI = Spherical volume invariant. I got sick of always typing it all out.
svi1.m - using face center for 1
svi2.m - using vertices for 1
svi3.m - divides into 3 triangles, uses vertices
svi4.m - divides into 4 triangles, uses vertices and medians. (pretty ok)
svi6.m - divides into 6 triangles, uses vertices, medians, and face centers. BEST correlation.
svi9.m - divides into 9 triangles using vertices and 4 centers.
svi12.m - divides into 12 triangles.
test.m - tests svi’s (change in text) against exact value. svi6.m won.
svigamma - gamma function for spherical volume invariant. Not all of the above invariant
calculations have had it implemented
svi_ultra - adaptive mesh refinement with gamma. A work in progress.
Principal Curvature
msr.m - generates covariance matrix. Still being tested and developed as eigenvalues are not
lining up.
2. Things I haven’t personally written, but are used by things I’ve written:
General Purpose:
face_centers.m - face centers for things
Principal Curvature:
robust_curvatures.m - alternative way of estimating principal curvatures.
APPENDIX 4: figures on larger scale.
Figure 1: Cumulative Distance histogram. Value of H plotted on y axis, r on x axis.
Figure 2: cumulative surface area histogram. Surface area within a given radius on y axis
against the radius on the x. Note how similar it is in shape to the volume invariant for the same
bone surface.
Figure 3: One ball Br shown on the surface of a triangulation. We’re aiming for the volume just
inside the surface, so the portion in the upper half. (See Appendix 2.2 for more representations).
Figure 4: Triangles contained within the radius of this ball.
Figure 5: a ball on a sphere mesh.
Figure 6: graph of the internal volume of ball of radius r (aka t) on sphere mesh of radius R
using face center approximation.
Figure 7 : relative error of using face centers.
Figure 8: using vertices.
Figure 9: using vertices.
Figure 10: 3 subdivisions.
Figure 11: 3 subdivisions.
Figure 12: 9 subdivisions.
Figure 13: 9 subdivisions.
.
Figure 14: 12 subdivisions.
Figure 15: 12 subdivisions.
Figure 16: 4 subdivisions.
Figure 17: 4 subdivisions.
Figure 18: 6 subdivisions.
Figures 19: 6 subdivisions.
Figure 20: adjacent triangles for a small ball.
Figure 21: Gamma with six subdivisions.
Figures 22: Gamma with 6 subdivisions.
Figure 23: spherical volume invariant matching.