[Insight-users] Re: itkHistogramMatchingImageFilterTest

Luis Ibanez luis.ibanez@kitware.com
Fri, 06 Sep 2002 15:22:26 -0400


Hi digvijay,

The itkHistogramMatchingImageFilter requires two input images.
One of the images is used only as a reference, and is hence
called "Reference" and set with the "SetReferenceImage()" method.

The Source image is the input image that will be modifed by
the filter in order to make its histogram match the histogram
of the Reference image.

The call "SetSourceImage()" is completely equivalent
to "SetInput()".


The typical code for matching two images read from
files will look like:


typedef itk::Image< unsigned short, 3 > ImageType;
typedef itk::ImageFileReader< ImageType > ReaderType;

ReaderType::Pointer reader1 = ReaderType::New();
ReaderType::Pointer reader2 = ReaderType::New();
reader1.SetFileName("image1.mhd");
reader2.SetFileName("image2.mhd");

typedef itk::HistogramMatchingImageFilter< ImageType > FilterType;

FilterType::Pointer filter = FilterType::New();
filter->SetSourceImage( reader2->GetOutput() );
filter->SetReferenceImage( reader1->GetOutput() );
filter->SetNumberOfHistogramLevels( 60 );
filter->SetNumberOfMatchPoints( 10 );  filter->ThresholdAtMeanIntensityOn();

filter->Update();


Note that the use of RegisterOneFactory() is no longer
necessary for reading PNG, VTK and MetaImage files.


Please let us know if you encounter any problem
using this filter.


Thanks


    Luis



=====================================

digvijay singh wrote:

> hi luis!!
> i tried to implement the test
> itkHistogramMatchingImageFilterTest and wish to use it
> for two image files in meta format . How do i use the
> Setreference and Setsource ....could u please help..
> thanks
> digvijay
> 
> =====
> Digvijay Singh
> logierhause BLV
> langgassstrasse (langasse) 75
> berne 3012
> Switzerland
> Ph : (076)(4617551)
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Finance - Get real-time stock quotes
> http://finance.yahoo.com
> 
>