]> Creatis software - cpPlugins.git/commitdiff
... and on linux again
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Tue, 15 Mar 2016 23:04:08 +0000 (18:04 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Tue, 15 Mar 2016 23:04:08 +0000 (18:04 -0500)
appli/bash/cpPlugins_HostCreator.cxx
plugins/cpPluginsImageFilters/HistogramThresholdImageFilter.cxx
plugins/cpPluginsImageFilters/HistogramThresholdImageFilter.h
plugins/cpPluginsImageFilters/ImageToHistogramFilter.cxx
plugins/cpPluginsImageFilters/ImageToHistogramFilter.h
plugins/cpPluginsImageFilters/OtsuThresholdImageFilter.cxx

index 445302fe9090bbe5d03d3f4664e96492dc56f070..4fbadeda1c40aad8d92218936dce123fd47b8d93 100644 (file)
@@ -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
index 6d6608b57e2ef0e02cbc10986ed45f9830a1ee1a..1c9a673ba58d0c20f67df12ef804f81d6e6ba2ff 100644 (file)
@@ -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( );
 
index 464629d5fbbb3052180f3c88809f203c3385c818..f045d3704231ca0bcca27ba16f1ab0872947e250 100644 (file)
@@ -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:
index 85699e33b4a48b2edf4cc31d36c2a31547e76c96..22bf966dfc43291c1838090d699f6981c17534ee 100644 (file)
@@ -4,11 +4,6 @@
 
 #include <itkImageToHistogramFilter.h>
 #include <itkImageToHistogramFilter.hxx>
-/*
-  #include <itkImageToImageFilter.hxx>
-  #include <itkInPlaceImageFilter.hxx>
-  #include <itkUnaryFunctorImageFilter.hxx>
-*/
 
 // -------------------------------------------------------------------------
 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 );
index 8a09d4f8ef571c9729e462f587dac06c903eee90..e99de015d79f67fc08e4055a80a0d3848289f441 100644 (file)
@@ -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;
index b5dff63a9e44c9e76a26ad2abd36934c4a464cf5..e836d5950aa2bb8c338fefaa95f9e738d35a324b 100644 (file)
@@ -5,13 +5,6 @@
 #include <itkOtsuThresholdImageFilter.h>
 #include <itkOtsuMultipleThresholdsCalculator.hxx>
 #include <itkOtsuThresholdCalculator.hxx>
-/*
-  #include <itkHistogram.hxx>
-  #include <itkHistogramAlgorithmBase.hxx>
-  #include <itkHistogramThresholdImageFilter.hxx>
-  #include <itkImageToHistogramFilter.hxx>
-  #include <itkMaskedImageToHistogramFilter.hxx>
-*/
 
 // -------------------------------------------------------------------------
 cpPluginsImageFilters::OtsuThresholdImageFilter::