Lecture 4 Merged
Lecture 4 Merged
• Medical image analysis involves complex objects and complex data • Model = parameterized computer representation of the appearance of the object
• Object segmentation is a pre-requisite for quantification of interest in the image based on prior knowledge
• Available prior knowledge is application dependent:
• Low-level segmentation strategies are too simplistic to deal with image ambiguity
– Geometry: position, shape, motion, deformation
• Incorporate prior knowledge about the object’s appearance in the image
– Photometry: intensity, contrast, texture
– Context: relations to other objects in the scene
• Modeling strategies:
– Heuristic: model imposes generic assumptions, e.g. boundary is smooth and
coincides with image edges
– Statistical: model is object specific and learned from the data itself
– Biomechanical: model mimics physical properties of the object tissue
• Models in medical image analysis should be able to cope with natural variability of
anatomical objects, hence need to be parameterized and adjustable (‘deformable’)
to the image at hand
• General model fitting strategy: • Object has a fixed shape but unknown pose in the image (i.e. unknown position
• Define the model M(p) with parameters p (e.g. a 2D curve or 3D surface with points p) and orientation)
• Design an objective function C (‘cost function’) to measure “goodness of fit” • Model parameters p = pose parameters (in 2D: 2 translations + rotation)
between the image I and the model instance M(p) for any parameters p
• Find the optimal model M(p*) such that p* = arg min C(M(p),I) • General shapes: “template matching”
• For simple parametric shapes (lines, circles, …): “Hough transform”
• C typically will consist of 2 terms: C = ‘image data term’ + w . ‘model term’ • Applications of rigid models are limited in medical image analysis, due to
• First term: attracts the model to ‘deform’ towards suitable image features (that anatomical variability
are assigned low cost by the image data term)
• Second term: imposes suitable constraints on the model, by penalizing undesired
model ‘deformations’ (that are assigned high cost by the model term)
• w = weight parameter that balances both terms, to be set heuristically
• Depict the shape as a template: • For simple parametric shapes (lines, circles, …)
è e.g. a graph, binary image (drawing), gray value image • Example: detecting lines in an image
• Cost function: • Line through (x,y): x cos q + y sin q = r
e.g. integrated gradient magnitude along shape boundary • ‘Cost’ function H(q,r) = accumulator matrix of contributions of all image
e.g. correlation of template intensity with image intensity points (x,y), after discretization of the parameter space (q,r):
• Find globally optimal pose p* by exhaustive search "xi,yi: add w(xi,yi) to H(qj,rj), "qj,rj = xi cos qj + yi sin qj
èafter suitable quantization of the search space – Lines in binary images: w(xj,yj) = 1 if I(xj,yj) = 1
èsearch space delimited based on prior knowledge – Linear edges in gray scale images: w(xj,yj) = |ÑI(xj,yj)|
• Local search strategies may be applicable as well, if properly initialized • Hence: all points (x,y) that are on the same line (qj,rj) contribute to the
è Especially for larger templates (larger attraction basin around local corresponding bin in H
optimum expected) • Lines (q,r) are detected as maxima in H(q,r)
è Cfr rigid-body / affine image registration
• For a continuous curve, tangent and normal direction and curvature can be
computed analytically and exactly: C (t ) = [x(t ) y(t )], t Î [0,1]
Tangent : [x' (t ) / L(t ) y ' (t ) / L(t )] , L(t ) = ( x' ) 2 + ( y ' ) 2
Normal : [ y ' (t ) / L(t ) - x' (t ) / L(t )]
x' (t ).y ' ' (t ) - x' ' (t ).y ' (t )
Curvature : k =
(( x' ) 2
+ ( y' )2 )
3/ 2
• Consider a parametric curve/surface C(p) with parameters p • Object boundary is a connected path of pixels (= implicit geometry)
è for a discrete curve: p = the coordinates of the curve points
• Start pixel (S) and end pixel (E) on the boundary are given
• Define an objective function E (= ‘energy function’) that can be evaluated • Find optimal path P* between S and E, i.e. the path from S to E that ‘best’
for each curve C(p), containing 2 terms: fits the object boundary
• No global shape constraints imposed, only connectivity constraint
E(C(p))= Eext(C(p),I) + g . Eint(C(p))
Eext = external energy: drives C towards relevant features in image I, e.g. edges
Eint = internal energy: imposes shape constraints on C, e.g. smoothness S S
g = weight, tuning the relative importance of both terms
E E P*
• Find the curve C(p*) such that E(C(p*)) is minimal (= ‘energy minimization’)
S
• Example: C(P(S,E)) = 5+6+5+9+4+2+2+3+1+1 = 38
• Problem: how to find the path P*(S,E) with minimal cost C*(S,E)?
E P* • Idea: "q Î P* : P*(S,E) = P*(S,q) È P*(q,E), C*(S,E) = C*(S,q) + C*(q,E)
• Hence: can ignore all ‘non-optimal’ paths P(S,q)
• Build solution incrementally by computing C*(S,q), "q in a region of interest
around pixel S, including pixel E
è ‘Accumulated cost’ matrix
Original image Gradient magnitude Cost image
F* algorithm F* algorithm: initialization
Cost image (C) Accumulated cost (AC) Cost image (C) Accumulated cost (AC)
S
• Update AC in each pixel from the AC • Update AC in each pixel from the AC
values of its 8-connected neighbors and values of its 8-connected neighbors and
the cost C of this pixel, scanning the the cost C of this pixel, scanning the
image in forward direction image in backward direction
• Example: • Example:
27 = min(Inf, 27+2, 32+2, 37+2, 25+2) 30 = min(31, 34+2, 41+2, 37+2, 28+2)
Cost image (C) Accumulated cost (AC) Cost image Accumulated cost image
S (computed in region of interest only)
• Minimal cost path from S to any pixel E can be extracted from AC as the path
of largest cost decrease (‘steepest descent’) starting from E E
Interactive indication of boundary points, real-time path tracking Interactive indication of boundary points, real-time path tracking
Candidates
Resampled cost image
Mortensen & Barrett, Centerline Result
GMIP, 1998
Nuyts et al.
IEEE TMI, 1991
èSmoothness constraint
èResistance against stretching (1st derivative) and bending (2nd derivative)
Mathews Jacob, EPFL èWeights a(s), b(s), often chosen as constants a, b
• External energy P, depends on both the curve X and the image data I
• Line integral along the curve of a potential function P: • Minimization of the functional E(X) is a variational problem
• Solution X should satisfy the Euler-Lagrange equation (see calculus of
variations):
lines:
• Treat X(s) as a function of time X(s,t) • Alternatively: energy function E(C(p)) minimized directly by gradient descent
• Let X evolve (‘deform’) according to the forces acting on it: • For each curve parameter pi, compute DEi = E(C(p+dpi))-E(C(p)), i.e. the
change in the energy function when increasing curve parameter pi by some
small amount dpi>0 (= numerical approximation of the derivative)
(or: derive analytical expressions for the gradient)
• Update each pi iteratively by setting pi(k+1) = pi(k) – e.DEi(k)
(g = time step parameter)
e>0 = step size parameter
è ‘snake like’ behavior k = iteration number dp
• At equilibrium: if DEi > 0, decrease pi to decrease E
X(s,t) stabilizes è left hand side = 0 è X is solution of Euler-Lagrange eqn. if DEi < 0, increase pi to decrease E
• Provide initial X(s,0), e.g. by rough manual delineation • Well suited for parametric curves with limited
number of parameters (e.g. splines) E(C(p+dpi))
• E(C(p)) can also be optimized using non-gradient
optimization methods (è likely slower…) E(C(p))
• Gradient descent converges to a local optimum • In the original ‘snakes’ approach (Kass et al., 1997), the curve fitting is
formulated as an energy minimization problem and the external forces
• Re-formulate the curve fitting as graph search problem and use dynamic
acting on the curve are derived as the derivative of the energy (=potential
programming to guarantee finding the globally optimal solution forces)
• Requires discretisation of the solution domain, i.e. each curve point vi is a • Generalization:
pixel, each point can move to pixel locations only and at each stage only a
limited number (m) of candidate positions is considered
Original
snake
Fs
GVF
Xu and Prince,
1998
GVF snake: example Numerical implementation
• Curve discretization:
• Matrix notation:
• Matrix inversion:
Deformable models with implicit geometry Curve evolution using level sets
• Original energy-minimizing ‘snakes’ formulation uses an explicit geometric • Snake evolution equation:
parameterization of the shape (curve or surface)
• Alternatively: embed the curve / surface as a level set in a higher • Only the force component normal to the shape is in fact relevant for curve
dimensional surface, and deform the curve as desired by manipulating this evolution (the tangential component only affects the parameterization):
surface directly (‘Eulerian’ instead of ‘Lagrangian’ formulation)
• Advantage: V = speed function
N = inward normal of the curve
– numerically more stable (no explicit parameterization needed) k = curvature
– can handle changes in curve topology
• Examples:
– V(k) = a.k: curvature deformation, akin to snakes’ internal energy
– V(k) = V0: constant deformation, akin to snakes’ balloon force
• Idea: let speed function V depend on image features such that curve
evolution stops at object boundaries
è implemented using the implicit level set representation
Level set framework Example
G. Peyré
t
• ‘Geodesic snakes’ (Massadi 1995, Caselles 1993) • ‘Active contours without edges’ (Chan-Vese, 2001)
è region-based instead of edge based: f evolves such
as to make the regions inside and outside its
zero-level set ‘homogeneous’
è Mumford-Shah functional:
(length penalty)
(area penalty)
(intensity inside should be c1)
è Curve evolution is slowed down at image edges, but not pull-backed
è May leak trough boundary gaps (intensity outside should be c2)
• Finite difference approximation of the level set evolution equation • Topologically adaptable: f remains well behaved, while its zero-level set
• Image-based speed function is defined (in a meaningful way) only for the can change topology, breka, merge, form sharp corners, …
zero-level set (i.e. for f(x,y,t) = 0) • f is evaluated on a fixed grid è can use finite difference approximations
è need to extent this to the whole image domain (i.e. all other level sets) for spatial and temporal derivatives è numerically stable solutions
in order to compute the evolution of f over the entire domain • Intrinsic geometric properties of the embedded curve can be derived
è alternatively: narrow-band approximation: update f only in a narrow directly from the level set function f (e.g. curvature)
band around its current zero-level set (using the original speed function) • Easily extendable from 2D to 3D, as no explicit parameterization is
required
• Requires suitable speed function (many variants, see some examples
above), sometimes derived by energy minimization, but not necessarily so
• Application dependent parameter tuning…