Commit af3cc15b authored by Julien Michel's avatar Julien Michel

ENH: Add template using to ease the retrieval of input image types

parent cec70438
......@@ -209,6 +209,8 @@ public:
// the functor
using InputHasNeighborhood = typename FunctorFilterSuperclassHelper<TFunction>::InputHasNeighborhood;
using InputTypesTupleType = typename Superclass::InputTypesTupleType;
template<size_t I> using InputImageType = typename Superclass::template InputImageType<I>;
/** Run-time type information (and related methods). */
itkTypeMacro(FunctorImageFilter, ImageToImageFilter);
......
......@@ -36,6 +36,8 @@ public:
using InputTypesTupleType = std::tuple<TInputs...>;
template <size_t I> using InputImageType = typename std::tuple_element<I,InputTypesTupleType>::type;
itkNewMacro(Self);
template <std::size_t I> void SetVInput(const typename std::tuple_element<I,InputTypesTupleType>::type * inputPtr)
......
......@@ -101,7 +101,7 @@ template <typename T> struct TypesCheck
auto filter = NewFunctorFilter(functor);
using FilterType = typename decltype(filter)::ObjectType;
static_assert(std::is_same<typename std::tuple_element<0, typename FilterType::Superclass::InputTypesTupleType>::type, InputImageType>::value, "");
static_assert(std::is_same<typename FilterType::template InputImageType<0>, InputImageType>::value, "");
filter->SetVInputs(in);
filter->SetInput1(in);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment