[Insight-developers] GaussianImageSource

Damion Shelton dmshelto@andrew.cmu.edu
Fri, 07 Dec 2001 15:51:41 -0500


Hi...

I checked in itkGaussianImageSource, its test, and 
itkGaussianSpatialFunction. Whoever requested that the Gaussian source be 
added, please verify that the API is what you expected. The syntax is 
fairly compact (by default, it creates a 64x64x64 image of unsigned chars):

  const unsigned int dim = 3;

  // Image typedef
  typedef itk::Image< unsigned char, dim > TImageType;

  // Create a gaussian image source
  typedef itk::GaussianImageSource< TImageType > TGaussianSource;
  TGaussianSource::Pointer pSource = TGaussianSource::New();

  // Get the output of the source
  TImageType::Pointer pImage = pSource->GetOutput();

  // Run the pipeline
  pSource->Update();

If there is interest, I will create an additional class 
SpatialFunctionImageSource, which accomplishes a similar task but allows 
for generalized spatial functions (rather than being locked to a Gaussian). 
SpatialFunctionImageEvaluator filter already does this, but requires that 
an image already exist, rather than acting as a pure source.

-Damion-