i3dlib

Documentation

PDE based image segmentation methods


Classes

class  i3d::KMeansLS< VOXELIN, VOXELOUT >
 This class implements simple the Kmeans segmentation algorithm for two means. Documentation TBA. More...
class  i3d::ThresholdActiveContours< VOXELIN, VOXELOUT >
 This class implements the threshold dynamics approximation of the Chan-Vese functional. Documentation TBA. More...

Typedefs

typedef std::vector< i3d::Vector3d<
size_t > > 
i3d::SeedPointsVector

Functions

template<class VOXELIN, class VOXELOUT>
void i3d::SpeedFunctionStandard (Image3d< VOXELIN > &ImgIn, Image3d< VOXELOUT > &SpeedImg, double sigmax=1.2, double sigmay=1.2, double sigmaz=1.2, double width=1.5)
 Computes the speed of the moving interface on whole input image.
template<class VOXELIN, class VOXELOUT>
void i3d::SpeedFunctionExponential (Image3d< VOXELIN > &ImgIn, Image3d< VOXELOUT > &SpeedImg, double sigmax=1.0, double sigmay=1.0, double sigmaz=1.0, double width=1.5, double alpha=0.02)
 Computes the speed of the moving interface on whole input image.
template<class VOXELIN, class VOXELOUT>
void i3d::FastMarchingMethod (i3d::Image3d< VOXELIN > &SpeedImg, i3d::Image3d< VOXELOUT > &ImgOut, SeedPointsVector &SeedPoints)
 This function computes Fast Marching method, which can be used for image segmentation.
template<class VOXEL>
void i3d::FindContourLevel (Image3d< VOXEL > &Img, VOXEL &value, size_t Start=3, VOXEL Threshold=2.0, size_t Bins=100, size_t Step=1, double Sigma=1.0, double Radius=3.0)
 Computes the right arrival time of the moving contour. This value should correct separate the image to interior and exterior region.
template<class VOXELIN, class VOXELOUT>
void i3d::GeodesicDistance (Image3d< VOXELIN > &ImgIn, Image3d< VOXELOUT > &ImgOut, SeedPointsVector &SeedPoints)
 This function computes shortest Geodesic Distances in the mask object from seed points.
template<class VOXELIN, class VOXELOUT>
void i3d::LocalRadius (Image3d< VOXELIN > &ImgIn, Image3d< VOXELOUT > &ImgOut, SeedPointsVector &SeedPoints)
 This function computes Local Radius of the pixels in the mask object from seed point.

Typedef Documentation

typedef std::vector< i3d::Vector3d<size_t> > i3d::SeedPointsVector

in this vector type are stored Vector3d points, which can be used as the


Function Documentation

template<class VOXELIN, class VOXELOUT>
I3D_DLLEXPORT void i3d::FastMarchingMethod ( i3d::Image3d< VOXELIN > &  SpeedImg,
i3d::Image3d< VOXELOUT > &  ImgOut,
SeedPointsVector &  SeedPoints 
)

This function computes Fast Marching method, which can be used for image segmentation.

The Fast marching solves following eikonal equation

\[ F|\nabla T| = 1, \]

where F is the speed function of the interface, T is the time of arrival of the moving interface and $ \{ (x,y,z) | T(x,y,z) = 0\}$ is the initial interface. This equation describes evolving of such interface in time.

The input parameters of the method are:

  • i3d::Image3d<VOXELIN>& SpeedImg - typically float 2D or 3D image (the SpeedImg is computed from input GRAY8 image by function i3d::SpeedFunctionStandard defined above), which is then used to compute arrival times of the wave in Fast Marching method. This image should not be empty.
  • SeedPointsVector& SeedPoints - reference to std::vector of i3d::Vector3d type in which are saved the seeds for the fast marching method (the starting points of the wave). The should be at least one seed in the vector.
  • i3d::Image3d<VOXELOUT>& ImgOut - the only output parameter is reference to ImgOut (for now the VOXELOUT template can be float only). In this image are saved the arrival times of the wave (evolving boundary) computed by Fast Marching method from the input parameters.
