18 #ifndef itkCastImageFilter_h
19 #define itkCastImageFilter_h
25 #include <type_traits>
29 #if !defined(ITK_LEGACY_REMOVE)
38 template <
typename TInput,
typename TOutput>
39 class ITK_TEMPLATE_EXPORT Cast
43 virtual ~Cast() =
default;
50 ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(Cast);
53 operator()(
const TInput & A)
const
55 return static_cast<TOutput>(A);
99 template <
typename TInputImage,
typename TOutputImage>
114 using typename Superclass::OutputImageRegionType;
130 GenerateOutputInformation()
override;
133 GenerateData()
override;
138 template <
typename TInputPixelType,
139 typename TOutputPixelType,
140 std::enable_if_t<mpl::is_static_castable<TInputPixelType, TOutputPixelType>::value,
int> = 0>
144 template <
typename TInputPixelType,
145 typename TOutputPixelType,
146 std::enable_if_t<!mpl::is_static_castable<TInputPixelType, TOutputPixelType>::value,
int> = 0>
154 #ifndef ITK_MANUAL_INSTANTIATION
155 # include "itkCastImageFilter.hxx"