[Insight-users] co-occurrence matrix

Luis Ibanez luis.ibanez@kitware.com
Fri May 21 22:38:36 EDT 2004


Hi Glenn,

The fact that you have to setup the window level
as low as 4, and the window as low as 8 simply
indicates that the pixels in your image are mostly
dark pixels.  Note that for visualizing 2D histograms
as images you usually want to use a logaritmic scale.

Color encoding may also be useful...

---

Thanks for the heads up on the ImageToCoocurrence
ListAdpator. This class need some refactoring in
order to make it a real Adaptor. We will have to
take a look at both issues simultaneously.


   Thanks


     Luis


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

> Hi
> 
> I have a nice image displaying now.
> 
> I am scaling to  255 intensity values with 
> shift->SetOutputScalarTypeToUnsignedChar();
>                                            
> I get  nice image with
> 
>   imageMapper->SetColorWindow(8);
>   imageMapper->SetColorLevel(4);
> 
> I must confess I don't understand why , I would expect to have to use
> 
> imageMapper->SetColorWindow(255);
> imageMapper->SetColorLevel(128);
> 
> But at least it works.
> 
> 
> There was a bug in ImageToCooccurrenceListAdaptor
> 
> Basically itk::NeighborhoodAlgorithm::ImageBoundaryFacesCalculator
> is returning the same pixel for some different regions.
> 
> This seems to be described at 
> http://www.itk.org/pipermail/insight-users/2004-April/007949.html.
> 
> Sorry I did not know how to fix this bug.
> I thought I should people looking at ImageToCooccurrenceListAdaptor know.
> 
> Thanks
> 
> 
> 
> On Wed, 2004-05-19 at 15:26 -0400, Luis Ibanez wrote:
> 
>>Hi Glenn,
>>
>>Loading your image
>>
>>http://homepage.ntlworld.com/glenn.pierce/co-occur.png
>>
>>Into the image viewer
>>
>>      InsightApplications/ImageViewer
>>
>>and by setting it to display logaritmic values,
>>(hit the "L" key several times)( or "h" for help)
>>
>>It shows that the values are actually spread around
>>the bright spots. It is still pretty focused, but
>>the fact is that it is not totally in the diagonal.
>>
>>That may give you a hint on what's going on with
>>your program....
>>
>>
>>   Regards,
>>
>>
>>      Luis
>>
>>
>>-------------------------
>>
>>Glenn Pierce wrote:
>>
>>> Sorry to bother you again again. Last time hopefully
>>> 
>>> I have written a test program to display my co-occurrence values.
>>> I have attached the program.
>>> 
>>> However, the values only appear on the forward diagonal as in
>>> 
>>> http://homepage.ntlworld.com/glenn.pierce/co-occur.png
>>> 
>>> They should appear throughout the image as in the
>>> 
>>> http://homepage.ntlworld.com/glenn.pierce/result.png
>>> 
>>> I cant think what the problem is.
>>> 
>>> When I'm done maybe I we can add this to the Examples under statistics.
>>> 
>>> Thanks alot
>>> 
>>> 
>>> On Tue, 2004-05-18 at 11:17 -0400, Luis Ibanez wrote:
>>> 
>>>>Hi Glenn,
>>>>
>>>>You can visualize the 2D histogram by first copying
>>>>its values in an itk::Image.
>>>>
>>>>For this you can write a while() loop and use the
>>>>method
>>>>
>>>>       histogram->GetFrequency( index );
>>>>
>>>>Then you convert this ITK image into a VTK image
>>>>using the filter adaptors in
>>>>
>>>>    InsightApplications/Auxiliary/vtk
>>>>
>>>>and plug this vtkImageData into a vtkImageViewer.
>>>>
>>>>
>>>>---
>>>>
>>>>We didnt' change the actual computation of your
>>>>List of measurement vectors.  More on this in a
>>>>following email...
>>>>
>>>>
>>>>  Regards,
>>>>
>>>>
>>>>    Luis
>>>>
>>>>
>>>>
>>>>-------------------
>>>>Glenn Pierce wrote:
>>>>
>>>>> On Sun, 2004-05-16 at 15:11 -0400, Luis Ibanez wrote:
>>>>> 
>>>>>>Hi Glenn,
>>>>>>
>>>>>>Thanks for contributing your code to ITK.
>>>>>>
>>>>>>The class has been added under
>>>>>>
>>>>>>     Insight/Code/Numerics/Statistics.
>>>>>>
>>>>>>
>>>>> 
>>>>> Thanks :)
>>>>> 
>>>>>>
>>>>>>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 ?
>>>>>>
>>>>> 
>>>>> I wanted to visualise the cooccurrence matrix with vtk as a grey scale 
>>>>> image.
>>>>> So I would be visualising  the frequency for each "pair of intensity 
>>>>> values". 
>>>>> So pairs that have a greater frequency appear as higher intensities in a 
>>>>> grey level image.
>>>>> 
>>>>> 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 ?
>>>>> 
>>>>> 
>>>>> Thanks for the help.
>>>>> 
>>>>> Much appreciated
>>>>> 
>>>>> 
>>>>> Glenn
>>>>> 
>>>>
>>>>
>>>>
>>
>>
>>






More information about the Insight-users mailing list