Newer
Older
#ifndef selxItkImageSourceMoving_h
#define selxItkImageSourceMoving_h
#include "ComponentBase.h"
#include "Interfaces.h"
#include <string.h>
#include "elxMacro.h"
namespace selx
{
template<int Dimensionality, class TPixel>
class ItkImageSourceMovingComponent :
public Implements<
Accepting<>,
Providing< SourceInterface, itkImageSourceMovingInterface<Dimensionality, TPixel > >
>
{
public:
elxNewMacro(ItkImageSourceMovingComponent, ComponentBase);
itkStaticConstMacro(Dimensionality, unsigned int, Dimensionality);
ItkImageSourceMovingComponent();
virtual ~ItkImageSourceMovingComponent();
typedef itk::ImageSource<itk::Image<TPixel, Dimensionality>> ItkImageSourceMovingType;
virtual typename ItkImageSourceMovingType::Pointer GetItkImageSourceMoving() override;
virtual bool ConnectToOverlordSource(itk::Object::Pointer) override;
virtual bool MeetsCriterion(const CriterionType &criterion) override;
static const char * GetDescription() { return "ItkImageSourceMoving Component"; };
private:
typename ItkImageSourceMovingType::Pointer m_Source;
protected:
/* The following struct returns the string name of computation type */
/* default implementation */
static inline const std::string GetTypeNameString()
{
itkGenericExceptionMacro(<< "Unknown ScalarType" << typeid(TPixel).name());
// TODO: provide the user instructions how to enable the compilation of the component with the required template types (if desired)
// We might define an exception object that can communicate various error messages: for simple user, for developer user, etc
}
static inline const std::string GetPixelTypeNameString()
{
itkGenericExceptionMacro(<< "Unknown PixelType" << typeid(TPixel).name());
// TODO: provide the user instructions how to enable the compilation of the component with the required template types (if desired)
// We might define an exception object that can communicate various error messages: for simple user, for developer user, etc
}
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
template <>
inline const std::string
ItkImageSourceMovingComponent<2, float>
::GetPixelTypeNameString()
{
return std::string("float");
}
template <>
inline const std::string
ItkImageSourceMovingComponent<2, double>
::GetPixelTypeNameString()
{
return std::string("double");
}
template <>
inline const std::string
ItkImageSourceMovingComponent<3, float>
::GetPixelTypeNameString()
{
return std::string("float");
}
template <>
inline const std::string
ItkImageSourceMovingComponent<3, double>
::GetPixelTypeNameString()
{
return std::string("double");
}
#ifndef ITK_MANUAL_INSTANTIATION
#include "selxItkImageSourceMoving.hxx"
#endif
#endif // #define selxItkImageSourceMoving_h