1 function Eextern = ExternalForceImage3D(I,Wline, Wedge,Sigma)
\r
2 % Eextern = ExternalForceImage3D(I,Wline, Wedge,Sigma)
\r
6 % Sigma : Sigma used to calculated image derivatives
\r
7 % Wline : Attraction to lines, if negative to black lines otherwise white
\r
9 % Wterm : Attraction to terminations of lines (end points) and corners
\r
12 % Eextern : The energy function described by the image
\r
14 % Function is written by D.Kroon University of Twente (July 2010)
\r
16 Ix=ImageDerivatives3D(I,Sigma,'x');
\r
17 Iy=ImageDerivatives3D(I,Sigma,'y');
\r
18 Iz=ImageDerivatives3D(I,Sigma,'z');
\r
20 Eline = imgaussian(I,Sigma);
\r
21 Eedge = sqrt(Ix.^2 + Iy.^2 + Iz.^2);
\r
23 Eextern= (Wline*Eline - Wedge*Eedge);
\r