[Insight-users] co-occurrence matrix

Luis Ibanez luis.ibanez@kitware.com
Tue May 18 16:27:53 EDT 2004


Hi Glenn, Zach,

It will be more efficient to implement this class as
a real Image to List adaptor.  Right now it is more
like a ImageToList filter since it is creating a list
and filling it in.

The entire set of pixel pairs gets stored in memory
this way...

Looking at this, the class should probably not derive
from the ImageToListAdaptor but rather be an independednt
ImageToList filter.

---

My suggestion will be to reorganize this class and make
it an Adaptor. For this we simply have to move the preparation
code into a "Initialize()" method, and then open the while
loop where you are visiting all the pixels and their neighbors.

This loop should be exposed in the method:

  inline virtual const MeasurementVectorType &
     GetMeasurementVector(const InstanceIdentifier &id) const;

What this method will now do is to return one by one
the pairs of values from the neighbors. A look at the
itk::ImageToListAdaptor may help to clarify the use of
this method.

The List to Histogram generator will then be able to use
this adaptor directly without you having to pay for the
extra memory storage for all the pixel pairs.


Please let us know if you need help in reorganizing
this code.


   Thanks


      Luis


--------------------
Glenn Pierce wrote:

> On Sun, 2004-05-16 at 13:22 -0700, Zachary Pincus wrote:
> 
>>> In my code I was storing each pair in it's own MeasurementVector. 
>>>However I should have
>>> been increasing the frequency for pairs that are the same. Was this 
>>>changed ?
>>
>>Would it be better to store a histogram instead of a list? That way the 
>>incrementing is done automatically, and one can iterate through at 
>>(say) 256x256 histogram and directly create a 256x256 co-occurence 
>>image from the bin frequencies. (I assume that's what you want, right?)
>>
>>I was planning on looking at the code this afternoon to see if a 
>>histogram might work best...
>>
> 
> 
> 
> Yeah that I thought initially.
> 
> I think I had some trouble implementing it. 
> I can't remember the problem I was having - sorry.
> 
> Although I think a 2D histogram would be best.
> 
> Thanks
> 
> Glenn
> 
> 
> 
>>Zach
>>
> 
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users@itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 






More information about the Insight-users mailing list