The implementation of this function is based on chapter 8 from the book
J. A. Sethian, Level Set Methods and Fast Marching Methods , Cambridge University Press 1999.

Author:
Jan Hubený xhubeny@fi.muni.cz
Date:
2005

template<class VOXEL>
I3D_DLLEXPORT void i3d::FindContourLevel ( Image3d< VOXEL > &  Img,
VOXEL &  value,
size_t  Start = 3,
VOXEL  Threshold = 2.0,
size_t  Bins = 100,
size_t  Step = 1,
double  Sigma = 1.0,
double  Radius = 3.0 
)

Computes the right arrival time of the moving contour. This value should correct separate the image to interior and exterior region.

This function compute the value of the time on which lies the assumed iso contour line. I.E. when is the fast marching method used to segmentation of 2D image, this function returns in the value parameter the value of the time on which lies the boundary between the interior (the goal of segmentation) and exterior (the rest of the image).

For the user, who is not deep informated about FM method, there are only 2 parameters:

  • Image3d<VOXEL>& Img - input image (this should be the output of i3d::FastMarchingMethod -- Arrival times) Img.
  • VOXEL& value - variable, in which is saved the result.
Advanced user can modify the other implicit parameters. The brief description of the computing procedure follows.
1) First we make a histogram from the input arrival times image.
This histogram has the size_t Bins number of bins and the step between bins is equal to size_t Step. i.e. when we have the arrival times image Img with values between 0-577.8 the implicit parameters of the procedure Bins = 100 Step = 1, denotes that we compute histogram with 100 bins with step equal to one, so only the values between 0 - 99 from the input image are saved in the histogram (for details see histogram.cc) 2) We smooth this histogram with 1D standard gaussian filter. with parameters Sigma and Radius.
3) We compute the finite diference aproximation of second derivation of the smoothed histogram. the kernel of the derivation operator is 1 -2 1 (central diference operator)
4) we want to find the values of this second derivation which is close to zero (This means that the boundary of FM method stops for a while)
so we go sequentially from the size_t Start bin of the histogram until we find a bin, in which the abs value of the second derivation is lower than VOXEL Threshold.

The implementation of this function is based on article
P. Matula, J. Hubený, M. Kozubek Fast Marching 3D Reconstruction of Interphase Chromosomes , CVAMIA-MMBIA 2004, LNCS 3117.

Author:
Jan Hubený xhubeny@fi.muni.cz
Date:
2005

template<class VOXELIN, class VOXELOUT>
I3D_DLLEXPORT void i3d::GeodesicDistance ( Image3d< VOXELIN > &  ImgIn,
Image3d< VOXELOUT > &  ImgOut,
SeedPointsVector &  SeedPoints 
)

This function computes shortest Geodesic Distances in the mask object from seed points.

Let A be a set which is first supposed to be connected. The geodesic distance $ d_A(p,q) $ between two pixels (voxels) $ p $ and $ q $ in A is the minimum of the length L of the path(s) $ P=(p_1,p_2,\dots,p_l) $ joining $ p $ and $ q $ and included in A :

\[ d_A(p,q) = \min \{\mathbf{L}(P) | p_1 = p, p_l = q, P \subseteq A\}. \]

This function computes such defined Geodesic Distance for the pixels in mask object from seed points. The mask object is the first parameter ImgIn. The Geodesic Distance is saved in the output image ImgOut. The seed points are given as input in the first parameter SeedPoints.

Author:
Jan Hubený xhubeny@fi.muni.cz
Date:
2005

template<class VOXELIN, class VOXELOUT>
I3D_DLLEXPORT void i3d::LocalRadius ( Image3d< VOXELIN > &  ImgIn,
Image3d< VOXELOUT > &  ImgOut,
SeedPointsVector &  SeedPoints 
)

