[Insight-users] Anisotropic Diffusion filtering

rashed karim rashed.vtk at googlemail.com
Wed Aug 1 08:57:00 EDT 2007


Hi everyone,

I am trying to use the itkGradientAnisotropicDiffusionImageFilter class for
smoothing my MRI images. To my dismay, my images are not responding to the
filter even when I run 50 or so iterations with a conductance of about 3.0 (
i.e. output image is the same as the input image with no visible
difference). An earlier forum post had suggested to use a 3.0 conductance
level, but such a high conductance rate makes the output image
unrecognizable (lots of salt-pepper noise).

So has anyone used this filter before, and if so, what sort of
parameter values (number of iterations, conductance and time step) should I
be looking to use. Although I know that these values depend on the type of
my images I am working with, but any suggestions will be very useful.

Also in the documentation it says somewhere that the time step parameter is
similar to the width of the gaussian kernel. I have tried values of 20.0 -
30.0. However, I get a warning message telling me that this sort of value is
an "unstable time step" for my images. The message also suggests a timestep
which is usually a very small value (~ 0.05). What i dont understand, is
that I had no problems (isotropic) Gaussian smoothing my images with widths
ranging from 20.0 - 30.0, then why does the anisotropic filter complain for
such widths?

Here is part of my code if it helps:

 typedef itk::Image< PixelType, 3 > InputImageType;
 typedef itk::Image< PixelType, 3 > OutputImageType;
 typedef itk::ImageFileReader< InputImageType > ReaderType;
 typedef itk::ImageFileWriter< OutputImageType >  WriterType;
 typedef itk::GiplImageIO ImageIOType;
 typedef itk::GradientAnisotropicDiffusionImageFilter<InputImageType,
OutputImageType > FilterType;


 ReaderType::Pointer reader = ReaderType::New();
 WriterType::Pointer writer = WriterType::New();
 ImageIOType::Pointer giplIO = ImageIOType::New();
 FilterType::Pointer filter = FilterType::New();

 reader->SetFileName( argv[1] );
 writer->SetFileName( argv[2] );


 // for GIPL files
 reader->SetImageIO(giplIO);
 writer->SetImageIO(giplIO);

 //reader->Update();

 writer->SetInput(filter->GetOutput());
 filter->SetInput(reader->GetOutput());
 filter->SetNumberOfIterations( numberOfIterations );
 filter->SetTimeStep( timeStep );
 filter->SetConductanceParameter( conductance );
 writer->Update();

Thanks for any suggestions,



Regards,

Rashed Karim.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070801/df64c7c0/attachment.htm


More information about the Insight-users mailing list