[Insight-users] itkNormalizeImageFilter and itkSigmoid filter ????

robertsen p itkseeker at gmail.com
Mon Oct 20 10:26:01 EDT 2008


Hi Bill

Thanks for prompt reply. Here is my code...Since I am newbie in ITK. I
really dont get how to set parameters for itkNormalizeImageFilter.h .

Any ways here is my code

#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"
#include "itkImage.h"
#include "itkNormalizeImageFilter.h"

int main( int argc, char *argv[] )
{
  const    unsigned int    ImageDimension = 2;
  typedef  unsigned short           PixelType;

  typedef itk::Image< PixelType, ImageDimension >  FixedImageType;
  typedef itk::ImageFileReader< FixedImageType  > FixedImageReaderType;
  FixedImageReaderType::Pointer  fixedImageReader  =
FixedImageReaderType::New();
  fixedImageReader->SetFileName(  "Source.png" );
  typedef unsigned short  InternalPixelType;
  typedef itk::Image <InternalPixelType,ImageDimension> InternalImageType;
  typedef
itk::NormalizeImageFilter<FixedImageType,InternalImageType>fixedNormalizeFilterType;

  fixedNormalizeFilterType::Pointer  normlizer =
fixedNormalizeFilterType::New();

  normlizer->SetInput(fixedImageReader->GetOutput());

  typedef itk::ImageFileWriter< InternalImageType >  WriterType;
  WriterType::Pointer  writer =  WriterType::New();
  writer->SetFileName( "NormalizedImage_OP.png");
  writer->SetInput(normlizer->GetOutput());

 try
    {
    writer->Update();
    }
  catch( itk::ExceptionObject & err )
    {
    std::cerr << "ExceptionObject caught !" << std::endl;
    std::cerr << err << std::endl;
    return -1;
    }
  return 0;
}


On Mon, Oct 20, 2008 at 4:20 PM, Bill Lorensen <bill.lorensen at gmail.com>wrote:

> itkNormalizeImageFilter should do the job. Can you post your code?
>
> On Mon, Oct 20, 2008 at 10:15 AM, robertsen p <itkseeker at gmail.com> wrote:
> > Dear All
> >
> > I want to normalize images into zero mean and unit variance for intensity
> > based Image registration. I have tried itkNormalizeImageFilter.h
> > but It doesnt give a desired output (Image looks binary). Why???
> >
> > I tried with sigmoid filter but how to set values of alpha and beta so as
> to
> > get unit variance and zero mean ....still output image to be gray scale??
> >
> > Please help . looking forward to receive your reply.
> >
> > Regards
> > Robert/
> >
> >
> > _______________________________________________
> > Insight-users mailing list
> > Insight-users at itk.org
> > http://www.itk.org/mailman/listinfo/insight-users
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20081020/f38d31f8/attachment-0001.htm>


More information about the Insight-users mailing list