[Insight-users] DiscreteGaussianImageFilter

Joshua Cates cates@sci.utah.edu
Mon, 16 Sep 2002 10:35:24 -0600 (MDT)


Hello Zein,

Make sure you cast to a float or double image before running the 
DiscreteGaussianImageFilter.  Currently, the gaussian filter requires real 
number input. Hope this helps.

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 Mon, 16 Sep 2002, Zein Salah wrote:

> Hallo friends,
> 
> Is there a bug in the DiscreteGaussianImageFilter ??? I am using the following simple code:
> 
>   enum{ ImageDimension = 3 };
>   typedef signed short              InputPixelType;
>   typedef float                     PixelType;
>   typedef itk::Image<InputPixelType,ImageDimension>   InputImageType; // InputImageType is the raw image type
>   typedef itk::Image<float,ImageDimension>            ImageType;      // ImageType is the internal image type
>   typedef itk::ImageFileReader< InputImageType >      VolumeReaderType;
>   typedef itk::DiscreteGaussianImageFilter<InputImageType, ImageType >         DiscreteGaussianImageFilterType;
> ....
> ...
>    DiscreteGaussianImageFilterType::Pointer  smoothfilter = DiscreteGaussianImageFilterType::New();
>      
>    smoothfilter->SetInput(m_Reader->GetOutput() );           // m_Reader is of    VolumeReaderType::Pointer
>    smoothfilter->SetVariance(1.0f);
>    smoothfilter->SetMaximumError(.01f);
>    smoothfilter->Update();
> 
> The errors are:
> 
> --------------------Configuration: GaussianFilter - Win32 Debug--------------------
> Compiling...
> iomodule.cpp
> main.cpp
> Tester.cpp
> D:\InsightBeta2\Code\BasicFilters\itkDiscreteGaussianImageFilter.txx(118) : error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'class itk::Image<short,3> *' (or there is no acceptable conversion)
>         C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xstring(583) : while compiling class-template member function 'void __thiscall itk::DiscreteGaussianImageFilter<class itk::Image<short,3>,class itk::Image<float,3> >::GenerateData(void)'
> D:\InsightBeta2\Code\BasicFilters\itkDiscreteGaussianImageFilter.txx(129) : error C2664: 'void __thiscall itk::ImageToImageFilter<class itk::Image<short,3>,class itk::Image<float,3> >::SetInput(const class itk::Image<short,3> *)' : cannot convert pa
> rameter 1 from 'class itk::SmartPointer<class itk::Image<float,3> >' to 'const class itk::Image<short,3> *'
>         No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
>         C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xstring(583) : while compiling class-template member function 'void __thiscall itk::DiscreteGaussianImageFilter<class itk::Image<short,3>,class itk::Image<float,3> >::GenerateData(void)'
> Generating Code...
> Error executing cl.exe.
> Creating browse info file...
> 
> ZeinTester.exe - 2 error(s), 0 warning(s)
> 
> Have anybody faced such errors with this filter?? Many thanks for the help.
> 
> Zein
> 
> 
> ->8<------------->8<------------->8<------------->8<------------->8<------------->8<-
> Zein I. Salah 
> Universität Tübingen, WSI-GRIS 
> Sand 14 
> 72076 Tübingen 
> Email: salah@gris.uni-tuebingen.de  / zeinsalah@hotmail.com
> Tel.: (07071) 29 75465 (GRIS) , (07071) 96 44 39 (privat) 
>