[Insight-users] co-occurrence matrix
Luis Ibanez
luis.ibanez@kitware.com
Sun May 16 20:12:07 EDT 2004
Hi Glenn,
Thanks for contributing your code to ITK.
The class has been added under
Insight/Code/Numerics/Statistics.
Tha class name was changed in order to include "Adaptor".
It is now:
itk::ImageToCooccurrenceListAdaptor
Some coding style changes were made. And the method
UseNeighbor was modified in order to work for N-D images.
A couple of minor coding style details, in ITK we use
the opening brackets in isolated lines, like
for()
{
....
}
instead of
for() {
}
also,
the brackets are indented two spaces (never using tabs).
---
Your VTK question wasn't quite clear.
Do you want to take a VTK image and get a cooccurrence
matrix out of it using ITK ?
or, do you want to use VTK for visualizing the
cooccurrence matrix that you computed with ITK ?
Please let us know,
Thanks
Luis
------------------
Glenn Pierce wrote:
> Ok
>
> I have a first version of a co occurrence filter.
> I sure there are many things I can improve.
>
> The main problem is I have stored each pair in a ListSample (each pair
> as a new MeasurementVector).
> However, I need to increase the frequency of duplicate pairs. I wasn't
> sure how to efficiently find if a pair have already been stored and then
> increment the frequency of that pair.
> see line 76 of itkImageToCooccurenceList.txx
>
>
> I had to use quite a few typename constructs to remove compiler warnings
> of 'implicit typename' if anyone wonders about them.
>
>
> Also I inherited from ImageToListAdaptor
> but I am storing values in a ListSample that is a member of this
> class. This is different from the other adaptors as it is storing
> values. I don't know whether this is suitable for you?
>
> Any suggestions of improving this filter. Even better itk method names
> etc would be great.
>
> I eventually am going to use this to produced an co-occurrence image in
> vtk. Does anyone know how you can produce a grey level image with
> different intensity values for the pixels in vtk? I probably should ask
> on the vtk list -sorry.
>
>
> I have attached the filter and a small driver program.
>
> Thanks for the help.
>
>
> Glenn
>
>
> On Fri, 2004-05-14 at 11:12 -0400, Luis Ibanez wrote:
>
>>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 :-)
>>
>
>
>
More information about the Insight-users
mailing list