Level Sets Methods in Imaging Science – p.1/36 [email protected] Dr. Corina S. Drapaca Pennsylvania State University University Park, PA 16802, USA

Level Sets Methods in Imaging Science , s nics, , edited by Level Sets Methods in Imaging Science – p.2/36 , Cambridge University Level Set Methods and Dynamic Implicit Level Set Methods and Fast Marching Methods: edition, 1999. , Applied Mathematical Sciences vol. 153, 2003. nd

Introduction Press, 2 S.Osher, R.Fedkiw, J.A.Sethian, Handbook of Mathematical Models in Computer Vision Geometric Level Set Methods in Imaging, Vision, and Graphic Surfaces evolving interfaces in computational geometry,computer fluid vision, mecha and materials science N.Paragios, Y.Chen, O.Faugeras, Springer, 2006. edited by S.Osher, N.Paragios, Springer, 2003. • • • • Textbooks d on, Level Sets Methods in Imaging Science – p.3/36 Fedkiw book) & (Osher .” add dynamics to implicit surfaces

Introduction coupling, epitaxial growth, etc.) deblurring/denoising, reconstruction of surfaces from unorganized data points, etc.) computer vision CAD (computer-aided design) optimal design and control computational geometry computational fluid mechanics computational physics (two-phase flows, shocks, solid-flui image processing (restoration, segmentation, registrati useful in analyzing and computingbounding the a motion (multiply of connected) an openvelocity interface region field. under a given • • • • • • • • Originally introduced by S.Osher, J.A.Sethian,Computational Journal Physics of 79, pg.12-49, 1988. Extensively used in ”Level set methods • • • Level Set Methods Level Sets Methods in Imaging Science – p.4/36 . 1 =const. C , n simple closed interfaces. and codimension R 1 ∈ − ) n n . ,...,x 1 -dimensional. = 0 x n C =( A simple (left) and a non-simple (right) closed interface. ~x ∀ C, : the isocontour of a (implicit) function : list of all the interface points using a parametrization of : the border between two subdomains (or between the )= ~x ( Introduction the interface. explicit implicit φ For simplicity, : • • n (Sub) domains are Interface Interfaces have dimension Interface representations: We will consider only the case of inside and outside of a domain). R • • • • • Implicit Functions In and the interface (left). } 1 } 1 > , Level Sets Methods in Imaging Science – p.5/36 1 2 y {− and the outside region + 2 1) , x Ω = | 1 ∂ 2 (right). − R } ∈ = ( = 1 ) − 2 Ω y x, y ( + { 2 = x | defining the inside region (unit open disk) 2 + 2 R Ω R ∈ in ) 1 − x, y ( 2 { y as well as the boundary (interface) defining the inside region + ) 2 Ω = R ∞ x ∂ in , the outside region + , } 1 1 ) = (1 − < ∪ 2 x, y 2 x ( 1) y (unit circle) φ − + , ) = 2 x ( x | φ −∞ 2 R = ( ∈ + ) Ω Introduction x, y ( { Implicit function Examples: = • − Ω Implicit Functions ence at the ase. erface. ntains amples Level Sets Methods in Imaging Science – p.6/36 π 2 ≤ s ≤ 0 s, (dimension 0) = sin } 1 , 1 s, y {− = cos x name used in the image processing literature for a : one possible paramaterization of the unit is: : a list of2 points R R

Introduction in in • • The explicit representations of theare: two interfaces in our ex We assume that the interfaces’interior parametrizations regions are are such on th the left side asThe the connectivity parameters (ordering) incre of theimportant points information of about an the interface topology co (shape) of theIn int addition, a moving interfaceits can connectivity. change its topology and h Active contour: moving (dynamic) interface. • • • • • Implicit Functions alculus led plicit Level Sets Methods in Imaging Science – p.7/36 : is very difficult to and hyper-surfaces 3 2 ≥ R , n and its exterior open region n } R 0 < ) is the implicit representation of the 1 is straightforward: − 3 x, y, z 2 ( z ≥ φ | + 3 2 , n R y n ∈ R + explicit interfaces cannot handle easily interfaces ) 2 to x 2 . R 3 x, y, z )= ( { ≥ = . , n x, y, z − + ( n Introduction unit , the interface betweenΩ the inside open unit ball Ω For example, the zero isocontourφ of the implicit function R • in it is hard to parametrize arbitrary in the connectivity of hyper-surfaces in with holes and topological changes. Going from Topological changes and discontinuous interfacesnaturally, are there hand are no problemsinterfaces. with the connectivity of im Implicit functions make Boolean operations,operations geometry easy and to c apply and use. represent; hence • • • • • Limitations of the explicit representation of an interface Advantages of implicit interfaces: . ) 2 ,φ 1 φ . 1 Level Sets Methods in Imaging Science – p.8/36 φ is − = min( 2 = φ φ φ is 2 is and φ 1 1 φ φ and 1 φ are two implicit functions, then the 2 φ and 1 φ If of the interior region of . of the interior regions of ) 2 ,φ 1 of the interior regions of φ

Introduction = max( the union the intersection the complement φ • • • implicit representation of: Boolean operations: . ) 2 n ,φ R 1  | φ ∈ φ φ ) . n ∇ 1 Level Sets Methods in Imaging Science – p.8/36 |∇ φ  is − = min( ,..,x 2 2 = φ ∇· φ | φ φ , x φ is 1 = ∇ 2 x is |∇ and φ ~ 1 N 1 φ = =( φ ∇· and ~ N , ~x 1 = φ  n κ implicit function then: ∂φ ∂x are two implicit functions, then the 2 ,.., φ 2 ∂φ ∂x and , to the interface: 1 1 φ ∂φ ∂x If of the interior region of of the interface: .  smooth enough of the interior regions of ) 2 ,φ is a ) = 1 of the interior regions of ~x φ φ of the interface: ( If φ ∇

Introduction = max( the union the intersection the complement unit outward mean curvature φ • • • • • • implicit representation of: Boolean operations: Geometry: . ) 2 ,φ 1 φ . 1 Level Sets Methods in Imaging Science – p.8/36 φ . is − 0 = min( 2 = φ φ κ < φ is 2 is and φ 1 1 φ φ and 1 φ , and concave regions have are two implicit functions, then the 0 2 φ κ > and 1 φ If of the interior region of . of the interior regions of ) 2 Convex regions have ,φ 1 of the interior regions of φ

Introduction = max( the union the intersection the complement φ • • • implicit representation of: Boolean operations: Geometry: and, − Ω , it is easier ~x Level Sets Methods in Imaging Science – p.9/36 ) ) − + one-dimensional Ω Ω ∈ ∈ 0 0 i.e. ~x i.e. ~x ≤ 0( 0 0 0( φ φ> ≤ > ≤ > of the interior region if if ) ) ) ) + ~x ~x ~x ~x ( ( ( ( χ are: , , φ φ φ φ 0 1 + if if if if Ω and ( , , , , − 1 0 0 1 χ )= φ ( ( ( H )= )= ~x ~x ( ( + − χ χ are functions of a multidimensional variable ± χ

Introduction Heaviside function Characteristic functions Since to replace these characteristic functions with the respectively, exterior region and • • Calculus operations: . ) . + Ω | ) ) ~x ~x ( ( d~x, φ φ Level Sets Methods in Imaging Science – p.10/36 ∇ ))) d~x, : |∇ ~x · )) ~ ( N ~x ) φ ( are: ( ~x φ ( ( f H φ H − ∇ ) ) ~x φ and, respectively, ( ( )(1 ′ f ~x − the one-dimensional Dirac delta distribution ( n H ( Ω ) f R φ = Z n ( ′ | R ~ of a function H ) = N Z over | · ~x ) ( f ) = = ~x d~x )) φ φ ( ) ( ~x φ δ ~x ( d~x |∇ ( ) ) φ the directional derivative of the Heaviside |∇ + and ( ~x φ ) ( 2 χ ( | ′ φ H ) ) − ( ~x ~x ∇ H ( δ χ ( ) φ f ~x |∇ ( n = = f R ) = Z n ~x ) = ( R in the normal direction of the normal φ ~x Z ( ˆ δ · ∇ H ) ~x ( φ

Introduction ∇ Volume (area, length) integrals Dirac delta distribution: function since and representing the integrals of • • Calculus operations: e that ng d~x. | ) ~x regions is: ( be smooth. Level Sets Methods in Imaging Science – p.11/36 φ + δ Ω |∇ ) φ ( over the boundary δ ) f ~x ( f n and outside R Z − Ω = d~x of a function ) ~x ( ˆ δ ) and the Dirac distribution ~x ( H f n R Z = between the inside Ω fds ∂ Ω ∂ Z

Introduction Surface (line or point) integral By embedding the volume anddimensions, surface the integrals above in formulas higher avoidinside, the outside, need or for boundary identifyi regions,integration making easier. the numerical The numerical approximations of thethe above Heaviside integrals function requir (interface) • • • Calculus operations: 2 φ ǫ ǫ + 2 >ǫ ǫ ǫ |≤ | ǫ 1 π φ φ | | = |≤ ≤− if if φ ) | φ>ǫ φ Level Sets Methods in Imaging Science – p.12/36 φ , ( if if if ,ǫ  dφ , ∞ ǫ . πφ dH  δ  ǫ → πφ )= cos ,ǫ  φ ( ǫ 1 ∞ ,ǫ sin + , δ : ∞ ǫ 1 δ ,ǫ ǫ 1 ,δ 2 δ  + , 2 1 0 ǫ and φ  ǫ φ and H     1+ H =  H , , H ) 2 1 1 0 → φ ( ,ǫ arctan        ,ǫ ∞ 2 dφ 2 π )= dH , H φ ,ǫ ( 1+ 2 ,ǫ  )= H 2 φ 2 1 , H ( 0 regularization of ,ǫ regularization of 2 δ )= 2 ∞ →

Introduction φ ǫ C C ( ,ǫ • • Possible regularizations of As ∞ H • • Calculus operations: that : φ 3 almost R since r region, κ in . = 1 0 ~ } | Level Sets Methods in Imaging Science – p.13/36 : 6 = φ and 2 = 1 ~x |∇ ~ R ∀ N 2 has . z , 0 ~ in 1 ? φ + } 6 = = 1 2 |− ~x | y satisfy x ∀ = 1 | φ φ. φ , + 2 |∇ y 2 )= x = ∆ = 1 | + x 3 | ( 2 has φ φ R x | 1 : 2 φ, κ |∇ ∈ − R ) ∇ R 2 ∈ in a subset of the implicit functions z = has ) } 1 + ~ 1 N x, y, z 2 , ( − x, y 1 y { ( 2 { y + . {− 2 + x 6 = 0 2 x p x ∀ p , )= avoid using the above expressions for when using numerical approximations. )= = 1 | φ x, y x, y, z = 1 ( (

Introduction | 6 φ φ for the interface for the unit circle for the unit sphere |∇ φ • • • What is a good choice ofSigned an distance implicit functions: function Examples of signed Euclidean distance functions: All signed Euclidean distance functions However, are positive on the exteriorand region, zero negative on in the the interface. interio everywhere, so |∇ • • • • • Level Set Functions Level Sets Methods in Imaging Science – p.14/36 y y x x z z signed Euclidean distance b. Initial Surface d. Surface at time = 0) = exterior region; x,y, ( φ x Mountains x = interior region; y y a. Initial Circle c. Circle at time moving interface; Oceans

Introduction ) = 0 = interface; x, y, τ ( Motivational Example of the LevelSea Set Level Method in 2D: φ nce geometric ( Level Sets Methods in Imaging Science – p.14/36 the zero level ). the level set function signed distance function or instead of moving the red interface in 2D, we move the

Introduction It accepts as input anyheight point as in output. the plane and hands back its It is the collection of all points that are at height zero. . • • The surface on the rightactive is contour called The red cross-section through theset surface is called Basic idea: Mathematically, the level set methodinterface tracks as tbe the motion zero of level an function. set of the signed Euclidean dista surface (level set function) in 3D. • • • • Motivational Example of the Level Set Method in 2D: path Level Sets Methods in Imaging Science – p.15/36 = 0 : ) φ τ ( dτ τ ) = 0 d~x · , τ ~ ) V ) ) = 0 τ ( , τ , τ = ) ) ~x ( τ τ ) ( ( φ τ ~x ~x ( ( ( dτ · ∇ φ φ d~x ~ ∇ V + + ∂τ ∂φ ∂τ ∂φ given. 0) , (0) ~x ( is always zero: φ

Introduction ) τ ( The level set value of a particle moving on the interface with Differentiate the above with respect to If the particle velocity is known then: with ~x • • • (1) (2) Evolution Equation for the Level Set Function φ face. Level Sets Methods in Imaging Science – p.16/36 equation (2) or the : φ = 0 | φ . |∇ F + not dependent on the level set function used not only to represent the interface , then | is ~ V φ φ ∂τ ∂φ φ ∇ |∇ F = ~ N F = ~ V

Introduction only the physics of the problem of interest evloves the inter • but also to evolve the interface When The level set function The level set equation (evolution equation): Use equation (2) when thegenerated interface velocity is field moved by an externally equivalent equation (3). • • • • (3) Evolution Equation for the Level Set Function - ted φ Level Sets Methods in Imaging Science – p.17/36 φ : φ by interface elements as done by by the level set function tracked captured that depends directly on the level set function ~ V

Introduction both - the geometry and the physics of the problem of interest the interface is as opposed to being the local Lagrangian formulation (1). contribute to the evolution of the interface • • • Use equation (3) when thevelocity interface is field moved by a self-genera The level set equation (2)representation or of (3) the is interface the evolution global Eulerian • • Evolution Equation for the Level Set Function Level Sets Methods in Imaging Science – p.18/36 . Fried, 1995) , | : instabilities develop as the φ |∇ bκ = ∂τ ∂φ in 2D shrink to a single point and disappear. the problem is ill-posed 0 0 Shrinking sphere (right) and breaking dumbbell (left) (J.M b> b< a positive scalar. b

Introduction circles in 2D grow instead of shrink. The level set equation describing mean curvature flow is: When When with • • • (4) Example: Motion by mean curvature ible; as it stance Level Sets Methods in Imaging Science – p.19/36 , comes from = 0 | φ |∇ a + the entropy solution ∂τ ∂φ is a real valued scalar. some information about the solution is forever lost. a

Introduction is initially a signed distance function, it stays a signed di φ Once a corner has developed, the solution is no longer revers at all times The level set equation is: If This is not true in generalAn for interface arbitrary propagating velocity at fields! constantevolves. speed can form corners At corner points the interfacedifferentiable (level and set a function) weak is solution not must beThe correct constructed. weak solution, Sethian’s entropy condition: No point-wise correspondence! where • • • • • Example: Motion in the normal direction Level Sets Methods in Imaging Science – p.19/36 ght) brain. ) sue in the hydrocephalus condition. , 2005 et al. Drapaca Horizontal section of a normal (left) and hydrocephalic (ri

Introduction Note the large ventricles and severely compressed brain tis Application to hydrocephalus:( • Level Sets Methods in Imaging Science – p.19/36 ) , 2005 et al. nd 3 months after (right) shunt implantation Drapaca

Introduction Horizontal section of a hydrocephalic brain before (left) a Application to hydrocephalus:( • (centre) 1 − = a Level Sets Methods in Imaging Science – p.19/36 ) , 2005 et al. nd 3 months after (right) shunt implantation volution in time of the ventricular wall for Drapaca and one of the evolved (right)

Introduction Horizontal section of a hydrocephalic brain before (left) a Application to hydrocephalus:( • The pre-shunted ventricular CSF-tissue boundary (left), e Level Sets Methods in Imaging Science – p.19/36 ) , 2005 et al. nd 3 months after (right) shunt implantation Drapaca (original 3D surface (blue), evolved 3D surface (purple)) 1 − = a

Introduction Horizontal section of a hydrocephalic brain before (left) a A 3D ventricular surface shrinking with Application to hydrocephalus:( • ect on stays (right) 0 Level Sets Methods in Imaging Science – p.20/36 = 1 F ǫκ, ǫ> − = 1 F (left) and the entropy solution for κ 25 . 0 − = 1 F , this solution approaches the entropy solution 0 → ǫ Viscosity solution for

Introduction the interface. As obtained for the constant speed case. The constant speed acts ascurvature an dependent advection term term, has while a the diffusive, regularizing eff • • An interface propagating at a speed smooth during the evolution process. • Example: Propagation of a cosine curve ) Osher et al., 1999 & Level Sets Methods in Imaging Science – p.21/36 ) Merriman ) & Peng Osher, 2006 & Sethian, 1995 ) & Fedkiw & Losasso Adalsteinsson Lefohn et al., 2004

Introduction Narrow band algorithm ( PDE-based fast local level set methodGPU ( implementation ( Octree-based level sets ( • • • • No parameterization. Automatic handling of topology changes. Easy computation of geometric properties. Mathematical proofs and numerical stability. Easy to implement numerical schems. Computationally expensive Fixed uniform resolution • • • • • • • Advantages of the level set method: Challenges of the level set method: ) Fedkiw & ) Liao, 2003; Li et al., Level Sets Methods in Imaging Science – p.22/36 Fedkiw book, ch.9 & Min, 2004; Osher Faugeras, 2004 & ) ) Gomes Cline, 1987 & Sethian, 1999 & Lorensen Enright, Fedkiw et al., 2002; Osher Adalsteinsson ) )

Introduction Extension velocities ( Signed distance conservation model ( Marching cubes algorithm ( Particle level set method ( Local level set method for any codimension ( model open surfaces using two2006 level set functions ( book, ch.10 • • • • • • Need a periodic reinitialization Need a mesh extraction step Numerical diffusion Limited to codimension 1 Limited to closed surfaces • • • • • Challenges of the level set method: 006. one is not (normal Level Sets Methods in Imaging Science – p.23/36 F may depend on the geometry and the physics of the problem.

Introduction F Cannot handle interfacial data No point-wise correspondence • • • component of the velocity). Cannot track a region of interest on theProducing surface a suitable model for the speed function The information of the tangentialused component of the velocity No control on topology Pons et al., 2004, 2006tangential report velocities. progress on level sets with Work on level set methodsby with Han topological et constraints al., was 2003; d Alexandrov, Santosa, 2004; Pons et al., 2 • • • • • • Challenges of the level set method: ) imes it will drift Osher, 1994 φ & . Level Sets Methods in Imaging Science – p.24/36 , then its zero . = 1 t t | φ |∇ Merriman, Bence . | φ |∇ stays smooth enough such that its spatial φ occasionally to be a signed distance function will φ is a signed distance function if φ is not a signed distance function at a time φ

Introduction If The numerical scheme will stay stable ( isocontour will not be the evolved interface at • • As the interface evolves accordingaway to, from for its example, initialized (3), valuemay as lead signed to distance unbounded and values somet of Reinitializing also ensure that derivatives are computable. Recall that • • • Reinitialization equations: is the x . 2 ∆ ) ; x φ Level Sets Methods in Imaging Science – p.25/36 (∆ 2 | φ φ |∇ + 2 + − φ p Tourin, 1992) embedded the 1inΩ )= & − φ =1inΩ ( | = φ | ,S ) is reached. φ |∇ = 0 + : combination of the two equations in (5) of − |∇ 1) = 0 ∂τ ∂φ ∂τ ∂φ ∂τ ∂φ into a dynamic scheme and solve the |− φ |∇ = 1 | )( direction of the numerical grid. φ φ ( x |∇ S + has smoothing effects on the numerical solution ∂τ ∂φ

Introduction ) φ ( step in the the form: Peng et al., 1999 (following Rouy Reinitialization equation S constraint equations until the steday state ( • • • (5) (6) I. Reinitialization using the extension velocities model t ce. Level Sets Methods in Imaging Science – p.26/36 = 1 designed for problems in which the | φ |∇

Introduction the front crosses each forward (backward) grid point onlyit on is a very fast method (tree algorithms). • • The signed distance is the solution of the Eikonal equation: Use the fast marching method to solve (7). Fast marching method (FMM): change its sign). front is always moving forward or backward (the speed does no • • • (7) II. Reinitialization using the fast marching method nd . . Level Sets Methods in Imaging Science – p.26/36 Neighbors Accepted . . Accepted . must have the correct cost. Neighbors to this point that are not already Accepted Neighbors Neighbors for a network in which there is cost assigned to . . Remove it, and call it Add any new Find the cost of reaching all Accepted

Introduction • • • upwind difference operators to approximate thethe gradient, Dijkstra a idea of ashortest one-pass path algorithm on for a computing network. the Put the starting point inCall a the set grid called points whichNeighbors are one link away fromCompute the the Start cost of reachingThe each of smallest of these these Repeat the previous step until all points are • • • • • • • FMM uses: Dijkstra’s method entering each node: • • II. Reinitialization using the fast marching method Level Sets Methods in Imaging Science – p.26/36 rk (left), and shortest path shown in red (right).

Introduction Find the shortest path from Start to Finish in the given netwo II. Reinitialization using the fast marching method as e and . Trial ). A . If the Level Sets Methods in Imaging Science – p.26/36 value, add it to using only upwind φ φ Known first arrivals ( φ neighbours of . and add it to the set Trial that are not Known Far A . . at all the Far Trial φ point with the smallest Trial remove it from is a Far A builds the signed distance function all the neighbours of Trial and remove it from

Introduction . neighbour is in To solve (7), FMM caninside be the run interface. separately for grid pointsBasic outsid idea: Tag the points on the interface as Tag the points that areTrial one grid point away from theTag interface all the other points as Begin loop: If Tag as Recompute the values of Return to the top of the loop. according to equation (7). Known values starting with the smallest value of • • • • • • • • • II. Reinitialization using the fast marching method Algorithm for the fast marching method Level Sets Methods in Imaging Science – p.26/36 Update procedure for the fast marching method

Introduction Algorithm for the fast marching method φ and Level Sets Methods in Imaging Science – p.27/36 = 1 B | φ |∇ = 0 . , ; φ φ B ∇ ∂τ such that = 0 − ∂ · B B = is the signed distance | φ φ φ · ∇ ∂τ ∂φ ∇ φ |∇ ∇ B, ∇ )=0; ~x = ( φ  , we get:  for ∂τ ∂φ ,  ) ∂τ ∂φ ~x ∇ (  F ∇ = )= Faugeras, 2004 changed the level set equation (3) in ~x φ ( & ∇ ∂τ B ∂ is constant along the characteristics of

Introduction B satisfy: Gomes such a way that at each time instant The idea is to introduce a new function Differentiating the above last two equations: Since function. i.e. • • • • III. The signed distance conservation model e φ on (3), on nctions F . = on the zero )) Level Sets Methods in Imaging Science – p.28/36 ~x ~x B ( φ ∇ and ) . ~x φ ( φ − ))=0 ~x ( ~x ( F φ ∇ ) )= ~x ~y ( ( is the closest point to φ . B ) n − ~x ( R ~x φ ( )= ∈ ~x ∇ F ) also located on the characteristic of ( ) ~x ~x ∀ B + ( , φ ) ) = 0 ∂τ ~x ∂φ ~y − ( ( φ ~x φ ( ∇ = λ φ ~y . − is constant on the characteristics of ~x ~x B , it follows that

Introduction )= λ = 0 ( level set of Arnold, 1983 proved that theare characteristics straight of lines distance of fu (nonunique)f equation The point Since The new level set equationfunction that during conserves the the evolution signed process distanc is: By using equation (8) insteadno of reinitialization the is classic needed. level set equati through φ • • • • • (8) III. The signed distance conservation model ) of the f the Level Sets Methods in Imaging Science – p.29/36 d out very thin before the flow time reverses returning the circle to its original form. , φ

Introduction the point-wise correspondence is lost cannot handle interfacial data restricts the range of possible applications but it affects point correspondencesinterfacial and data the (contains evolution information of about the physics o problem) • • • • Level set methods convey a purely geometric description Tangential velocities have no effect onlevel set the funciton shape (geometry • • Enright test: a circle is entrained by vortices and stretche Level sets with a point correspondence (LSPC) he . Level Sets Methods in Imaging Science – p.30/36 ψ . = 0  ~v ψ J pointing to the initial + = 0 = 0 is given by: ψ 0 ∂τ f ∂ψ ~v φ is the Jacobian of ψ  = J ψ ) · ∇ 0 f J + ~v f ∇ + ∂τ ∂ψ =( ∂τ ∂φ given. f 0) · ∇ ~x, ( ~v ψ + advect the point coordinates with the same speed as and ∂τ ∂f 0) are the steady-state solutions of: ~x, ψ ( φ is a function of interfacial data (related to the physics of t

Introduction 0 and f problem) then the evolution of Basic idea: Introduce a correspondence function φ If interface the level set function with • • • • Level sets with a point correspondence (LSPC) Level Sets Methods in Imaging Science – p.31/36 ntre) interface, point correspondence (right). )

Introduction A rotating and shrinking circle: initial (left) and final (ce Pons et al., 2004, 2006 Level sets with a point( correspondence (LSPC): Examples Level Sets Methods in Imaging Science – p.32/36 e. ving tangential velocity. Expanding (left column) and shrinking (right column) squar 2D evolutions with (bottom) and without (top) an area preser

Introduction Level sets with a point correspondence (LSPC): Examples operties of Level Sets Methods in Imaging Science – p.32/36 ithout (centre) an area preserving tangential velocity.

Introduction the cortex. Cortex unfolding to a simplifiedvisualization geometry and allows analysis for of easier functional and structural pr • 3D unfolding of a cortex with a tumor (left) with (right) and w Level sets with a point correspondence (LSPC): Examples Level Sets Methods in Imaging Science – p.33/36 depends only on F . φ · ∇ when ) = 0 | = 0 ) = 0 | φ φ φ φ x τ ~x, ( |∇ ∇ · ∇ |∇ ~ F V F ~ V x τ, ~x, + + )= )= ( φ φ a hyperbolic PDE of the form H ∂τ ∂φ ∇ ∇ ∂τ ∂φ + x τ, ~x, x τ, ~x, ∂τ ∂φ ( ( H H . φ ∇ and/or

Introduction Hamilton-Jacobi equation: The level set equation (2): The level set equation (3): is of form (9) with is of form (9) with x τ ~x, • • • (9) Remarks on the type of PDEs . φ Level Sets Methods in Imaging Science – p.34/36 and thus is not a | φ φ depends on |∇ F ) = 0  φ | φ φ ∇ φ ∇ |∇ −  ~x ( ∇· F b + = ∂τ ∂φ ∂τ ∂φ Faugeras equation (8): &

Introduction This is a parabolic equation. • Gomes The equation of the motion by mean curvature (4): is not a Hamilton-Jacobi equation since contains second order spatial derivatives of Hamilton-Jacobi equation. • • Remarks on the type of PDEs adius) Level Sets Methods in Imaging Science – p.35/36 . n . τ τ = τ + ∆ at n τ ; φ 2 . = | φ τ ; |∇ 2) F / ./yradius (1 2 or ; φ 2) / · ∇ (1 ~ V +(y-y0). 2 ./xradius 2 using equation (2) or (3) for φ

Introduction end; else signeddistance=-(dist2-1). if (1-dist2 >= 0) signeddistance=(1-dist2). dist2=(x-x0). Initialize/reinitialize the level set function Construct/approximate Evolve function signeddistance = ellipse(x,y,x0,y0,xradius,yr • • • • General level set algorithm Example of Matlab code eltat) Level Sets Methods in Imaging Science – p.36/36 deltax); deltay); ; ⋆ ⋆ 2) / mag; (1 ). ⋆ 2 deltat. +Iypm. ⋆ 2

Introduction d=data; function d = lsm-normaldir-2d(data, a, T, deltax,Ny=size(data,1); deltay, d Nx=size(data,2); syminus=cat(1,data(1,:),data(1:Ny-1,:)); syplus=cat(1,data(2:Ny,:),data(Ny,:)); sxminus=cat(2,data(:,1),data(:,1:Nx-1)); sxplus=cat(2,data(:,2:Nx),data(:,Nx)); Ixminus=(sxminus-data)./deltax; Ixplus=(sxplus-data)./deltax; Iyminus=(syminus-data)./deltay; Iyplus=(syplus-data)./deltay; Ixpm=(sxplus-sxminus)./(2 Iypm=(syplus-syminus)./(2 mag=(Ixpm. data=data-a. • Example of Matlab code Level Sets Methods in Imaging Science – p.36/36 a,T,dx,dy,dt);

Introduction M-file test-lsm-normaldir-2d m=zeros(64,64); for i=1:64 for j=1:64 m(i,j)=ellipse(i,j,32,32,30,30); end; end; a=2; dx=1; dy=1; dt=1;T=10; contour(m,[0,0],’b’); hold on; [Nx,Ny]=size(m); mevolved=zeros(Nx,Ny,T+1); for i=1:T mevolved(:,:,i+1)=lsm-normaldir-2d(mevolved(:,:,i), contour(mevolved(:,:,i+1),[0,0],’g’); hold on; end; contour(mevolved(:,:,T+1),[0,0],’r’); • Example of Matlab code Level Sets Methods in Imaging Science – p.36/36

60 50 r 10 time steps. The last contour is red. 40 30 20 10

60 50 40 30 20 10

Introduction Evolution of a initial ellipse (blue) with constant speed fo Example of Matlab code