Newer
Older
#ifndef selxItkImageSourceFixed_h
#define selxItkImageSourceFixed_h
#include "ComponentBase.h"
#include "Interfaces.h"
#include <string.h>
#include "elxMacro.h"
namespace selx
{
template<int Dimensionality, class TPixel>
class ItkImageSourceFixedComponent :
public Implements<
Accepting<>,
Providing< SourceInterface, itkImageSourceFixedInterface<Dimensionality, TPixel > >
>
{
public:
elxNewMacro(ItkImageSourceFixedComponent, ComponentBase);
itkStaticConstMacro(Dimensionality, unsigned int, Dimensionality);
ItkImageSourceFixedComponent();
virtual ~ItkImageSourceFixedComponent();
typedef typename itk::ImageSource<itk::Image<TPixel, Dimensionality>> ItkImageSourceFixedType;
virtual typename ItkImageSourceFixedType::Pointer GetItkImageSourceFixed() override;
virtual bool ConnectToOverlordSource(itk::Object::Pointer) override;
virtual bool MeetsCriterion(const CriterionType &criterion) override;
static const char * GetDescription() { return "ItkImageSourceFixed Component"; };
private:
typename ItkImageSourceFixedType::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
}
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
89
90
template <>
inline const std::string
ItkImageSourceFixedComponent<2, float>
::GetPixelTypeNameString()
{
return std::string("float");
}
template <>
inline const std::string
ItkImageSourceFixedComponent<2, double>
::GetPixelTypeNameString()
{
return std::string("double");
}
template <>
inline const std::string
ItkImageSourceFixedComponent<3, float>
::GetPixelTypeNameString()
{
return std::string("float");
}
template <>
inline const std::string
ItkImageSourceFixedComponent<3, double>
::GetPixelTypeNameString()
{
return std::string("double");
}
#ifndef ITK_MANUAL_INSTANTIATION
#include "selxItkImageSourceFixed.hxx"
#endif
#endif // #define selxItkImageSourceFixed_h