[Insight-developers] Adding an OppositeImageFilter to Review

Dan Mueller dan.muel at gmail.com
Fri Feb 20 07:15:59 EST 2009


Hi Tom,

I'm not sure I like the name. Perhaps NegateImageFilter is more descriptive?

(BTW: You can achieve this functionality using the existing
ShiftScaleImageFilter, by setting Shift==0 and Scale=-1).

Regards, Dan

2009/2/20 Tom Vercauteren <tom.vercauteren at gmail.com>:
> Hi all,
>
> I'd like to add a feature to ExponentialDeformationFieldImageFilter
> before the start of the feature freeze period. For that purpose, I'd
> like to add a new class called OppositeImageFilter to the review
> directory.
>
> What it does is simply return the opposite (additive inverse) of the
> input image. It is a simple UnaryFunctorImageFilter that uses the
> functor shown hereafter.
>
> Can I simply commit this filter with its unit test to the repository,
> or do I have to go through an IJ submission for that?
>
> Tom
>
> template< class TInput, class TOutput>
> class Opposite
> {
> public:
>  Opposite() {};
>  ~Opposite() {};
>  bool operator!=( const Opposite & other ) const
>    {
>    return false;
>    }
>  bool operator==( const Opposite & other ) const
>    {
>    return true;
>    }
>  inline TOutput operator()( const TInput & A )
>    {
>    // We don't check if the TOutput can be signed.
>    // It's up to the user to decide whether this makes sense.
>    return static_cast<TOutput>( - A );
>    }
> };
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers
>


More information about the Insight-developers mailing list