[Insight-developers] Gaussian filters
Stephen R. Aylward
aylward at unc . edu
Wed, 24 Jul 2002 13:44:47 -0400
This would also be a great place to use an image adaptor to make the
image look like a float/double image.
s
Joshua Cates wrote:
> Hi Mark,
>
> I will add more documentation on DiscreteGaussianImageFilter as soon as I
> have some spare minutes. In the meantime, ignore the MaximumError
> parameter. The default setting is fine for most applications.
>
> Currently, the DiscreteGaussianImageFilter will only give reasonable
> output for real numbers (floats, doubles) so you need to use
> CastImageFilter to convert your input to floats (and back). In the
> future this conversion will be handled internally within the filter
> and be transparent to the user. I will be sure to include this caveat in
> the documentation.
>
> Thanks for the feedback,
>
> Josh.
>
> ______________________________
> Josh Cates
> School of Computer Science
> University of Utah
> Email: cates@sci.utah.edu
> Phone: (801) 587-7697
> URL: www.cs.utk.edu/~cates
>
>
> On Wed, 24 Jul 2002, mark foskey wrote:
>
>
>>I'm new to the group and still learning ITK, and I've noticed a couple
>>of apparent anomalies with the various Gaussian filter classes.
>>
>>1. RecursiveGaussianImageFilter has a SetSigma method, while
>>DiscreteGaussianImageFilter has a SetVariance method. I think it would
>>be helpful if the method were the same in both filters.
>>
>>2. DiscreteGaussianImageFilter yielded an apparently blank image for all
>>variance values I tried other than 0. I am including the test program I
>>used below. I may be doing something wrong.
>>
>>3. Perhaps most serious is that it was hard to figure out how to use
>>these filters from their documentation. Programmers are likely to
>>assume that RecursiveGaussianImageFilter simply blurs an image; only if
>>they read the documentation for RecursiveSeparableImageFilter will they
>>learn that the filter must be applied once for each dimension. Also,
>>for DiscreteGaussianImageFilter, the SetMaximumError method isn't
>>documented. I'm not clear on what the m_MaximumError parameter controls
>>in this context. I have not read the code yet, but the point is that I
>>think the meaning of the parameter should be documented.
>>
>>4. It would be nice if there were a convenience filter that would
>>internally chain together instances of the RecursiveGaussianImageFilter
>>for each dimension, since most users will want to filter along all n dims.
>>
>>I'm sorry for my first message to the group to come across as a
>>complaint, but I'm seeing ITK somewhat as a new user will, and I think
>>we have to be aware things that frustrate beginners.
>>
>>Here's the test program:
>>
>>#include <itkImage.h>
>>#include <itkImageFileReader.h>
>>#include <itkImageFileWriter.h>
>>#include <itkPNGImageIO.h>
>>#include <itkDiscreteGaussianImageFilter.h>
>>
>>typedef itk::Image<unsigned char, 2> ImageType ;
>>
>>int main(int argc, char* argv[])
>>{
>> if (argc < 2)
>> {
>> std::cout
>> << "usage: VerySimpleFilter [inputfile] [outputfile]"
>> << std::endl;
>> exit(0);
>> }
>>
>> // Create an IO object for PNG files, to be used by both the
>> // reader and the writer.
>> typedef itk::PNGImageIO PNGIOType;
>> PNGIOType::Pointer png = PNGIOType::New();
>>
>> // Instantiate a reader for the file.
>> typedef itk::ImageFileReader<ImageType> ImageReaderType;
>> ImageReaderType::Pointer reader = ImageReaderType::New();
>> reader->SetImageIO(png);
>> reader->SetFileName(argv[1]);
>>
>> // Instantiate a filter and attach it to the reader.
>> typedef itk::DiscreteGaussianImageFilter<ImageType, ImageType>
>> GaussianFilterType;
>> GaussianFilterType::Pointer myFilter = GaussianFilterType::New();
>> myFilter->SetInput(reader->GetOutput());
>> myFilter->SetVariance(0.1);
>>
>> // Instantiate a writer and attach it to the filter.
>> typedef itk::ImageFileWriter<ImageType> ImageWriterType;
>> ImageWriterType::Pointer writer = ImageWriterType::New();
>> writer->SetImageIO(png);
>> writer->SetInput(myFilter->GetOutput());
>> writer->SetFileName(argv[2]);
>>
>> writer->Write();
>>
>> return 0;
>>
>>}
>>--
>>Mark Foskey (919) 843-5436 Computer-Aided Diagnosis and Display Lab
>>mark_foskey@unc.edu Department of Radiology, CB 7515, UNC
>>http://www.cs.unc.edu/~foskey Chapel Hill, NC 27599-7515
>>
>>
>>_______________________________________________
>>Insight-developers mailing list
>>Insight-developers@public.kitware.com
>>http://public.kitware.com/mailman/listinfo/insight-developers
>>
>>
>
> _______________________________________________
> Insight-developers mailing list
> Insight-developers@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-developers
>
--
===============================================
Dr. Stephen R. Aylward
Assistant Professor of Radiology
Adjunct Assistant Professor of Computer Science
http://caddlab.rad.unc.edu
aylward@unc.edu
(919) 966-9695