[Insight-developers] [Insight-users] Interpolation and resampling templates

Bradley Lowekamp blowekamp at mail.nih.gov
Fri Mar 6 09:18:02 EST 2009


On Mar 6, 2009, at 8:29 AM, Karthik Krishnan wrote:

> On Fri, Mar 6, 2009 at 2:13 AM, Emmanuel Christophe <emmanuel.christophe at gmail.com 
> > wrote:
> Hi Karthik, Brad,
>
>
> - Not sure if NumericTraits is the best place for the Clamp function.
> I put it there as it is closely related to the type and in the case of
> the itk::ResampleImageFilter is used as a precaution before a
> static_cast. I haven't defined it for Vectors, RGB etc.
>
> Thanks for the patch.
>
> I think its  good to define it for all pixel types for which it  
> makes sense.

I am not disagreeing with the usefulness of the clamp function. I just  
disagreeing with the adhoc adding of a function to the NumericTraits  
class. Clamp is not a trait is a function which is rather different  
then how this class is currently designed.

If we did want to add a set of functions it would be great and useful  
(where?). I would think that Min, Max and LERP should be considered. I  
just think some consideration should be made to what it means to all  
pixel types. And they need to be made consistent across all traits  
where appropriate. The NumericTraits class is a little bit of a pet  
peeve of mine. I think is needs a more design and documentation to  
flush things out between everything, and some careful review. :)


>
>
> - I don't think the itk::ResampleImageFilter was able to resample RGB
> images. At one point it would have tried to compare two RGBPixel  
> using <.
>
> Right. One would have to use the VectorResampleImageFilter.

Yes, this is how I have done it. Sorry for my confusion. RGBPixel type  
does in fact have a operator<, but the meaning and usefulness is  
debatable.

Sorry for being difficult on this subject :)

Brad

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20090306/4461a635/attachment.htm>


More information about the Insight-developers mailing list