[Insight-developers] Adding Concept Chechking "float"/"double" to pixel type of GradientAnisotropicDiffusion

kent williams norman-k-williams at uiowa.edu
Wed Aug 15 10:22:05 EDT 2007


Maybe adding a runtime error message that explains exactly what the problem
is would be a better fit than concept checking in this case.  Concept
checking is a great idea in theory, but it does have the drawback of not
generating consistent, readable error messages on all (or any?) platforms.

While it might be annoying to implement, an alternative approach might be to
cast the Image inputs to float from Int type within the filters that can¹t
properly interpret Int data.  This might seem a little hokey, but if the
user really wants to use Anisotropic Diffusion on an unsigned char image,
they¹d have to wrap the filter with CastImageFilters themselves.


On 8/15/07 8:12 AM, "Bill Lorensen" <bill.lorensen at gmail.com> wrote:

> Luis,
>  
> This change may cause backward compatibility problems. Old code may no longer
> compile and the compiler error for the conept checking is cryptic on some
> compilers. We should warn the user and give explicit instructions on how to
> repair the code in the warning message.
>  
> I understand that the current code is not producing correct results. But that
> is the fault of the itk development team and not the user of the code. We
> should notify users in an instructive way on how to fix their code so that it
> produces correct results. A cryptic compiler error is not informative.
>  
> I'm sure others will want to comment on this.
>  
> Bill
> 
>  
> On 8/15/07, Luis Ibanez <luis.ibanez at kitware.com> wrote:
>> 
>> We just encountered in the mailing list that the
>> GradientAnisotropic diffusion filter has to be
>> instantiated over an image of "float/double" pixel
>> type in order to perform computations properly.
>> 
>> http://public.kitware.com/pipermail/insight-users/2007-August/023304.html
>> <http://public.kitware.com/pipermail/insight-users/2007-August/023304.html>
>> 
>> If there are no objections I will add a ConceptCheck
>> for this filter, and probably all the filters that
>> use the PDE Solver.
>> 
>> Otherwise they compile, run,
>> and silently fail to produce a correct image as output.
>> 
>> 
>>    Luis
>> 
>> 
>> _______________________________________________
>> Insight-developers mailing list
>> Insight-developers at itk.org
>> http://www.itk.org/mailman/listinfo/insight-developers
>> 
> 
> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.itk.org/mailman/private/insight-developers/attachments/20070815/d1122e3a/attachment.htm


More information about the Insight-developers mailing list