[Insight-users] Histogram

Luis Ibanez luis . ibanez at kitware . com
Mon, 24 Nov 2003 13:41:37 -0500


Hi David,

If you want to get three separate histograms,
one for each one of the three RGB components you
can use the ImageAdaptors described in the software
guide.

   http://www . itk . org/ItkSoftwareGuide . pdf

in Section 12.3 you will find an example that
extracts the R, G, B components from an RGB
image and present them as being a single
component image.

Then you use the ImageToList adaptor in order
to connect the image data to the statistical
framework.

You will find this description in Section 10.2,
of the SoftwareGuide. pdf-page 424.

-------------------------------------------------

If what you want is the Joint histogram of the
RGB components, this will be a 3D image.

In that case, as a shortcut you could use the small
program we used for extracting RGB histograms from the
Visible Woman Data set.  This was done for removing
the blue gel from the dataset as a preprocessing
step for generating the segmentations that are shown
in the Cover of the SoftwareGuide.

Here is the code from

InsightDocuments/SoftwareGuide/Cover/Source

http://www . itk . org/cgi-bin/cvsweb . cgi/InsightDocuments/SoftwareGuide/Cover/Source/VWHistogramRGB . cxx?cvsroot=Insight


For the segmentation of the cover it was quite useful
to volume render the 3D histogram since it make visible
all the clusters. You can use the free version of VolView
for that purpose.

VolView can be downloaded from:

    http://www . kitware . com/products/volview . html


Please let us know if you have further questions,


Thanks


    Luis


-------------------
David Llanos wrote:

> hi all,
>  
> As I can apply a histogram to a RGB image for each component?
>  
> I have been studying the example histogram.cxx but this it doesn't try 
> with images. 
> 
> does any example exist in the sources that given an image like entrance 
> returns its histogram?
>  
>  
>  
> thanks in advance
>