This function computes Local Radius of the pixels in the mask object from seed point.

Definition of Local Radius:
Let A be a set which is first supposed to be connected. The local radius $ r_l(p,q) $ between two pixels (voxels) $p $ and $ q$ in A , where $ p $ is the given center is defined as the ratio of Geodesic Distance $ d_A(p,q) $ and sum of Geodesic Distance $ d_A(p,q) $ and the Geodesic distance of point $ q $ to the object boundary ($ d_A(q,boundary)$) multiplied by 100 to get the percents..

\[ r_l(p,q) = \frac{ d_A(p,q) }{ d_A(p,q) + d_A(q,boundary)} \cdot 100 \]

This function computes such defined Local Radius for the pixels in mask object from seed points. The mask object is the first parameter ImgIn. The Local Radius is saved in the output image ImgOut. The seed points are given as input in the first parameter SeedPoints.

Author:
Jan Hubený xhubeny@fi.muni.cz
Date:
2005

template<class VOXELIN, class VOXELOUT>
void i3d::SpeedFunctionExponential ( Image3d< VOXELIN > &  ImgIn,
Image3d< VOXELOUT > &  SpeedImg,
double  sigmax = 1.0,
double  sigmay = 1.0,
double  sigmaz = 1.0,
double  width = 1.5,
double  alpha = 0.02 
)

Computes the speed of the moving interface on whole input image.

This function computes the standard Speed function

\[ F = e^{-\alpha (|G_{\sigma}I|)} \]

which is used to as a driving force to deform the moving boundary with Fast Marching or Level Set methods. The values of the speed are in the <0,1> interval. The greater the gradient is the slower the moving of the interface is.

The parameters are:

  • Image3d<VOXELIN>& ImgIn - reference to input image from which is the Speed computed.
  • Image3d<VOXELOUT>& SpeedImg - reference to output image. In this image is the computed speed saved.
  • double sigmax, sigmay, sigmaz, width - parameters of the gaussian filter.
  • double alpha the steepness of stopping. Default value is 0.02. Meaningfull values are between 0.001 and 0.06.
This Function should be used in collaboration with i3d::FastMarchingMethod function. df2.gif "Speed of the interface is dependent on the gradient magnitude"

The implementation of this function is based on chapter 8 from the book
J. A. Sethian, Level Set Methods and Fast Marching Methods , Cambridge University Press 1999.

Author:
Jan Hubený xhubeny@fi.muni.cz
Date:
2005

template<class VOXELIN, class VOXELOUT>
I3D_DLLEXPORT void i3d::SpeedFunctionStandard ( Image3d< VOXELIN > &  ImgIn,
Image3d< VOXELOUT > &  SpeedImg,
double  sigmax = 1.2,
double  sigmay = 1.2,
double  sigmaz = 1.2,
double  width = 1.5 
)

Computes the speed of the moving interface on whole input image.

This function computes the standard Speed function

\[ F = \frac{1}{1 + |\nabla G_{\sigma} I | } \]

which is used to as a driving force to deform the moving boundary with Fast Marching or Level Set methods. The values of the speed are in the <0,1> interval. The greater the gradient is the slower the moving of the interface is.

The parameters are:

  • Image3d<VOXELIN>& ImgIn - reference to input image from which is the Speed computed.
  • Image3d<VOXELOUT>& SpeedImg - reference to output image. In this image is the computed speed saved.
  • double sigmax, sigmay, sigmaz, width - parameters of the gaussian filter.
This Function should be used in collaboration with i3d::FastMarchingMethod function. df1.gif "Speed of the interface is dependent on the gradient magnitude"

The implementation of this function is based on chapter 8 from the book
J. A. Sethian, Level Set Methods and Fast Marching Methods , Cambridge University Press 1999.

Author:
Jan Hubený xhubeny@fi.muni.cz
Date:
2005