[Insight-users] itkGradientMagnitudeImageFilter

Joshua Cates cates at sci . utah . edu
Thu, 22 May 2003 14:12:39 -0600 (MDT)


Hi,

For now you will need to set your input image as a floating point type.
Eventually this filter may accept any input type and do an automatic
conversion to float/double before processing (as in
itkVectorGradientMagnitudeImageFilter).


Josh.

______________________________
 Josh Cates			
 School of Computer Science	
 University of Utah
 Email: cates at sci . utah . edu
 Phone: (801) 587-7697
 URL:   http://www . sci . utah . edu/~cates


On Thu, 22 May 2003, Chad Washington wrote:

> I am trying to use the GradientMagnitudeImageFilter with the following 
> definitions:
> typedef itk::Image<int, 2> InputImageType;
> typedef itk::Image<float, 2> OutputImageType;
> typedef itk::GradientMagnitudeImageFilter< InputImageType, OutputImageType > 
> FilterType;
> 
> In my code I try to instantiate two objects of FilterType,
> FilterType::Pointer filter1 = FilterType::New();
> FilterType::Pointer filter2 = FilterType::New();
> 
> I receive the following errors at compilation:
> Insight/Code/BasicFilters/itkGradientMagnitudeImageFilter.txx: In
>    member function `void itk::GradientMagnitudeImageFilter<TInputImage,
>    TOutputImage>::ThreadedGenerateData(itk::ImageToImageFilter<TInputImage,
>    TOutputImage>::OutputImageRegionType&, int) [with TInputImage = ImageType,
>    TOutputImage = FloatImageType]':
> Insight/Code/Common/itkPointLocator.txx:161:   instantiated from here
> Insight/Code/BasicFilters/itkGradientMagnitudeImageFilter.txx:163: no
>    match for call to `(itk::NeighborhoodInnerProduct<ImageType, PixelType,
>    PixelType>) (std::slice&, itk::ConstNeighborhoodIterator<ImageType,
>    itk::ZeroFluxNeumannBoundaryCondition<ImageType> >&,
>    itk::DerivativeOperator<float, 2, itk::NeighborhoodAllocator<float> >&)'
> Insight/Code/Common/itkNeighborhoodInnerProduct.txx:32: candidates
>    are: TComputation itk::NeighborhoodInnerProduct<TImage, TOperator,
>    TComputation>::operator()(const std::slice&, const
>    itk::ConstNeighborhoodIterator<TImage,
>    itk::ZeroFluxNeumannBoundaryCondition<TImage> >&, const
>    itk::Neighborhood<TOperator, itk::NeighborhoodInnerProduct<TImage,
>    TOperator, TComputation>::ImageDimension,
>    itk::NeighborhoodAllocator<TOperator> >&) const [with TImage = ImageType,
>    TOperator = PixelType, TComputation = PixelType]
> Insight/Code/Common/itkNeighborhoodInnerProduct.h:68:
>             TComputation itk::NeighborhoodInnerProduct<TImage, TOperator,
>    TComputation>::operator()(const itk::ConstNeighborhoodIterator<TImage,
>    itk::ZeroFluxNeumannBoundaryCondition<TImage> >&, const
>    itk::Neighborhood<TOperator, itk::NeighborhoodInnerProduct<TImage,
>    TOperator, TComputation>::ImageDimension,
>    itk::NeighborhoodAllocator<TOperator> >&) const [with TImage = ImageType,
>    TOperator = PixelType, TComputation = PixelType]
> 
> To check to make sure this error was not a result of my implementation I 
> edited 
> Insight/Testing/Code/BasicFilters/itkGradientMagnitudeImageFilterTest.cxx by 
> adding the line
> typedef itk::Image<int, 2> InputImageType;
> and editing the line
> itk::GradientMagnitudeImageFilter<ImageType, ImageType>::Pointer 
>         filter =
>         itk::GradientMagnitudeImageFilter<ImageType, ImageType>::New();
> to be
> itk::GradientMagnitudeImageFilter<InputImageType, ImageType>::Pointer 
>         filter =
>         itk::GradientMagnitudeImageFilter<InputImageType, ImageType>::New();
> I received the same errors.  I understand the reason for requiring the 
> OutputImageType to be of PixelType float, but why does the InputImage have 
> this requirement?
> Thanks for your help,
> Chad Washington
> Biomedical Modeling Laboratory
> Department of Biomedical Engineering
> Vanderbilt University
> _______________________________________________
> Insight-users mailing list
> Insight-users at public . kitware . com
> http://public . kitware . com/mailman/listinfo/insight-users
>