From: Leonardo Florez-Valencia Date: Tue, 15 Mar 2016 23:04:08 +0000 (-0500) Subject: ... and on linux again X-Git-Tag: v0.1~225 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=2e09f906a787b154f24bd1058bcfeee13a1031bf;p=cpPlugins.git ... and on linux again --- diff --git a/appli/bash/cpPlugins_HostCreator.cxx b/appli/bash/cpPlugins_HostCreator.cxx index 445302f..4fbaded 100644 --- a/appli/bash/cpPlugins_HostCreator.cxx +++ b/appli/bash/cpPlugins_HostCreator.cxx @@ -113,10 +113,16 @@ int main( int argc, char* argv[] ) << "{" << std::endl << "}" << std::endl; */ +#if defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) + std::string export_prefix = "__declspec(dllexport)"; +#else // defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) + std::string export_prefix = "__attribute__((visibility(\"default\")))"; +#endif // defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) + // Write access function out_stream << std::endl - << "extern \"C\" __declspec(dllexport) const char* " + << "extern \"C\" " << export_prefix << " const char* " << "cpPlugins_LoadedFilters( )" << std::endl << "{" << std::endl << " static std::string classes;" << std::endl @@ -136,7 +142,7 @@ int main( int argc, char* argv[] ) for( auto jIt = iIt->second.begin( ); jIt != iIt->second.end( ); ++jIt ) { out_stream - << "extern \"C\" __declspec(dllexport) void* " + << "extern \"C\" " << export_prefix << " void* " << iIt->first << "_" << jIt->first << "( )" << std::endl << "{" << std::endl << " static " << jIt->second << "::" << jIt->first << "::Pointer f;" << std::endl diff --git a/plugins/cpPluginsImageFilters/HistogramThresholdImageFilter.cxx b/plugins/cpPluginsImageFilters/HistogramThresholdImageFilter.cxx index 6d6608b..1c9a673 100644 --- a/plugins/cpPluginsImageFilters/HistogramThresholdImageFilter.cxx +++ b/plugins/cpPluginsImageFilters/HistogramThresholdImageFilter.cxx @@ -53,9 +53,7 @@ std::string cpPluginsImageFilters::HistogramThresholdImageFilter:: _GD0( _TImage* image ) { if( image != NULL ) - return( - this->_GD1< _TImage, itk::Image< unsigned char, _TImage::ImageDimension > >( image ) - ); + return( this->_GD1< _TImage, unsigned char >( image ) ); else return( "ImageFilters::HistogramThresholdImageFilter: No valid input image." @@ -63,17 +61,17 @@ _GD0( _TImage* image ) } // ------------------------------------------------------------------------- -template< class _TImage, class _TBinaryImage > +template< class _TImage, class _TBinaryPixel > std::string cpPluginsImageFilters::HistogramThresholdImageFilter:: _GD1( _TImage* image ) { - typedef itk::HistogramThresholdImageFilter< _TImage, _TBinaryImage > _F; - typedef typename _TImage::PixelType _TP; + typedef itk::Image< _TBinaryPixel, _TImage::ImageDimension > _TBinaryImage; + typedef itk::HistogramThresholdImageFilter< _TImage, _TBinaryImage > _TFilter; // Get parameters // Configure filter - _F* filter = this->_CreateITK< _F >( ); + _TFilter* filter = this->_CreateITK< _TFilter >( ); filter->SetInput( image ); filter->Update( ); diff --git a/plugins/cpPluginsImageFilters/HistogramThresholdImageFilter.h b/plugins/cpPluginsImageFilters/HistogramThresholdImageFilter.h index 464629d..f045d37 100644 --- a/plugins/cpPluginsImageFilters/HistogramThresholdImageFilter.h +++ b/plugins/cpPluginsImageFilters/HistogramThresholdImageFilter.h @@ -31,7 +31,7 @@ namespace cpPluginsImageFilters template< class _TImage > inline std::string _GD0( _TImage* image ); - template< class _TImage, class _TBinaryImage > + template< class _TImage, class _TBinaryPixel > inline std::string _GD1( _TImage* image ); private: diff --git a/plugins/cpPluginsImageFilters/ImageToHistogramFilter.cxx b/plugins/cpPluginsImageFilters/ImageToHistogramFilter.cxx index 85699e3..22bf966 100644 --- a/plugins/cpPluginsImageFilters/ImageToHistogramFilter.cxx +++ b/plugins/cpPluginsImageFilters/ImageToHistogramFilter.cxx @@ -4,11 +4,6 @@ #include #include -/* - #include - #include - #include -*/ // ------------------------------------------------------------------------- cpPluginsImageFilters::ImageToHistogramFilter:: @@ -42,7 +37,7 @@ template< class _TImage > std::string cpPluginsImageFilters::ImageToHistogramFilter:: _GD0( _TImage* image ) { - typedef itk::Statistics::ImageToHistogramFilter< _TImage > _F; + typedef itk::Statistics::ImageToHistogramFilter< _TImage > _TFilter; /* typedef typename _TImage::PixelType _TP; typedef typename _TBinaryImage::PixelType _UP; @@ -55,7 +50,7 @@ _GD0( _TImage* image ) */ // Configure filter - _F* filter = this->_CreateITK< _F >( ); + _TFilter* filter = this->_CreateITK< _TFilter >( ); /* filter->SetInput( image ); filter->SetLowerThreshold( lower_val ); diff --git a/plugins/cpPluginsImageFilters/ImageToHistogramFilter.h b/plugins/cpPluginsImageFilters/ImageToHistogramFilter.h index 8a09d4f..e99de01 100644 --- a/plugins/cpPluginsImageFilters/ImageToHistogramFilter.h +++ b/plugins/cpPluginsImageFilters/ImageToHistogramFilter.h @@ -12,7 +12,7 @@ namespace cpPluginsImageFilters : public cpPlugins::ProcessObject { public: - typedef ImageToHistogramFilter Self; + typedef ImageToHistogramFilter Self; typedef cpPlugins::ProcessObject Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; diff --git a/plugins/cpPluginsImageFilters/OtsuThresholdImageFilter.cxx b/plugins/cpPluginsImageFilters/OtsuThresholdImageFilter.cxx index b5dff63..e836d59 100644 --- a/plugins/cpPluginsImageFilters/OtsuThresholdImageFilter.cxx +++ b/plugins/cpPluginsImageFilters/OtsuThresholdImageFilter.cxx @@ -5,13 +5,6 @@ #include #include #include -/* - #include - #include - #include - #include - #include -*/ // ------------------------------------------------------------------------- cpPluginsImageFilters::OtsuThresholdImageFilter::