[Insight-developers] Tensor anisotropy filters template default

Casey Goodlett gcasey at cs.unc.edu
Wed Mar 1 19:24:03 EST 2006


Hi Luis,

I think adding concept checking to the classes to require an input pixel
of a tensor type and an output pixel of a scalar type is a good idea for
these filters.  My main concern was that a user who saw the default for
the output type would believe that an input and output of the same type
is a valid operation.  If the required input/output types are documented
through concept checking instead of changing the default output type, I
think thats fine.

Thank You

Casey

Luis Ibanez wrote:
>
> Hi Casey,
>
> I agree with you in that this filter has a quite specific output
> type and it would be healthy to enforce it at compilation time.
>
>
> The issue at this point will be to respect the Backward Compatibility
> Policy (BCP) as stated in:
>
> http://www.insightsoftwareconsortium.org/wiki/index.php/Administration-BackwardCompatibility
>
>
>
>
> which says:
>
>
> API's can change if:
>
>    1. The compiler, if possible, can warn the user about the
>       deprecated API. Some compilers show line numbers where
>       the deprecated API is being used.
>
>    2. At run-time, deprecated API's report how to change code
>       from the old API to the new API.
>
>    3. Documentation in the deprecated code clearly informs the
>       user how to move the code from the old API to the new API.
>
>
>
> In this particular case, it seems that we could use the Concept
> Checking in order to enforce the use of the correct output image
> type while still respecting the BCP.
>
>
> Please let us know if you could find this to be a reasonable compromise,
>
>
>    Thanks
>
>
>      Luis
>
>
> ----------------------
> Casey Goodlett wrote:
>> Hello,
>>
>> There is a small bug in itkTensorFractionalAnisotropyImageFilter.h and
>> itkTensorRelativeAnisotropyImageFilter.h.  Both filters use a default
>> template parameter of TOutputImage=TInputImage.  This is an invalid
>> default since these filters map from tensors -> scalars.  A better
>> default would be the following
>>
>> template <typename TInputImage,
>>           typename TOutputImage=itk::Image<ITK_TYPENAME
>>                               TInputImage::PixelType::RealValueType,
>>   ::itk::GetImageDimension<TInputImage>::ImageDimension > >
>>
>> I filed this bug at
>> http://www.itk.org/Bug/bug.php?op=show&bugid=2899&pos=0
>>
>> Thanks
>>
>> -- 
>> Casey Goodlett
>>
>> _______________________________________________
>> Insight-developers mailing list
>> Insight-developers at itk.org
>> http://www.itk.org/mailman/listinfo/insight-developers
>>
>>
>



More information about the Insight-developers mailing list