<< "{" << 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
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
_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."
}
// -------------------------------------------------------------------------
-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( );
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:
#include <itkImageToHistogramFilter.h>
#include <itkImageToHistogramFilter.hxx>
-/*
- #include <itkImageToImageFilter.hxx>
- #include <itkInPlaceImageFilter.hxx>
- #include <itkUnaryFunctorImageFilter.hxx>
-*/
// -------------------------------------------------------------------------
cpPluginsImageFilters::ImageToHistogramFilter::
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;
*/
// Configure filter
- _F* filter = this->_CreateITK< _F >( );
+ _TFilter* filter = this->_CreateITK< _TFilter >( );
/*
filter->SetInput( image );
filter->SetLowerThreshold( lower_val );
: 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;
#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::