From 75740198fa0c55f8fdcd8b33ddff00071c893a94 Mon Sep 17 00:00:00 2001 From: Leonardo Florez-Valencia Date: Mon, 21 Sep 2015 15:05:00 +0200 Subject: [PATCH] ... --- lib/cpPlugins/Interface/BaseProcessObjects.h | 16 +- lib/cpPlugins/Interface/DataObject.cxx | 30 -- lib/cpPlugins/Interface/DataObject.h | 9 - lib/cpPlugins/Interface/Image.h | 26 -- lib/cpPlugins/Interface/Image.hxx | 164 +++++++++- .../Interface/Instances_itkImage.cxx | 177 +++++++++++ lib/cpPlugins/Interface/Instances_itkMesh.cxx | 22 ++ lib/cpPlugins/Interface/Macros.h | 44 +++ lib/cpPlugins/Interface/Mesh.cxx | 70 ----- lib/cpPlugins/Interface/Mesh.h | 22 -- lib/cpPlugins/Interface/Mesh.hxx | 21 ++ lib/cpPlugins/Interface/Object.h | 1 - lib/cpPlugins/Interface/ProcessObject.h | 1 - lib/cpPlugins/Interface/ProcessObject.hxx | 8 +- lib/cpPlugins/Plugins/CMakeLists.txt | 26 +- lib/cpPlugins/Plugins/Host.cxx | 5 +- lib/cpPlugins/Plugins/ImageReader.cxx | 13 - lib/cpPlugins/Plugins/ImageReader.h | 8 +- lib/cpPlugins/Plugins/Instances_itkImage.cxx | 283 ------------------ lib/cpPlugins/Plugins/Instances_itkMesh.cxx | 16 - lib/cpPlugins/Plugins/MeshReader.cxx | 5 +- 21 files changed, 470 insertions(+), 497 deletions(-) create mode 100644 lib/cpPlugins/Interface/Instances_itkImage.cxx create mode 100644 lib/cpPlugins/Interface/Instances_itkMesh.cxx create mode 100644 lib/cpPlugins/Interface/Macros.h delete mode 100644 lib/cpPlugins/Plugins/Instances_itkImage.cxx delete mode 100644 lib/cpPlugins/Plugins/Instances_itkMesh.cxx diff --git a/lib/cpPlugins/Interface/BaseProcessObjects.h b/lib/cpPlugins/Interface/BaseProcessObjects.h index 688a955..229a0c3 100644 --- a/lib/cpPlugins/Interface/BaseProcessObjects.h +++ b/lib/cpPlugins/Interface/BaseProcessObjects.h @@ -139,10 +139,18 @@ namespace cpPlugins cpPlugins_Interface_Define_ProcessObject( MeshSource, SourceObject ); cpPlugins_Interface_Define_ProcessObject( ImageSink, SinkObject ); cpPlugins_Interface_Define_ProcessObject( MeshSink, SinkObject ); - cpPlugins_Interface_Define_ProcessObject( ImageToImageFilter, FilterObject ); - cpPlugins_Interface_Define_ProcessObject( ImageToMeshFilter, FilterObject ); - cpPlugins_Interface_Define_ProcessObject( MeshToImageFilter, FilterObject ); - cpPlugins_Interface_Define_ProcessObject( MeshToMeshFilter, FilterObject ); + cpPlugins_Interface_Define_ProcessObject( + ImageToImageFilter, FilterObject + ); + cpPlugins_Interface_Define_ProcessObject( + ImageToMeshFilter, FilterObject + ); + cpPlugins_Interface_Define_ProcessObject( + MeshToImageFilter, FilterObject + ); + cpPlugins_Interface_Define_ProcessObject( + MeshToMeshFilter, FilterObject + ); } // ecapseman diff --git a/lib/cpPlugins/Interface/DataObject.cxx b/lib/cpPlugins/Interface/DataObject.cxx index da2cdf0..09df979 100644 --- a/lib/cpPlugins/Interface/DataObject.cxx +++ b/lib/cpPlugins/Interface/DataObject.cxx @@ -2,36 +2,6 @@ #include #include -// ------------------------------------------------------------------------- -/* TODO - itk::DataObject* cpPlugins::Interface::DataObject:: - GetITKDataObject( ) - { - return( this->m_ITKObject.GetPointer( ) ); - } - - // ------------------------------------------------------------------------- - const itk::DataObject* cpPlugins::Interface::DataObject:: - GetITKDataObject( ) const - { - return( this->m_ITKObject.GetPointer( ) ); - } - - // ------------------------------------------------------------------------- - vtkDataObject* cpPlugins::Interface::DataObject:: - GetVTKDataObject( ) - { - return( this->m_VTKObject.GetPointer( ) ); - } - - // ------------------------------------------------------------------------- - const vtkDataObject* cpPlugins::Interface::DataObject:: - GetVTKDataObject( ) const - { - return( this->m_VTKObject.GetPointer( ) ); - } -*/ - // ------------------------------------------------------------------------- cpPlugins::Interface::Object* cpPlugins::Interface::DataObject:: GetSource( ) diff --git a/lib/cpPlugins/Interface/DataObject.h b/lib/cpPlugins/Interface/DataObject.h index be40af5..c08b3a3 100644 --- a/lib/cpPlugins/Interface/DataObject.h +++ b/lib/cpPlugins/Interface/DataObject.h @@ -8,7 +8,6 @@ #include #include -#define ITK_MANUAL_INSTANTIATION #include namespace cpPlugins @@ -30,14 +29,6 @@ namespace cpPlugins itkTypeMacro( DataObject, Object ); public: - /* TODO - virtual itk::DataObject* GetITKDataObject( ); - virtual const itk::DataObject* GetITKDataObject( ) const; - - virtual vtkDataObject* GetVTKDataObject( ); - virtual const vtkDataObject* GetVTKDataObject( ) const; - */ - Object* GetSource( ); const Object* GetSource( ) const; void SetSource( Object* src ); diff --git a/lib/cpPlugins/Interface/Image.h b/lib/cpPlugins/Interface/Image.h index 1da443b..a5beda3 100644 --- a/lib/cpPlugins/Interface/Image.h +++ b/lib/cpPlugins/Interface/Image.h @@ -4,23 +4,10 @@ #include #include -#define ITK_MANUAL_INSTANTIATION #include class vtkImageData; -// ------------------------------------------------------------------------- -/* TODO - #define cpPlugins_Image_Demangle( p, d, o, f, r ) \ - if( dynamic_cast< itk::Image< p, d >* >( o ) != NULL ) \ - r = this->f< itk::Image< p, d > >( o ) - - // ------------------------------------------------------------------------- - #define cpPlugins_Image_Array_Demangle( a, p, da, di, o, f, r ) \ - if( dynamic_cast< itk::Image< a< p, da >, di >* >( o ) != NULL ) \ - r = this->f< itk::Image< a< p, da >, di > >( o ) -*/ - // ------------------------------------------------------------------------- namespace cpPlugins { @@ -42,11 +29,6 @@ namespace cpPlugins itkTypeMacro( Image, DataObject ); public: - /* - virtual void SetITKDataObject( itk::DataObject* o ); - virtual void SetVTKDataObject( vtkDataObject* o ); - */ - template< class I > inline void SetITKImage( itk::DataObject* object ); @@ -67,14 +49,6 @@ namespace cpPlugins template< class P, unsigned int D > inline void _ITK_2_VTK( itk::DataObject* object ); - /* TODO - template< unsigned int D > - bool _Dim( itk::DataObject* o ); - - template< class I > - bool _Type( itk::DataObject* o ); - */ - private: // Purposely not implemented Image( const Self& ); diff --git a/lib/cpPlugins/Interface/Image.hxx b/lib/cpPlugins/Interface/Image.hxx index bb1c667..640e01c 100644 --- a/lib/cpPlugins/Interface/Image.hxx +++ b/lib/cpPlugins/Interface/Image.hxx @@ -1,7 +1,8 @@ #ifndef __CPPLUGINS__INTERFACE__IMAGE__HXX__ #define __CPPLUGINS__INTERFACE__IMAGE__HXX__ -#define ITK_MANUAL_INSTANTIATION +#include + #include #include @@ -74,6 +75,167 @@ TI, itk::SymmetricSecondRankTensor, double, D, D, o \ ) +// ------------------------------------------------------------------------- +#define cpPlugins_Image_Import( T, D ) \ + cpPlugins_TEMPLATE_IMPORT( \ + 2(class cpPlugins_Interface_EXPORT itk::Image< T, D >) \ + ) + +// ------------------------------------------------------------------------- +#define cpPlugins_VTKImage_Import( T, D ) \ + cpPlugins_TEMPLATE_IMPORT( \ + 2( \ + class cpPlugins_Interface_EXPORT \ + itk::ImageToVTKImageFilter< itk::Image< T, D > > \ + ) \ + ) + +// ------------------------------------------------------------------------- +#define cpPlugins_ImageArray_Import( A, T, DA, DI ) \ + cpPlugins_TEMPLATE_IMPORT( \ + 3( \ + class cpPlugins_Interface_EXPORT \ + itk::Image< itk::A< T, DA >, DI > \ + ) \ + ) + +// ------------------------------------------------------------------------- +#define cpPlugins_VTKImageArray_Import( A, T, DA, DI ) \ + cpPlugins_TEMPLATE_IMPORT( \ + 3( \ + class cpPlugins_Interface_EXPORT \ + itk::ImageToVTKImageFilter< itk::Image< itk::A< T, DA >, DI > > \ + ) \ + ) + +// ------------------------------------------------------------------------- +#define cpPlugins_Image_Import_AllDimensions( T ) \ + cpPlugins_Image_Import( T, 2 ); \ + cpPlugins_Image_Import( T, 3 ); \ + cpPlugins_Image_Import( T, 4 ) + +// ------------------------------------------------------------------------- +#define cpPlugins_VTKImage_Import_AllDimensions( T ) \ + cpPlugins_VTKImage_Import( T, 2 ); \ + cpPlugins_VTKImage_Import( T, 3 ) + +// ------------------------------------------------------------------------- +#define cpPlugins_ImageArray_Import_AllDimensions( A, T ) \ + cpPlugins_ImageArray_Import( A, T, 2, 2 ); \ + cpPlugins_ImageArray_Import( A, T, 3, 3 ); \ + cpPlugins_ImageArray_Import( A, T, 4, 4 ) + +// ------------------------------------------------------------------------- +#define cpPlugins_VTKImageArray_Import_AllDimensions( A, T ) \ + cpPlugins_VTKImageArray_Import( A, T, 2, 2 ); \ + cpPlugins_VTKImageArray_Import( A, T, 3, 3 ) + +// ------------------------------------------------------------------------- +// ITK base clases +cpPlugins_Image_Import_AllDimensions( char ); +cpPlugins_Image_Import_AllDimensions( short ); +cpPlugins_Image_Import_AllDimensions( int ); +cpPlugins_Image_Import_AllDimensions( long ); +cpPlugins_Image_Import_AllDimensions( unsigned char ); +cpPlugins_Image_Import_AllDimensions( unsigned short ); +cpPlugins_Image_Import_AllDimensions( unsigned int ); +cpPlugins_Image_Import_AllDimensions( unsigned long ); +cpPlugins_Image_Import_AllDimensions( float ); +cpPlugins_Image_Import_AllDimensions( double ); + +cpPlugins_Image_Import_AllDimensions( std::complex< float > ); +cpPlugins_Image_Import_AllDimensions( std::complex< double > ); + +cpPlugins_Image_Import_AllDimensions( itk::RGBPixel< char > ); +cpPlugins_Image_Import_AllDimensions( itk::RGBPixel< short > ); +cpPlugins_Image_Import_AllDimensions( itk::RGBPixel< int > ); +cpPlugins_Image_Import_AllDimensions( itk::RGBPixel< long > ); +cpPlugins_Image_Import_AllDimensions( itk::RGBPixel< unsigned char > ); +cpPlugins_Image_Import_AllDimensions( itk::RGBPixel< unsigned short > ); +cpPlugins_Image_Import_AllDimensions( itk::RGBPixel< unsigned int > ); +cpPlugins_Image_Import_AllDimensions( itk::RGBPixel< unsigned long > ); + +cpPlugins_Image_Import_AllDimensions( itk::RGBAPixel< char > ); +cpPlugins_Image_Import_AllDimensions( itk::RGBAPixel< short > ); +cpPlugins_Image_Import_AllDimensions( itk::RGBAPixel< int > ); +cpPlugins_Image_Import_AllDimensions( itk::RGBAPixel< long > ); +cpPlugins_Image_Import_AllDimensions( itk::RGBAPixel< unsigned char > ); +cpPlugins_Image_Import_AllDimensions( itk::RGBAPixel< unsigned short > ); +cpPlugins_Image_Import_AllDimensions( itk::RGBAPixel< unsigned int > ); +cpPlugins_Image_Import_AllDimensions( itk::RGBAPixel< unsigned long > ); + +cpPlugins_ImageArray_Import_AllDimensions( Vector, float ); +cpPlugins_ImageArray_Import_AllDimensions( Vector, double ); + +cpPlugins_ImageArray_Import_AllDimensions( CovariantVector, float ); +cpPlugins_ImageArray_Import_AllDimensions( CovariantVector, double ); + +cpPlugins_ImageArray_Import_AllDimensions( Point, float ); +cpPlugins_ImageArray_Import_AllDimensions( Point, double ); + +cpPlugins_ImageArray_Import_AllDimensions( + SymmetricSecondRankTensor, float + ); +cpPlugins_ImageArray_Import_AllDimensions( + SymmetricSecondRankTensor, double + ); + +cpPlugins_Image_Import( itk::DiffusionTensor3D< float >, 3 ); +cpPlugins_Image_Import( itk::DiffusionTensor3D< double >, 3 ); +cpPlugins_Image_Import( itk::Offset< 2 >, 2 ); +cpPlugins_Image_Import( itk::Offset< 3 >, 3 ); +cpPlugins_Image_Import( itk::Offset< 4 >, 4 ); + +// ------------------------------------------------------------------------- +// ITK<->VTK base clases +cpPlugins_VTKImage_Import_AllDimensions( char ); +cpPlugins_VTKImage_Import_AllDimensions( short ); +cpPlugins_VTKImage_Import_AllDimensions( int ); +cpPlugins_VTKImage_Import_AllDimensions( long ); +cpPlugins_VTKImage_Import_AllDimensions( unsigned char ); +cpPlugins_VTKImage_Import_AllDimensions( unsigned short ); +cpPlugins_VTKImage_Import_AllDimensions( unsigned int ); +cpPlugins_VTKImage_Import_AllDimensions( unsigned long ); +cpPlugins_VTKImage_Import_AllDimensions( float ); +cpPlugins_VTKImage_Import_AllDimensions( double ); + +cpPlugins_VTKImage_Import_AllDimensions( itk::RGBPixel< char > ); +cpPlugins_VTKImage_Import_AllDimensions( itk::RGBPixel< short > ); +cpPlugins_VTKImage_Import_AllDimensions( itk::RGBPixel< int > ); +cpPlugins_VTKImage_Import_AllDimensions( itk::RGBPixel< long > ); +cpPlugins_VTKImage_Import_AllDimensions( itk::RGBPixel< unsigned char > ); +cpPlugins_VTKImage_Import_AllDimensions( itk::RGBPixel< unsigned short > ); +cpPlugins_VTKImage_Import_AllDimensions( itk::RGBPixel< unsigned int > ); +cpPlugins_VTKImage_Import_AllDimensions( itk::RGBPixel< unsigned long > ); + +cpPlugins_VTKImage_Import_AllDimensions( itk::RGBAPixel< char > ); +cpPlugins_VTKImage_Import_AllDimensions( itk::RGBAPixel< short > ); +cpPlugins_VTKImage_Import_AllDimensions( itk::RGBAPixel< int > ); +cpPlugins_VTKImage_Import_AllDimensions( itk::RGBAPixel< long > ); +cpPlugins_VTKImage_Import_AllDimensions( itk::RGBAPixel< unsigned char > ); +cpPlugins_VTKImage_Import_AllDimensions( itk::RGBAPixel< unsigned short > ); +cpPlugins_VTKImage_Import_AllDimensions( itk::RGBAPixel< unsigned int > ); +cpPlugins_VTKImage_Import_AllDimensions( itk::RGBAPixel< unsigned long > ); + +cpPlugins_VTKImageArray_Import_AllDimensions( Vector, float ); +cpPlugins_VTKImageArray_Import_AllDimensions( Vector, double ); + +cpPlugins_VTKImageArray_Import_AllDimensions( CovariantVector, float ); +cpPlugins_VTKImageArray_Import_AllDimensions( CovariantVector, double ); + +cpPlugins_VTKImageArray_Import_AllDimensions( Point, float ); +cpPlugins_VTKImageArray_Import_AllDimensions( Point, double ); + +cpPlugins_VTKImageArray_Import_AllDimensions( + SymmetricSecondRankTensor, float + ); +cpPlugins_VTKImageArray_Import_AllDimensions( + SymmetricSecondRankTensor, double + ); + +cpPlugins_VTKImage_Import( itk::DiffusionTensor3D< float >, 3 ); +cpPlugins_VTKImage_Import( itk::DiffusionTensor3D< double >, 3 ); + // ------------------------------------------------------------------------- template< class I > void cpPlugins::Interface::Image:: diff --git a/lib/cpPlugins/Interface/Instances_itkImage.cxx b/lib/cpPlugins/Interface/Instances_itkImage.cxx new file mode 100644 index 0000000..a040f44 --- /dev/null +++ b/lib/cpPlugins/Interface/Instances_itkImage.cxx @@ -0,0 +1,177 @@ +#include + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +// ------------------------------------------------------------------------- +#define cpPlugins_Image_Export( T, D ) \ + cpPlugins_TEMPLATE_EXPORT( \ + 2(class cpPlugins_Interface_EXPORT itk::Image< T, D >) \ + ) + +// ------------------------------------------------------------------------- +#define cpPlugins_VTKImage_Export( T, D ) \ + cpPlugins_TEMPLATE_EXPORT( \ + 2( \ + class cpPlugins_Interface_EXPORT \ + itk::ImageToVTKImageFilter< itk::Image< T, D > > \ + ) \ + ) + +// ------------------------------------------------------------------------- +#define cpPlugins_ImageArray_Export( A, T, DA, DI ) \ + cpPlugins_TEMPLATE_EXPORT( \ + 3( \ + class cpPlugins_Interface_EXPORT \ + itk::Image< itk::A< T, DA >, DI > \ + ) \ + ) + +// ------------------------------------------------------------------------- +#define cpPlugins_VTKImageArray_Export( A, T, DA, DI ) \ + cpPlugins_TEMPLATE_EXPORT( \ + 3( \ + class cpPlugins_Interface_EXPORT \ + itk::ImageToVTKImageFilter< itk::Image< itk::A< T, DA >, DI > > \ + ) \ + ) + +// ------------------------------------------------------------------------- +#define cpPlugins_Image_Export_AllDimensions( T ) \ + cpPlugins_Image_Export( T, 2 ); \ + cpPlugins_Image_Export( T, 3 ); \ + cpPlugins_Image_Export( T, 4 ) + +// ------------------------------------------------------------------------- +#define cpPlugins_VTKImage_Export_AllDimensions( T ) \ + cpPlugins_VTKImage_Export( T, 2 ); \ + cpPlugins_VTKImage_Export( T, 3 ) + +// ------------------------------------------------------------------------- +#define cpPlugins_ImageArray_Export_AllDimensions( A, T ) \ + cpPlugins_ImageArray_Export( A, T, 2, 2 ); \ + cpPlugins_ImageArray_Export( A, T, 3, 3 ); \ + cpPlugins_ImageArray_Export( A, T, 4, 4 ) + +// ------------------------------------------------------------------------- +#define cpPlugins_VTKImageArray_Export_AllDimensions( A, T ) \ + cpPlugins_VTKImageArray_Export( A, T, 2, 2 ); \ + cpPlugins_VTKImageArray_Export( A, T, 3, 3 ) + +// ------------------------------------------------------------------------- +// ITK base clases +cpPlugins_Image_Export_AllDimensions( char ); +cpPlugins_Image_Export_AllDimensions( short ); +cpPlugins_Image_Export_AllDimensions( int ); +cpPlugins_Image_Export_AllDimensions( long ); +cpPlugins_Image_Export_AllDimensions( unsigned char ); +cpPlugins_Image_Export_AllDimensions( unsigned short ); +cpPlugins_Image_Export_AllDimensions( unsigned int ); +cpPlugins_Image_Export_AllDimensions( unsigned long ); +cpPlugins_Image_Export_AllDimensions( float ); +cpPlugins_Image_Export_AllDimensions( double ); + +cpPlugins_Image_Export_AllDimensions( std::complex< float > ); +cpPlugins_Image_Export_AllDimensions( std::complex< double > ); + +cpPlugins_Image_Export_AllDimensions( itk::RGBPixel< char > ); +cpPlugins_Image_Export_AllDimensions( itk::RGBPixel< short > ); +cpPlugins_Image_Export_AllDimensions( itk::RGBPixel< int > ); +cpPlugins_Image_Export_AllDimensions( itk::RGBPixel< long > ); +cpPlugins_Image_Export_AllDimensions( itk::RGBPixel< unsigned char > ); +cpPlugins_Image_Export_AllDimensions( itk::RGBPixel< unsigned short > ); +cpPlugins_Image_Export_AllDimensions( itk::RGBPixel< unsigned int > ); +cpPlugins_Image_Export_AllDimensions( itk::RGBPixel< unsigned long > ); + +cpPlugins_Image_Export_AllDimensions( itk::RGBAPixel< char > ); +cpPlugins_Image_Export_AllDimensions( itk::RGBAPixel< short > ); +cpPlugins_Image_Export_AllDimensions( itk::RGBAPixel< int > ); +cpPlugins_Image_Export_AllDimensions( itk::RGBAPixel< long > ); +cpPlugins_Image_Export_AllDimensions( itk::RGBAPixel< unsigned char > ); +cpPlugins_Image_Export_AllDimensions( itk::RGBAPixel< unsigned short > ); +cpPlugins_Image_Export_AllDimensions( itk::RGBAPixel< unsigned int > ); +cpPlugins_Image_Export_AllDimensions( itk::RGBAPixel< unsigned long > ); + +cpPlugins_ImageArray_Export_AllDimensions( Vector, float ); +cpPlugins_ImageArray_Export_AllDimensions( Vector, double ); + +cpPlugins_ImageArray_Export_AllDimensions( CovariantVector, float ); +cpPlugins_ImageArray_Export_AllDimensions( CovariantVector, double ); + +cpPlugins_ImageArray_Export_AllDimensions( Point, float ); +cpPlugins_ImageArray_Export_AllDimensions( Point, double ); + +cpPlugins_ImageArray_Export_AllDimensions( + SymmetricSecondRankTensor, float + ); +cpPlugins_ImageArray_Export_AllDimensions( + SymmetricSecondRankTensor, double + ); + +cpPlugins_Image_Export( itk::DiffusionTensor3D< float >, 3 ); +cpPlugins_Image_Export( itk::DiffusionTensor3D< double >, 3 ); +cpPlugins_Image_Export( itk::Offset< 2 >, 2 ); +cpPlugins_Image_Export( itk::Offset< 3 >, 3 ); +cpPlugins_Image_Export( itk::Offset< 4 >, 4 ); + +// ------------------------------------------------------------------------- +// ITK<->VTK base clases +cpPlugins_VTKImage_Export_AllDimensions( char ); +cpPlugins_VTKImage_Export_AllDimensions( short ); +cpPlugins_VTKImage_Export_AllDimensions( int ); +cpPlugins_VTKImage_Export_AllDimensions( long ); +cpPlugins_VTKImage_Export_AllDimensions( unsigned char ); +cpPlugins_VTKImage_Export_AllDimensions( unsigned short ); +cpPlugins_VTKImage_Export_AllDimensions( unsigned int ); +cpPlugins_VTKImage_Export_AllDimensions( unsigned long ); +cpPlugins_VTKImage_Export_AllDimensions( float ); +cpPlugins_VTKImage_Export_AllDimensions( double ); + +cpPlugins_VTKImage_Export_AllDimensions( itk::RGBPixel< char > ); +cpPlugins_VTKImage_Export_AllDimensions( itk::RGBPixel< short > ); +cpPlugins_VTKImage_Export_AllDimensions( itk::RGBPixel< int > ); +cpPlugins_VTKImage_Export_AllDimensions( itk::RGBPixel< long > ); +cpPlugins_VTKImage_Export_AllDimensions( itk::RGBPixel< unsigned char > ); +cpPlugins_VTKImage_Export_AllDimensions( itk::RGBPixel< unsigned short > ); +cpPlugins_VTKImage_Export_AllDimensions( itk::RGBPixel< unsigned int > ); +cpPlugins_VTKImage_Export_AllDimensions( itk::RGBPixel< unsigned long > ); + +cpPlugins_VTKImage_Export_AllDimensions( itk::RGBAPixel< char > ); +cpPlugins_VTKImage_Export_AllDimensions( itk::RGBAPixel< short > ); +cpPlugins_VTKImage_Export_AllDimensions( itk::RGBAPixel< int > ); +cpPlugins_VTKImage_Export_AllDimensions( itk::RGBAPixel< long > ); +cpPlugins_VTKImage_Export_AllDimensions( itk::RGBAPixel< unsigned char > ); +cpPlugins_VTKImage_Export_AllDimensions( itk::RGBAPixel< unsigned short > ); +cpPlugins_VTKImage_Export_AllDimensions( itk::RGBAPixel< unsigned int > ); +cpPlugins_VTKImage_Export_AllDimensions( itk::RGBAPixel< unsigned long > ); + +cpPlugins_VTKImageArray_Export_AllDimensions( Vector, float ); +cpPlugins_VTKImageArray_Export_AllDimensions( Vector, double ); + +cpPlugins_VTKImageArray_Export_AllDimensions( CovariantVector, float ); +cpPlugins_VTKImageArray_Export_AllDimensions( CovariantVector, double ); + +cpPlugins_VTKImageArray_Export_AllDimensions( Point, float ); +cpPlugins_VTKImageArray_Export_AllDimensions( Point, double ); + +cpPlugins_VTKImageArray_Export_AllDimensions( + SymmetricSecondRankTensor, float + ); +cpPlugins_VTKImageArray_Export_AllDimensions( + SymmetricSecondRankTensor, double + ); + +cpPlugins_VTKImage_Export( itk::DiffusionTensor3D< float >, 3 ); +cpPlugins_VTKImage_Export( itk::DiffusionTensor3D< double >, 3 ); + +// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/Instances_itkMesh.cxx b/lib/cpPlugins/Interface/Instances_itkMesh.cxx new file mode 100644 index 0000000..a7d3df4 --- /dev/null +++ b/lib/cpPlugins/Interface/Instances_itkMesh.cxx @@ -0,0 +1,22 @@ +#include + +#include +#include + +// ------------------------------------------------------------------------- +#define cpPlugins_Mesh_Export( N, T, D ) \ + cpPlugins_TEMPLATE_EXPORT( \ + 2(class cpPlugins_Interface_EXPORT itk::N< T, D >) \ + ) + +// ------------------------------------------------------------------------- +cpPlugins_Mesh_Export( Mesh, float, 2 ); +cpPlugins_Mesh_Export( Mesh, double, 2 ); +cpPlugins_Mesh_Export( Mesh, float, 3 ); +cpPlugins_Mesh_Export( Mesh, double, 3 ); +cpPlugins_Mesh_Export( QuadEdgeMesh, float, 2 ); +cpPlugins_Mesh_Export( QuadEdgeMesh, double, 2 ); +cpPlugins_Mesh_Export( QuadEdgeMesh, float, 3 ); +cpPlugins_Mesh_Export( QuadEdgeMesh, double, 3 ); + +// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/Macros.h b/lib/cpPlugins/Interface/Macros.h new file mode 100644 index 0000000..0a6bd60 --- /dev/null +++ b/lib/cpPlugins/Interface/Macros.h @@ -0,0 +1,44 @@ +#ifndef __CPPLUGINS__INTERFACE__MACROS__H__ +#define __CPPLUGINS__INTERFACE__MACROS__H__ + +#include + +/** + * Based upon: http://www.itk.org/Wiki/Proposals:Explicit_Instantiation + */ + +// ------------------------------------------------------------------------- +#define cpPlugins_TEMPLATE_1( X1 ) \ + X1 +#define cpPlugins_TEMPLATE_2( X1, X2 ) \ + X1,X2 +#define cpPlugins_TEMPLATE_3( X1, X2, X3 ) \ + X1,X2,X3 +#define cpPlugins_TEMPLATE_4( X1, X2, X3, X4 ) \ + X1,X2,X3,X4 +#define cpPlugins_TEMPLATE_5( X1, X2, X3, X4, X5 ) \ + X1,X2,X3,X4,X5 +#define cpPlugins_TEMPLATE_6( X1, X2, X3, X4, X5, X6 ) \ + X1,X2,X3,X4,X5,X6 +#define cpPlugins_TEMPLATE_7( X1, X2, X3, X4, X5, X6, X7 ) \ + X1,X2,X3,X4,X5,X6,X7 +#define cpPlugins_TEMPLATE_8( X1, X2, X3, X4, X5, X6, X7, X8 ) \ + X1,X2,X3,X4,X5,X6,X7,X8 +#define cpPlugins_TEMPLATE_9( X1, X2, X3, X4, X5, X6, X7, X8, X9 ) \ + X1,X2,X3,X4,X5,X6,X7,X8,X9 + +#define cpPlugins_TEMPLATE_EXPORT( X ) \ + template cpPlugins_TEMPLATE_##X; +#define cpPlugins_TEMPLATE_IMPORT( X ) \ + extern template cpPlugins_TEMPLATE_##X; + +/* TODO + #define cpPlugins_EXPORT_TEMPLATE( E, c, T ) \ + cpPlugins_TEMPLATE_##c( cpPlugins_TEMPLATE_EXPORT, E, T ) + #define cpPlugins_IMPORT_TEMPLATE( E, c, T ) \ + cpPlugins_TEMPLATE_##c( cpPlugins_TEMPLATE_IMPORT, E, T ) +*/ + +#endif // __CPPLUGINS__INTERFACE__MACROS__H__ + +// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/Mesh.cxx b/lib/cpPlugins/Interface/Mesh.cxx index 55114dd..0f74681 100644 --- a/lib/cpPlugins/Interface/Mesh.cxx +++ b/lib/cpPlugins/Interface/Mesh.cxx @@ -26,46 +26,6 @@ GetVTKMesh( ) const ); } -/* -void cpPlugins::Interface::Mesh:: -SetITKDataObject( itk::DataObject* o ) -{ - // TODO: conversion!!! - std::cout << "Mesh: SetITKDataObject " << std::endl; - std::exit( 1 ); -} - -// ------------------------------------------------------------------------- -void cpPlugins::Interface::Mesh:: -SetVTKDataObject( vtkDataObject* o ) -{ - if( dynamic_cast< vtkPolyData* >( o ) != NULL ) - { - this->m_VTKObject = o; - - // TODO: conversion!!! - } - else - this->m_VTKObject = NULL; -} - -// ------------------------------------------------------------------------- -vtkPolyData* cpPlugins::Interface::Mesh:: -GetVTKPolyData( ) -{ - return( dynamic_cast< vtkPolyData* >( this->m_VTKObject.GetPointer( ) ) ); -} - -// ------------------------------------------------------------------------- -const vtkPolyData* cpPlugins::Interface::Mesh:: -GetVTKPolyData( ) const -{ - return( - dynamic_cast< const vtkPolyData* >( this->m_VTKObject.GetPointer( ) ) - ); -} -*/ - // ------------------------------------------------------------------------- cpPlugins::Interface::Mesh:: Mesh( ) @@ -81,34 +41,4 @@ cpPlugins::Interface::Mesh:: { } -// ------------------------------------------------------------------------- -/* TODO -template< unsigned int D > -void cpPlugins::Interface::Mesh:: -_ITK_2_VTK_0( itk::DataObject* o ) -{ -} - -// ------------------------------------------------------------------------- -template< class P, unsigned int D > -void cpPlugins::Interface::Mesh:: -_ITK_2_VTK_1( itk::DataObject* o ) -{ -} - -// ------------------------------------------------------------------------- -template< unsigned int D > -void cpPlugins::Interface::Mesh:: -_VTK_2_ITK_0( itk::DataObject* o ) -{ -} - -// ------------------------------------------------------------------------- -template< class P, unsigned int D > -void cpPlugins::Interface::Mesh:: -_VTK_2_ITK_1( itk::DataObject* o ) -{ -} -*/ - // eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/Mesh.h b/lib/cpPlugins/Interface/Mesh.h index 11a52e8..c934f33 100644 --- a/lib/cpPlugins/Interface/Mesh.h +++ b/lib/cpPlugins/Interface/Mesh.h @@ -39,32 +39,10 @@ namespace cpPlugins virtual vtkPolyData* GetVTKMesh( ); virtual const vtkPolyData* GetVTKMesh( ) const; - /* TODO - virtual void SetITKDataObject( itk::DataObject* o ); - virtual void SetVTKDataObject( vtkDataObject* o ); - - vtkPolyData* GetVTKPolyData( ); - const vtkPolyData* GetVTKPolyData( ) const; - */ - protected: Mesh( ); virtual ~Mesh( ); - /* TODO - template< unsigned int D > - void _ITK_2_VTK_0( itk::DataObject* o ); - - template< class P, unsigned int D > - void _ITK_2_VTK_1( itk::DataObject* o ); - - template< unsigned int D > - void _VTK_2_ITK_0( itk::DataObject* o ); - - template< class P, unsigned int D > - void _VTK_2_ITK_1( itk::DataObject* o ); - */ - private: // Purposely not implemented Mesh( const Self& ); diff --git a/lib/cpPlugins/Interface/Mesh.hxx b/lib/cpPlugins/Interface/Mesh.hxx index 980321d..9163971 100644 --- a/lib/cpPlugins/Interface/Mesh.hxx +++ b/lib/cpPlugins/Interface/Mesh.hxx @@ -1,6 +1,27 @@ #ifndef __CPPLUGINS__INTERFACE__MESH__HXX__ #define __CPPLUGINS__INTERFACE__MESH__HXX__ +#include + +#include +#include + +// ------------------------------------------------------------------------- +#define cpPlugins_Mesh_Import( N, T, D ) \ + cpPlugins_TEMPLATE_IMPORT( \ + 2(class cpPlugins_Interface_EXPORT itk::N< T, D >) \ + ) + +// ------------------------------------------------------------------------- +cpPlugins_Mesh_Import( Mesh, float, 2 ); +cpPlugins_Mesh_Import( Mesh, double, 2 ); +cpPlugins_Mesh_Import( Mesh, float, 3 ); +cpPlugins_Mesh_Import( Mesh, double, 3 ); +cpPlugins_Mesh_Import( QuadEdgeMesh, float, 2 ); +cpPlugins_Mesh_Import( QuadEdgeMesh, double, 2 ); +cpPlugins_Mesh_Import( QuadEdgeMesh, float, 3 ); +cpPlugins_Mesh_Import( QuadEdgeMesh, double, 3 ); + // ------------------------------------------------------------------------- template< class M > void cpPlugins::Interface::Mesh:: diff --git a/lib/cpPlugins/Interface/Object.h b/lib/cpPlugins/Interface/Object.h index bcb7e60..6e273f1 100644 --- a/lib/cpPlugins/Interface/Object.h +++ b/lib/cpPlugins/Interface/Object.h @@ -5,7 +5,6 @@ #include #include -#define ITK_MANUAL_INSTANTIATION #include #include diff --git a/lib/cpPlugins/Interface/ProcessObject.h b/lib/cpPlugins/Interface/ProcessObject.h index ee5bedd..d25516d 100644 --- a/lib/cpPlugins/Interface/ProcessObject.h +++ b/lib/cpPlugins/Interface/ProcessObject.h @@ -6,7 +6,6 @@ #include #include -#define ITK_MANUAL_INSTANTIATION #include namespace cpPlugins diff --git a/lib/cpPlugins/Interface/ProcessObject.hxx b/lib/cpPlugins/Interface/ProcessObject.hxx index 7b4e080..a4a417b 100644 --- a/lib/cpPlugins/Interface/ProcessObject.hxx +++ b/lib/cpPlugins/Interface/ProcessObject.hxx @@ -29,7 +29,9 @@ const T* cpPlugins::Interface::ProcessObject:: _Input( unsigned int idx ) const { if( idx < this->m_Inputs.size( ) ) - return( dynamic_cast< const T* >( this->m_Inputs[ idx ].GetPointer( ) ) ); + return( + dynamic_cast< const T* >( this->m_Inputs[ idx ].GetPointer( ) ) + ); else return( NULL ); } @@ -51,7 +53,9 @@ const T* cpPlugins::Interface::ProcessObject:: _Output( unsigned int idx ) const { if( idx < this->m_Outputs.size( ) ) - return( dynamic_cast< const T* >( this->m_Outputs[ idx ].GetPointer( ) ) ); + return( + dynamic_cast< const T* >( this->m_Outputs[ idx ].GetPointer( ) ) + ); else return( NULL ); } diff --git a/lib/cpPlugins/Plugins/CMakeLists.txt b/lib/cpPlugins/Plugins/CMakeLists.txt index 21a1217..4bac628 100644 --- a/lib/cpPlugins/Plugins/CMakeLists.txt +++ b/lib/cpPlugins/Plugins/CMakeLists.txt @@ -15,23 +15,21 @@ SET(LIBRARY_NAME cpPlugins) SET( LIB_HEADERS_H ImageReader.h - ImageWriter.h - MeshReader.h - MeshWriter.h - MarchingCubes.h - OtsuThresholdImageFilter.h + #ImageWriter.h + #MeshReader.h + #MeshWriter.h + #MarchingCubes.h + #OtsuThresholdImageFilter.h ) SET( LIB_SOURCES_CXX - Instances_itkImage.cxx - Instances_itkMesh.cxx Host.cxx ImageReader.cxx - ImageWriter.cxx - MeshReader.cxx - MeshWriter.cxx - MarchingCubes.cxx - OtsuThresholdImageFilter.cxx + #ImageWriter.cxx + #MeshReader.cxx + #MeshWriter.cxx + #MarchingCubes.cxx + #OtsuThresholdImageFilter.cxx ) ## ===================== @@ -55,8 +53,8 @@ GENERATE_EXPORT_HEADER( TARGET_LINK_LIBRARIES( ${LIBRARY_NAME} cpPlugins_Interface - ${ITK_LIBRARIES} - ${VTK_LIBRARIES} + #${ITK_LIBRARIES} + #${VTK_LIBRARIES} ) ## ======================== diff --git a/lib/cpPlugins/Plugins/Host.cxx b/lib/cpPlugins/Plugins/Host.cxx index fdf703d..c74bd45 100644 --- a/lib/cpPlugins/Plugins/Host.cxx +++ b/lib/cpPlugins/Plugins/Host.cxx @@ -1,11 +1,12 @@ #include #include +/* #include #include #include #include #include - +*/ /* #include #include @@ -20,11 +21,13 @@ bool connect( pluma::Host& host ) using namespace cpPlugins::Plugins; host.add( new ImageReaderProvider( ) ); + /* host.add( new ImageWriterProvider( ) ); host.add( new MeshReaderProvider( ) ); host.add( new MeshWriterProvider( ) ); host.add( new MarchingCubesProvider( ) ); host.add( new OtsuThresholdImageFilterProvider( ) ); + */ /* host.add( new ImageSeriesReaderProvider( ) ); diff --git a/lib/cpPlugins/Plugins/ImageReader.cxx b/lib/cpPlugins/Plugins/ImageReader.cxx index d4ca0ba..25bdc7a 100644 --- a/lib/cpPlugins/Plugins/ImageReader.cxx +++ b/lib/cpPlugins/Plugins/ImageReader.cxx @@ -1,21 +1,8 @@ #include #include -#include #include -#define ITK_MANUAL_INSTANTIATION -#include - -#include -#include -#include -#include -#include -#include -#include - -#undef ITK_MANUAL_INSTANTIATION #include #include diff --git a/lib/cpPlugins/Plugins/ImageReader.h b/lib/cpPlugins/Plugins/ImageReader.h index 47fff41..1bcf6ae 100644 --- a/lib/cpPlugins/Plugins/ImageReader.h +++ b/lib/cpPlugins/Plugins/ImageReader.h @@ -6,8 +6,10 @@ #include #include -#define ITK_MANUAL_INSTANTIATION -#include +namespace itk +{ + class ImageIOBase; +} namespace cpPlugins { @@ -15,7 +17,7 @@ namespace cpPlugins { /** */ - class /*cpPlugins_EXPORT*/ ImageReader + class cpPlugins_EXPORT ImageReader : public cpPlugins::Interface::ImageSource { public: diff --git a/lib/cpPlugins/Plugins/Instances_itkImage.cxx b/lib/cpPlugins/Plugins/Instances_itkImage.cxx deleted file mode 100644 index ef29677..0000000 --- a/lib/cpPlugins/Plugins/Instances_itkImage.cxx +++ /dev/null @@ -1,283 +0,0 @@ -#include - -#include - -#undef ITK_MANUAL_INSTANTIATION -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -// ------------------------------------------------------------------------- -#define cpPlugins_I_itk( p, d ) \ - template class cpPlugins_EXPORT itk::Image< p, d >; - -// ------------------------------------------------------------------------- -#define cpPlugins_I_itk_array( a, p, da, di ) \ - template class cpPlugins_EXPORT itk::Image< a< p, da >, di >; - -// ------------------------------------------------------------------------- -#define cpPlugins_I_itk_Container( p ) \ - template class cpPlugins_EXPORT \ - itk::ImportImageContainer< itk::SizeValueType, p >; - -// ------------------------------------------------------------------------- -#define cpPlugins_I_itk_array_Container( a, p, d ) \ - template class cpPlugins_EXPORT \ - itk::ImportImageContainer< itk::SizeValueType, a< p, d > >; - -// ------------------------------------------------------------------------- -#define cpPlugins_I_itk_vtk( p, d ) \ - template class cpPlugins_EXPORT \ - itk::ImageToVTKImageFilter< itk::Image< p, d > >; - -// ------------------------------------------------------------------------- -#define cpPlugins_I_itk_vtk_array( a, p, da, di ) \ - template class cpPlugins_EXPORT \ - itk::ImageToVTKImageFilter< itk::Image< a< p, da > , di > >; - -// ------------------------------------------------------------------------- -// Possible itk types - -namespace itk -{ - /* TODO - template cpPlugins_EXPORT std::ostream& operator<<( - std::ostream& os, const ImageRegion< 1 >& obj - ); - template class cpPlugins_EXPORT Point< double, 1 >; - template class cpPlugins_EXPORT Vector< double, 1 >; - */ - -} // ecapseman - -cpPlugins_I_itk_Container( char ); -cpPlugins_I_itk_Container( short ); -cpPlugins_I_itk_Container( int ); -cpPlugins_I_itk_Container( long ); -cpPlugins_I_itk_Container( unsigned char ); -cpPlugins_I_itk_Container( unsigned short ); -cpPlugins_I_itk_Container( unsigned int ); -cpPlugins_I_itk_Container( unsigned long ); -cpPlugins_I_itk_Container( float ); -cpPlugins_I_itk_Container( double ); -cpPlugins_I_itk_Container( std::complex< float > ); -cpPlugins_I_itk_Container( std::complex< double > ); -cpPlugins_I_itk_Container( itk::RGBPixel< char > ); -cpPlugins_I_itk_Container( itk::RGBPixel< short > ); -cpPlugins_I_itk_Container( itk::RGBPixel< unsigned char > ); -cpPlugins_I_itk_Container( itk::RGBPixel< unsigned short > ); -cpPlugins_I_itk_Container( itk::RGBAPixel< char > ); -cpPlugins_I_itk_Container( itk::RGBAPixel< short > ); -cpPlugins_I_itk_Container( itk::RGBAPixel< unsigned char > ); -cpPlugins_I_itk_Container( itk::RGBAPixel< unsigned short > ); -cpPlugins_I_itk_Container( itk::Offset< 2 > ); -cpPlugins_I_itk_Container( itk::Offset< 3 > ); -cpPlugins_I_itk_Container( itk::Offset< 4 > ); -cpPlugins_I_itk_array_Container( itk::Vector, float, 2 ); -cpPlugins_I_itk_array_Container( itk::Vector, double, 2 ); -cpPlugins_I_itk_array_Container( itk::Vector, float, 3 ); -cpPlugins_I_itk_array_Container( itk::Vector, double, 3 ); -cpPlugins_I_itk_array_Container( itk::Vector, float, 4 ); -cpPlugins_I_itk_array_Container( itk::Vector, double, 4 ); -cpPlugins_I_itk_array_Container( itk::Point, float, 2 ); -cpPlugins_I_itk_array_Container( itk::Point, double, 2 ); -cpPlugins_I_itk_array_Container( itk::Point, float, 3 ); -cpPlugins_I_itk_array_Container( itk::Point, double, 3 ); -cpPlugins_I_itk_array_Container( itk::Point, float, 4 ); -cpPlugins_I_itk_array_Container( itk::Point, double, 4 ); -cpPlugins_I_itk_array_Container( itk::CovariantVector, float, 2 ); -cpPlugins_I_itk_array_Container( itk::CovariantVector, double, 2 ); -cpPlugins_I_itk_array_Container( itk::CovariantVector, float, 3 ); -cpPlugins_I_itk_array_Container( itk::CovariantVector, double, 3 ); -cpPlugins_I_itk_array_Container( itk::CovariantVector, float, 4 ); -cpPlugins_I_itk_array_Container( itk::CovariantVector, double, 4 ); -cpPlugins_I_itk_array_Container( itk::SymmetricSecondRankTensor, float, 2 ); -cpPlugins_I_itk_array_Container( itk::SymmetricSecondRankTensor, double, 2 ); -cpPlugins_I_itk_array_Container( itk::SymmetricSecondRankTensor, float, 3 ); -cpPlugins_I_itk_array_Container( itk::SymmetricSecondRankTensor, double, 3 ); -cpPlugins_I_itk_array_Container( itk::SymmetricSecondRankTensor, float, 4 ); -cpPlugins_I_itk_array_Container( itk::SymmetricSecondRankTensor, double, 4 ); -cpPlugins_I_itk_Container( itk::DiffusionTensor3D< float > ); -cpPlugins_I_itk_Container( itk::DiffusionTensor3D< double > ); - -cpPlugins_I_itk( char, 2 ); -cpPlugins_I_itk( short, 2 ); -cpPlugins_I_itk( int, 2 ); -cpPlugins_I_itk( long, 2 ); -cpPlugins_I_itk( unsigned char, 2 ); -cpPlugins_I_itk( unsigned short, 2 ); -cpPlugins_I_itk( unsigned int, 2 ); -cpPlugins_I_itk( unsigned long, 2 ); -cpPlugins_I_itk( float, 2 ); -cpPlugins_I_itk( double, 2 ); - -cpPlugins_I_itk( char, 3 ); -cpPlugins_I_itk( short, 3 ); -cpPlugins_I_itk( int, 3 ); -cpPlugins_I_itk( long, 3 ); -cpPlugins_I_itk( unsigned char, 3 ); -cpPlugins_I_itk( unsigned short, 3 ); -cpPlugins_I_itk( unsigned int, 3 ); -cpPlugins_I_itk( unsigned long, 3 ); -cpPlugins_I_itk( float, 3 ); -cpPlugins_I_itk( double, 3 ); - -cpPlugins_I_itk( char, 4 ); -cpPlugins_I_itk( short, 4 ); -cpPlugins_I_itk( int, 4 ); -cpPlugins_I_itk( long, 4 ); -cpPlugins_I_itk( unsigned char, 4 ); -cpPlugins_I_itk( unsigned short, 4 ); -cpPlugins_I_itk( unsigned int, 4 ); -cpPlugins_I_itk( unsigned long, 4 ); -cpPlugins_I_itk( float, 4 ); -cpPlugins_I_itk( double, 4 ); - -cpPlugins_I_itk( std::complex< float >, 2 ); -cpPlugins_I_itk( std::complex< double >, 2 ); -cpPlugins_I_itk( std::complex< float >, 3 ); -cpPlugins_I_itk( std::complex< double >, 3 ); -cpPlugins_I_itk( std::complex< float >, 4 ); -cpPlugins_I_itk( std::complex< double >, 4 ); - -cpPlugins_I_itk( itk::RGBPixel< char >, 2 ); -cpPlugins_I_itk( itk::RGBPixel< short >, 2 ); -cpPlugins_I_itk( itk::RGBPixel< unsigned char >, 2 ); -cpPlugins_I_itk( itk::RGBPixel< unsigned short >, 2 ); -cpPlugins_I_itk( itk::RGBPixel< char >, 3 ); -cpPlugins_I_itk( itk::RGBPixel< short >, 3 ); -cpPlugins_I_itk( itk::RGBPixel< unsigned char >, 3 ); -cpPlugins_I_itk( itk::RGBPixel< unsigned short >, 3 ); -cpPlugins_I_itk( itk::RGBPixel< char >, 4 ); -cpPlugins_I_itk( itk::RGBPixel< short >, 4 ); -cpPlugins_I_itk( itk::RGBPixel< unsigned char >, 4 ); -cpPlugins_I_itk( itk::RGBPixel< unsigned short >, 4 ); - -cpPlugins_I_itk( itk::RGBAPixel< char >, 2 ); -cpPlugins_I_itk( itk::RGBAPixel< short >, 2 ); -cpPlugins_I_itk( itk::RGBAPixel< unsigned char >, 2 ); -cpPlugins_I_itk( itk::RGBAPixel< unsigned short >, 2 ); -cpPlugins_I_itk( itk::RGBAPixel< char >, 3 ); -cpPlugins_I_itk( itk::RGBAPixel< short >, 3 ); -cpPlugins_I_itk( itk::RGBAPixel< unsigned char >, 3 ); -cpPlugins_I_itk( itk::RGBAPixel< unsigned short >, 3 ); -cpPlugins_I_itk( itk::RGBAPixel< char >, 4 ); -cpPlugins_I_itk( itk::RGBAPixel< short >, 4 ); -cpPlugins_I_itk( itk::RGBAPixel< unsigned char >, 4 ); -cpPlugins_I_itk( itk::RGBAPixel< unsigned short >, 4 ); - -cpPlugins_I_itk( itk::Offset< 2 >, 2 ); -cpPlugins_I_itk( itk::Offset< 3 >, 3 ); -cpPlugins_I_itk( itk::Offset< 4 >, 4 ); - -cpPlugins_I_itk_array( itk::Vector, float, 2, 2 ); -cpPlugins_I_itk_array( itk::Vector, double, 2, 2 ); -cpPlugins_I_itk_array( itk::Vector, float, 3, 3 ); -cpPlugins_I_itk_array( itk::Vector, double, 3, 3 ); -cpPlugins_I_itk_array( itk::Vector, float, 4, 4 ); -cpPlugins_I_itk_array( itk::Vector, double, 4, 4 ); - -cpPlugins_I_itk_array( itk::Point, float, 2, 2 ); -cpPlugins_I_itk_array( itk::Point, double, 2, 2 ); -cpPlugins_I_itk_array( itk::Point, float, 3, 3 ); -cpPlugins_I_itk_array( itk::Point, double, 3, 3 ); -cpPlugins_I_itk_array( itk::Point, float, 4, 4 ); -cpPlugins_I_itk_array( itk::Point, double, 4, 4 ); - -cpPlugins_I_itk_array( itk::CovariantVector, float, 2, 2 ); -cpPlugins_I_itk_array( itk::CovariantVector, double, 2, 2 ); -cpPlugins_I_itk_array( itk::CovariantVector, float, 3, 3 ); -cpPlugins_I_itk_array( itk::CovariantVector, double, 3, 3 ); -cpPlugins_I_itk_array( itk::CovariantVector, float, 4, 4 ); -cpPlugins_I_itk_array( itk::CovariantVector, double, 4, 4 ); - -cpPlugins_I_itk_array( itk::SymmetricSecondRankTensor, float, 2, 2 ); -cpPlugins_I_itk_array( itk::SymmetricSecondRankTensor, double, 2, 2 ); -cpPlugins_I_itk_array( itk::SymmetricSecondRankTensor, float, 3, 3 ); -cpPlugins_I_itk_array( itk::SymmetricSecondRankTensor, double, 3, 3 ); -cpPlugins_I_itk_array( itk::SymmetricSecondRankTensor, float, 4, 4 ); -cpPlugins_I_itk_array( itk::SymmetricSecondRankTensor, double, 4, 4 ); - -cpPlugins_I_itk( itk::DiffusionTensor3D< float >, 3 ); -cpPlugins_I_itk( itk::DiffusionTensor3D< double >, 3 ); - -/* TODO - * itk::FixedArray - * itk::Matrix - */ - -// ------------------------------------------------------------------------- -// Possible itk types that could be connected to vtk - -cpPlugins_I_itk_vtk( char, 2 ); -cpPlugins_I_itk_vtk( short, 2 ); -cpPlugins_I_itk_vtk( int, 2 ); -cpPlugins_I_itk_vtk( long, 2 ); -cpPlugins_I_itk_vtk( unsigned char, 2 ); -cpPlugins_I_itk_vtk( unsigned short, 2 ); -cpPlugins_I_itk_vtk( unsigned int, 2 ); -cpPlugins_I_itk_vtk( unsigned long, 2 ); -cpPlugins_I_itk_vtk( float, 2 ); -cpPlugins_I_itk_vtk( double, 2 ); - -cpPlugins_I_itk_vtk( char, 3 ); -cpPlugins_I_itk_vtk( short, 3 ); -cpPlugins_I_itk_vtk( int, 3 ); -cpPlugins_I_itk_vtk( long, 3 ); -cpPlugins_I_itk_vtk( unsigned char, 3 ); -cpPlugins_I_itk_vtk( unsigned short, 3 ); -cpPlugins_I_itk_vtk( unsigned int, 3 ); -cpPlugins_I_itk_vtk( unsigned long, 3 ); -cpPlugins_I_itk_vtk( float, 3 ); -cpPlugins_I_itk_vtk( double, 3 ); - -cpPlugins_I_itk_vtk( itk::RGBPixel< char >, 2 ); -cpPlugins_I_itk_vtk( itk::RGBPixel< short >, 2 ); -cpPlugins_I_itk_vtk( itk::RGBPixel< unsigned char >, 2 ); -cpPlugins_I_itk_vtk( itk::RGBPixel< unsigned short >, 2 ); -cpPlugins_I_itk_vtk( itk::RGBPixel< char >, 3 ); -cpPlugins_I_itk_vtk( itk::RGBPixel< short >, 3 ); -cpPlugins_I_itk_vtk( itk::RGBPixel< unsigned char >, 3 ); -cpPlugins_I_itk_vtk( itk::RGBPixel< unsigned short >, 3 ); - -cpPlugins_I_itk_vtk( itk::RGBAPixel< char >, 2 ); -cpPlugins_I_itk_vtk( itk::RGBAPixel< short >, 2 ); -cpPlugins_I_itk_vtk( itk::RGBAPixel< unsigned char >, 2 ); -cpPlugins_I_itk_vtk( itk::RGBAPixel< unsigned short >, 2 ); -cpPlugins_I_itk_vtk( itk::RGBAPixel< char >, 3 ); -cpPlugins_I_itk_vtk( itk::RGBAPixel< short >, 3 ); -cpPlugins_I_itk_vtk( itk::RGBAPixel< unsigned char >, 3 ); -cpPlugins_I_itk_vtk( itk::RGBAPixel< unsigned short >, 3 ); - -cpPlugins_I_itk_vtk_array( itk::Vector, float, 2, 2 ); -cpPlugins_I_itk_vtk_array( itk::Vector, double, 2, 2 ); -cpPlugins_I_itk_vtk_array( itk::Vector, float, 3, 3 ); -cpPlugins_I_itk_vtk_array( itk::Vector, double, 3, 3 ); - -cpPlugins_I_itk_vtk_array( itk::Point, float, 2, 2 ); -cpPlugins_I_itk_vtk_array( itk::Point, double, 2, 2 ); -cpPlugins_I_itk_vtk_array( itk::Point, float, 3, 3 ); -cpPlugins_I_itk_vtk_array( itk::Point, double, 3, 3 ); - -cpPlugins_I_itk_vtk_array( itk::CovariantVector, float, 2, 2 ); -cpPlugins_I_itk_vtk_array( itk::CovariantVector, double, 2, 2 ); -cpPlugins_I_itk_vtk_array( itk::CovariantVector, float, 3, 3 ); -cpPlugins_I_itk_vtk_array( itk::CovariantVector, double, 3, 3 ); - -cpPlugins_I_itk_vtk_array( itk::SymmetricSecondRankTensor, float, 2, 2 ); -cpPlugins_I_itk_vtk_array( itk::SymmetricSecondRankTensor, double, 2, 2 ); -cpPlugins_I_itk_vtk_array( itk::SymmetricSecondRankTensor, float, 3, 3 ); -cpPlugins_I_itk_vtk_array( itk::SymmetricSecondRankTensor, double, 3, 3 ); - -cpPlugins_I_itk_vtk( itk::DiffusionTensor3D< float >, 3 ); -cpPlugins_I_itk_vtk( itk::DiffusionTensor3D< double >, 3 ); - -// eof - $RCSfile$ diff --git a/lib/cpPlugins/Plugins/Instances_itkMesh.cxx b/lib/cpPlugins/Plugins/Instances_itkMesh.cxx deleted file mode 100644 index 7a462f3..0000000 --- a/lib/cpPlugins/Plugins/Instances_itkMesh.cxx +++ /dev/null @@ -1,16 +0,0 @@ -#include - -#undef ITK_MANUAL_INSTANTIATION -#include -#include - -template class cpPlugins_EXPORT itk::Mesh< float, 2 >; -template class cpPlugins_EXPORT itk::Mesh< float, 3 >; -template class cpPlugins_EXPORT itk::Mesh< double, 2 >; -template class cpPlugins_EXPORT itk::Mesh< double, 3 >; -template class cpPlugins_EXPORT itk::QuadEdgeMesh< float, 2 >; -template class cpPlugins_EXPORT itk::QuadEdgeMesh< float, 3 >; -template class cpPlugins_EXPORT itk::QuadEdgeMesh< double, 2 >; -template class cpPlugins_EXPORT itk::QuadEdgeMesh< double, 3 >; - -// eof - $RCSfile$ diff --git a/lib/cpPlugins/Plugins/MeshReader.cxx b/lib/cpPlugins/Plugins/MeshReader.cxx index e658d86..0528e6c 100644 --- a/lib/cpPlugins/Plugins/MeshReader.cxx +++ b/lib/cpPlugins/Plugins/MeshReader.cxx @@ -7,7 +7,8 @@ // ------------------------------------------------------------------------- cpPlugins::Plugins::MeshReader:: MeshReader( ) - : Superclass( ) + : Superclass( ), + m_Reader( NULL ) { this->m_ClassName = "cpPlugins::MeshReader"; this->m_ClassCategory = "MeshReader"; @@ -28,6 +29,8 @@ MeshReader( ) cpPlugins::Plugins::MeshReader:: ~MeshReader( ) { + if( this->m_Reader != NULL ) + this->m_Reader = NULL; } // ------------------------------------------------------------------------- -- 2.47.1