[Insight-users] co-occurrence matrix
Luis Ibanez
luis.ibanez@kitware.com
Fri May 14 16:12:27 EDT 2004
Hi Glenn,
Thanks for the clarification.
Well...
You probably will have to write that
ImageToListAdaptor class after alll :-)
I would suggest you to write it as a
ImageToListFilter
and take advantage of the Neighborhood
Iterators. You probably can get very
close by looking at the code used for
the Morphological filters.
Please read the Iterators chapter on
the SoftwareGuide. That will help you
find your way.
It will be nice let the option to the
user for defining what neighbors to
use as cliques for the coorcurrence
matrix.
Your filter will populate a List of
2D vector values having all the pairs
of cliques from your images.
Please let us know if you need any
help implementing this filter.
and... of course, we will be happy
to get it back into the toolkit
once you are done :-)
Thanks
Luis
--------------------
Glenn Pierce wrote:
> On Fri, 2004-05-14 at 10:17 -0400, Luis Ibanez wrote:
>
>>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
>>
>
>
>
> Ah I think I must have the wrong terminology, As I am working with only
> one grey scale image.
> Or maybe I am missing something fundamental.
>
> I was thinking of a grey-level co-occurence matrix.
> ie for each pixel in a grey scale image I would record the intensity
> level and also the intensity level of one of the adjacent pixels (Can do
> this for each of the adjacent pixels). I would then use the two
> intensity values as an index in maybe a 2d histogram where I increment
> the value at that index.
>
> This can provide information about the regions of the image
>
> (Sorry about the poor explanation)
> probably better description at
> http://www.engr.panam.edu/ee/faculty/harlow/6399/notes/Ch24.pdf.
>
>
> Sorry if I have misunderstood.
>
> Thanks for the feedback
>
>
>
>
>>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
>>>
>>
>>
>>
> 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