19 #ifndef __itkPyBuffer_h
20 #define __itkPyBuffer_h
29 #undef _POSIX_C_SOURCE
33 #include <numpy/arrayobject.h>
49 template <
typename TImage>
68 itkStaticConstMacro(
ImageDimension,
unsigned int, ImageType::ImageDimension);
93 template<>
struct PyTypeTraits<double> {
enum { value = NPY_DOUBLE }; };
94 template<>
struct PyTypeTraits<float> {
enum { value = NPY_FLOAT }; };
96 template<>
struct PyTypeTraits<std::complex<float> > {
enum { value = NPY_COMPLEX64 }; };
97 template<>
struct PyTypeTraits<std::complex<double> > {
enum { value = NPY_COMPLEX128 }; };
99 template<>
struct PyTypeTraits<long long>{
enum { value = NPY_LONGLONG }; };
100 template<>
struct PyTypeTraits<unsigned long long>{
enum { value = NPY_ULONGLONG }; };
103 template<>
struct PyTypeTraits<unsigned long>{
enum { value = NPY_ULONG }; };
106 template<>
struct PyTypeTraits<unsigned int>{
enum { value = NPY_UINT }; };
109 template<>
struct PyTypeTraits<unsigned short>{
enum { value = NPY_USHORT }; };
111 template<>
struct PyTypeTraits<signed char>{
enum { value = NPY_BYTE }; };
112 template<>
struct PyTypeTraits<unsigned char>{
enum { value = NPY_UBYTE }; };
116 #ifndef ITK_MANUAL_INSTANTIATION
117 #include "itkPyBuffer.hxx"
120 #endif // _itkPyBuffer_h
void operator=(const Self &)
ImageType::RegionType RegionType
ImageType::PointType PointType
PixelType::ComponentType ComponentType
DefaultConvertPixelTraits< PixelType >::ComponentType ComponentType
static const unsigned int ImageDimension
ImageType::SizeType SizeType
Helper class for converting C buffers into python arrays.
static const OutputImagePointer GetImageFromArray(PyObject *obj)
ImageType::Pointer ImagePointer
static PyObject * GetArrayFromImage(ImageType *image, bool keepAxes=false)
ImageType::PixelType PixelType
Image< ComponentType, ImageDimension >::Pointer OutputImagePointer
ImageType::IndexType IndexType
ImageType::SpacingType SpacingType