[Insight-users] is it limitation in itkMRFImageFilter class?
Luis Ibanez
luis.ibanez at kitware.com
Tue Mar 31 20:26:14 EDT 2009
Hi Baoyun,
There is an important difference between:
A) Density functions, and
B) Distance functions
in particular,
Typically density functions decrease in value as you move away from the origin,
(or wherever they are centered), while distance functions increase when you
move away.
You seem to be confusing the use of a GaussianDensityFunction, with the
one of a MahalanobisDistance.
That is:
1) Gaussian exp( - ( x / sigma )^2 )
2) Mahalanobis distance = sqrt( X . E . X^t )
where E is the covariance matrix of the distribution
and X is an N-dimensional array with coordinates in this space.
You may want to take a look at:
* http://en.wikipedia.org/wiki/Normal_distribution
* http://en.wikipedia.org/wiki/Mahalanobis_distance
In multivariate statistics it will be common to express a
Gaussian density function as:
exp( - mahalanobisDistance ^ 2 )
BTW: If you are planning on making a serious use of
the ITK statistics framework, you may want to look
at the refactored version described in:
http://www.itk.org/Wiki/Proposals:Refactoring_Statistics_Framework_2007
Regards,
Luis
----------------------------------------
On Wed, Mar 25, 2009 at 4:01 PM, Baoyun Li <baoyun_li123 at yahoo.com> wrote:
> Dear Luis and All:
>
> I am woring on EM and MRF for image segmentation. I made the EM clustering
> working, and then using the segmenation result to perfrom MRF for refinment.
>
> I followed the styles in ITK example ScalarImageMarkovRandomField1.cxx .
>
> If I use the DistancCentroid as membershim function of the classifier, I can
> get the segmetation improved after MRF filter.
>
> Since I using EM GaussianMixture model to intial segmentation, I think using
> itkGaussianDensityFunction as membership function of classifier may give
> better result.
>
> When I changed the membership function, the result is totally wrong, then I
> checked the code for itkMRFImageFilter..cxx, I figure out why.
>
> //////////////////////////////////////////////////////////////////////////////////
>
> 00625 const std::vector<double> & pixelMembershipValue =
> 00626 m_ClassifierPtr->GetPixelMembershipValue( *inputPixelVec );
> 00648 //Add the prior probability to the pixel probability
> 00649 for( index = 0; index < m_NumberOfClasses; index++ )
> 00650 {
> 00651 m_MahalanobisDistance[index] = m_NeighborInfluence[index] -
> 00652 pixelMembershipValue[index] ;
> 00653 }
> ////////////////////////////////////////////////////////////////////////////////
>
> In line 651, when calculating the MahaanoistDistance,
> m_MahalanobisDistance[index] = m_NeighborInfluence[index] -
> pixelMembershipValue[index] ;
> assuming my weight are all zeros, then class with maximum pdf will give the
> lowest Distance. As a result, the segmentation is fully wrong.
>
> My question is why the filter was designed in the way, is MRFImageFilter not
> designed to apply GassianDensityFuncion as membershipfunction.
>
> Can I still use GaussianDensityFunction in this case? Would if work if I
> change the sign of code 651 to +?
>
> Please give me some guide.
>
> Baoyun
>
>
More information about the Insight-users
mailing list