[Insight-users] co-occurrence matrix
Luis Ibanez
luis.ibanez@kitware.com
Fri May 14 15:17:09 EDT 2004
Hi Glenn
You don't really need to write much code in order
to compute a coocurrence matrix in ITK because a
Coocurrence Matrix is simply a 2D Histogram.
The itk::Statistics::Histogram class has been desigened
from the beginning for supporting multicomponent data.
Actually if you look at the Histogram example in the
SoftwareGuide, it is a 2D histogram case:
http://www.itk.org/ItkSoftwareGuide.pdf
Section 10.1.3, pdf-page 428.
--
You should be fine by just taking your two input images
and composing a Vector image with them. For this you can
use the Compose3DVectorImageFilter:
http://www.itk.org/Insight/Doxygen/html/classCompose2DVectorImageFilter.html
Then, passing this vector image to the ImageToHistogramGenerator:
http://www.itk.org/Insight/Doxygen/html/classitk_1_1Statistics_1_1ImageToHistogramGenerator.html
and you get the 2D histogram at the end, which is exactly
a Coocurrence Matrix. Note that you must define the bin
sizes along every dimension, as well as the min and max
values to cover with the his domain of the histogram.
The pipeline will look like
Image1---+
|
V
Compose2DVectorImage ---> ImageToHistogramGenerator ---> Histogram
^
|
Image2---+
Please let us know if you find any problem,
Thanks
Luis
-------------------
Glenn Pierce wrote:
> Hi
>
> I was wondering what the best way of implementing a co-occurrence
> matrix.
> I was thinking of just using itk::Statistics::ImageToListAdaptor or a
> subclass to loop through the image's
> pixel values and counting each co-occurrence in a histogram.
>
> Would there be a better way for itk, with respect to contributing the
> code back to ITK?
> Maybe basing my code on another filter?
>
> Thanks
>
> Glenn
>
>
> Glenn Pierce
> email: glennpierce@connectfree.co.uk
>
> _______________________________________________
> Insight-users mailing list
> Insight-users@itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
More information about the Insight-users
mailing list