[Insight-developers] Re: NeighborhodOperator ScaleCoefficients() and NumericTraits : RealType

Joshua Cates cates at sci . utah . edu
Wed, 27 Aug 2003 11:18:18 -0600 (MDT)


Hi Luis,

I don't see any problem with this conversion.  ScaleCoefficients is
generally only called once on an operator, so efficiency is not a concern.  
I'd rather preserve the type of the coefficients of the operator as
PixelType for now, since I have not analyzed what effect changing to
RealType would have.

Thanks,

Josh.

______________________________
 Josh Cates			
 Scientific Computing and Imaging Institute
 University of Utah
 Email: cates at sci . utah . edu
 Phone: (801) 587-7697
 URL:   http://www . sci . utah . edu/~cates


On Tue, 26 Aug 2003, Luis Ibanez wrote:

> 
> Hi Josh,
> 
> The NeighborhoodOperator is generating some warninngs in the
> method
> 
>                         ScaleCoefficients()
> 
> this methods multiplies the coefficients by a factor.
> the coefficients are of type = Pixel Type, and the method
> ScaleCoefficients() is also expecting a PixelType as argument.
> 
> It probably should be accepting a type
> 
>        NumericTraits< PixelType >::RealType.
> 
> and then casting the result of the product to PixelType.
> 
> Or,
> maybe the coefficients themselves should be of type
> 
>        NumericTraits< PixelType >::RealType.
> 
> since they are used for multiplying pixel types.
> 
> The warnings are generated in the GradientMagnitudeImageFilter
> where "double" values are passed to the ScaleCoefficients() method.
> 
> Do you see any major disadvantages on making this conversion ?
> 
> Thanks
> 
>     Luis
> 
> 
> 
> 
>