[Insight-developers] Classifier woes

Miller, James V (Research) millerjv at crd.ge.com
Fri Oct 21 13:02:59 EDT 2005


It seems like ImageClassifierBase with a MaxRatioDecisionRule
would be more efficient than the Bayesian filter in the sandbox.

If I understand the code in the sandbox (I just looked briefly at it),
it generates a posteriorPixel image which holds for posterior probabilities
of each pixel for every class.  Then the decision rule is applied 
to this vector image.

ImageClassifierBase runs through each pixel, calculates a vector of 
probabilities for the pixel, and applies the decision rule, then moves
onto the next pixel.  So no vector image of posterior probabilities is 
needed.

The handling of the priors is also not quite what I want.  The
MaxRatioDecisionRule allows the for a single prior per class
to be specified.

Jim


-----Original Message-----
From: Karthik Krishnan [mailto:Karthik.Krishnan at kitware.com]
Sent: Friday, October 21, 2005 12:48 PM
To: Miller, James V (Research)
Cc: Insight-developers (E-mail); John Melonakos
Subject: Re: [Insight-developers] Classifier woes



Miller, James V (Research) wrote:

> I was just experimenting with some pixel classifiers in ITK.
>
> I had a program that I had written a few years ago that built up a 
> decision rule and set it on an ImageClassifierBase and passed that 
> ImageClassifierBase to the MRF filter.  This works fine.
>
> Now I just wanted to run a pixel classifier without running the MRF 
> filter.  So I was looking for a filter that would just run through all
>
> the pixels in an image and apply a decision rule to each pixel.
>
> The first filter I found was BayesianClassifierImageFilter.  This 
> sounded perfect.  However, this filter assumes the membership 
> functions are Gaussian and has no means to set a prior.  The filter 
> takes membership functions as opposed to a decision rule.  Most 
> troubling, however, is that this filter doesn't actuall do anything.  
> The GenerateData() method simply iterates over the input pixels.  It 
> doesn't evaluate anything or set any output pixels.
>
The BayesianClassifierImageFilter was a premature addition to the 
toolkit... The actual class itself is in the NAMIC sandbox. and does 
pretty much what you want.

http://www.na-mic.org:8000/websvn/filedetails.php?repname=NAMICSandBox&path=%2FBayesianSegmentationModule%2FitkBayesianClassifierImageFilter.txx&rev=0&sc=0
http://www.na-mic.org:8000/websvn/filedetails.php?repname=NAMICSandBox&path=%2FBayesianSegmentationModule%2FitkBayesianClassifierImageFilter.h&rev=0&sc=0

It allows you to set your own membership functions (they are not 
restricted to be Gaussian).
The class assumes a prior image with a uniform distribution, but again 
this is not a requirement. I think John's intention is to allow you to 
specify a prior image, with the default being a uniform one.
The membership functions using information from the prior generate the 
posteriors.

The decision rule is hardcoded to be a maximum decision rule, but it is 
not a requirement (although it generally makes sense, given that you 
want a MAP decision rule).  It could probably be set by the user, 
defaulting to MAP.

John's put in a test for it and the filter seems to classify just fine.

The goal might be to have a very generic BayesianClassifierFilter and 
subclass it for specific needs... ??

Regards
Karthik

> So I looked at ImageClassifierBase.  I was already giving one of these 
> to the MRF filter.  ImageClassifierBase has a GenerateData() method.  
> ImageClassifierBase, however, does not have the standard 
> SetInput()/GetOutput() methods.  Instead, it uses 
> SetInputImage()/GetClassifiedImage().  So it unclear to the user that 
> they could use ImageClassifierBase as an ImageToImageFilter.  Along 
> those line, ImageClassifierBase is not named like an 
> ImageToImageFilter (in particular, it does not end in ImageFilter).
>
> Do we have any ImageToImageFilters that you can give a decision rule 
> to and it will classify each pixel?
>
> *Jim Miller*
> */_____________________________________/*
> /Visualization & Computer Vision
> GE Research
> Bldg. KW, Room C223
> 1 Research Circle, Schenectady NY 12309-1027
>
> _millerjv at research.ge.com <mailto:millerjv at research.ge.com>_/
> /(518) 387-4005, Dial Comm: 8*833-4005/
> /Cell: (518) 505-7065, Fax: (518) 387-6981/
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Insight-developers mailing list
>Insight-developers at itk.org
>http://www.itk.org/mailman/listinfo/insight-developers
>  
>


More information about the Insight-developers mailing list