From: Leonardo Florez-Valencia Date: Tue, 5 Apr 2016 04:25:10 +0000 (-0500) Subject: ... X-Git-Tag: v0.1~210 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=d77223f66c6b35b3f29a648f8136bc513d4563dd;p=cpPlugins.git ... --- diff --git a/lib/cpPlugins/CMakeLists.txt b/lib/cpPlugins/CMakeLists.txt index d289746..5516a22 100644 --- a/lib/cpPlugins/CMakeLists.txt +++ b/lib/cpPlugins/CMakeLists.txt @@ -84,17 +84,19 @@ SET( SET( target_LIBRARIES cpPlugins_Base - cpPlugins_Transforms - cpPlugins_Image - cpPlugins_Mesh + cpPlugins_DistanceMapFilters + cpPlugins_GaussianImageFilters cpPlugins_ImageFiltersBase cpPlugins_ImageIO cpPlugins_ImageIterators cpPlugins_ImageITK2VTK - cpPlugins_ThresholdFilters - cpPlugins_DistanceMapFilters + cpPlugins_Image + cpPlugins_InPlaceImageFiltersBase + cpPlugins_Mesh cpPlugins_ResamplingFilters + cpPlugins_ThresholdFilters cpPlugins_tinyxml2 + cpPlugins_Transforms ) IF(NOT WIN32) SET( diff --git a/lib/cpPlugins_Instances/Base.i b/lib/cpPlugins_Instances/Base.i index 40e158d..8a7e946 100644 --- a/lib/cpPlugins_Instances/Base.i +++ b/lib/cpPlugins_Instances/Base.i @@ -1,6 +1,9 @@ f cpPlugins_Config.h +t itkArray.h +t itkArray2D.h t itkCovariantVector.h +t itkDiffusionTensor3D.h t itkFixedArray.h t itkMatrix.h t itkPoint.h @@ -8,18 +11,23 @@ t itkRGBPixel.h t itkRGBAPixel.h t itkSymmetricEigenAnalysis.h t itkSymmetricSecondRankTensor.h +t itkVariableLengthVector.h t itkVector.h +t itkVectorContainer.h -d #dims=1;2;3;4 +d #dims=1;2;3 d #int=char;short;int;long d #float=float;double d #scalar=#int;unsigned #int;#float d #color_pixels=itk::RGBPixel< #scalar >;itk::RGBAPixel< #scalar > d #lin_alg_vectors=itk::CovariantVector;itk::Point;itk::Vector +c @{itk::Array;itk::Array2D;itk::VariableLengthVector}< #float > c itk::FixedArray< #scalar, #dims > c #color_pixels c #lin_alg_vectors< #float, #dims > c itk::Matrix< #float, #dims, #dims > c itk::SymmetricEigenAnalysis< itk::Matrix< #float, #dims, #dims >, itk::FixedArray< #float, #dims >, itk::Matrix< #float, #dims, #dims > > c itk::SymmetricSecondRankTensor< #float, #dims > +c itk::DiffusionTensor3D< #float > +c itk::VectorContainer< unsigned long, itk::Point< #float, #dims > > \ No newline at end of file diff --git a/lib/cpPlugins_Instances/Base_extra.cxx b/lib/cpPlugins_Instances/Base_extra.cxx index 4da6463..77449ff 100644 --- a/lib/cpPlugins_Instances/Base_extra.cxx +++ b/lib/cpPlugins_Instances/Base_extra.cxx @@ -2,10 +2,12 @@ #include #include +#include #include #include #include +#include #include #include @@ -38,6 +40,7 @@ cpPlugins_Base_extra_SimpleArray( itk::ImageRegion, 4 ); cpPlugins_Base_extra_Array_AllScalars( V, 3 ); \ cpPlugins_Base_extra_Array_AllScalars( V, 4 ) +cpPlugins_Base_extra_Array_AllScalars_AllDims( itk::FixedArray ); cpPlugins_Base_extra_Array_AllScalars_AllDims( itk::Point ); cpPlugins_Base_extra_Array_AllScalars_AllDims( itk::Vector ); diff --git a/lib/cpPlugins_Instances/CMakeLists.txt b/lib/cpPlugins_Instances/CMakeLists.txt index a70119b..6dd61ea 100644 --- a/lib/cpPlugins_Instances/CMakeLists.txt +++ b/lib/cpPlugins_Instances/CMakeLists.txt @@ -45,8 +45,10 @@ TARGET_LINK_LIBRARIES(cpPlugins_ImageFiltersBase cpPlugins_Image) TARGET_LINK_LIBRARIES(cpPlugins_InPlaceImageFiltersBase cpPlugins_ImageFiltersBase) TARGET_LINK_LIBRARIES(cpPlugins_ThresholdFilters cpPlugins_InPlaceImageFiltersBase cpPlugins_ImageIterators) TARGET_LINK_LIBRARIES(cpPlugins_DistanceMapFilters cpPlugins_ThresholdFilters) -TARGET_LINK_LIBRARIES(cpPlugins_ImageIO cpPlugins_ImageFiltersBase) +TARGET_LINK_LIBRARIES(cpPlugins_ImageIO cpPlugins_ImageFiltersBase cpPlugins_ImageIterators) TARGET_LINK_LIBRARIES(cpPlugins_ImageITK2VTK cpPlugins_ImageFiltersBase) +TARGET_LINK_LIBRARIES(cpPlugins_ResamplingFilters cpPlugins_ImageFiltersBase cpPlugins_ImageIterators cpPlugins_Transforms) +TARGET_LINK_LIBRARIES(cpPlugins_GaussianImageFilters cpPlugins_ImageFiltersBase cpPlugins_ImageIterators) #TARGET_LINK_LIBRARIES(cpPlugins_Transforms # cpPlugins_Base diff --git a/lib/cpPlugins_Instances/GaussianImageFilters.i b/lib/cpPlugins_Instances/GaussianImageFilters.i new file mode 100644 index 0000000..9792abd --- /dev/null +++ b/lib/cpPlugins_Instances/GaussianImageFilters.i @@ -0,0 +1,23 @@ +f cpPlugins_Instances/ImageFiltersBase.h + +t cpExtensions/Algorithms/MultiScaleGaussianImageFilter.h +t itkGradientRecursiveGaussianImageFilter.h +t itkImageToImageFilter.h +t itkImageAdaptor.h +t itkRecursiveGaussianImageFilter.h +t itkRecursiveSeparableImageFilter.h +t itkInPlaceImageFilter.h +t itkUnaryFunctorImageFilter.h +t itkBinaryFunctorImageFilter.h +t itkImageRegionIteratorWithIndex.h +t itkImageConstIteratorWithIndex.h +t itkImageRegionConstIteratorWithIndex.h +t itkSimpleDataObjectDecorator.h + +d #dims=2;3 +d #int=char;short;int;long +d #float=float;double +d #scalar=#int;unsigned #int;#float +d #gradients=itk::CovariantVector + +c cpExtensions::Algorithms::MultiScaleGaussianImageFilter< itk::Image< #scalar, #dims >, itk::Image< #gradients< #float, #dims >, #dims > > diff --git a/lib/cpPlugins_Instances/Image.i b/lib/cpPlugins_Instances/Image.i index 1370210..1387997 100644 --- a/lib/cpPlugins_Instances/Image.i +++ b/lib/cpPlugins_Instances/Image.i @@ -6,7 +6,7 @@ t itkImageBase.h t itkImportImageContainer.h t itkImageRegion.h -d #dims=1;2;3;4 +d #dims=1;2;3 d #int=char;short;int;long d #float=float;double d #scalar=#int;unsigned #int;#float @@ -20,7 +20,9 @@ d #double_array_pixels=itk::Matrix c itk::ImportImageContainer< unsigned long, #pixels > c itk::ImportImageContainer< unsigned long, #array_pixels< #float, #dims > > c itk::ImportImageContainer< unsigned long, #double_array_pixels< #float, #dims, #dims > > +c itk::ImportImageContainer< unsigned long, itk::DiffusionTensor3D< #float > > c itk::Image< #pixels, #dims > c itk::Image< #array_pixels< #float, #dims >, #dims > c itk::Image< #double_array_pixels< #float, #dims, #dims >, #dims > +c itk::Image< itk::DiffusionTensor3D< #float >, #dims > diff --git a/lib/cpPlugins_Instances/ImageFiltersBase.i b/lib/cpPlugins_Instances/ImageFiltersBase.i index 30b308a..c93f469 100644 --- a/lib/cpPlugins_Instances/ImageFiltersBase.i +++ b/lib/cpPlugins_Instances/ImageFiltersBase.i @@ -3,7 +3,7 @@ f cpPlugins_Instances/Image.h t itkImageSource.h t itkImageToImageFilter.h -d #dims=1;2;3;4 +d #dims=2;3 d #int=char;short;int;long d #float=float;double d #scalar=#int;unsigned #int;#float diff --git a/lib/cpPlugins_Instances/ImageIO.i b/lib/cpPlugins_Instances/ImageIO.i index 4c781e0..e6397bc 100644 --- a/lib/cpPlugins_Instances/ImageIO.i +++ b/lib/cpPlugins_Instances/ImageIO.i @@ -12,8 +12,9 @@ t itkImageFileWriter.h t itkImageSeriesReader.h t itkConvertPixelBuffer.h t itkImageAlgorithm.h +t itkSimpleDataObjectDecorator.h -d #dims=1;2;3;4 +d #dims=2;3 d #int=char;short;int;long d #float=float;double d #scalar=#int;unsigned #int;#float diff --git a/lib/cpPlugins_Instances/ImageIterators.i b/lib/cpPlugins_Instances/ImageIterators.i index 276a937..29f4bc8 100644 --- a/lib/cpPlugins_Instances/ImageIterators.i +++ b/lib/cpPlugins_Instances/ImageIterators.i @@ -19,7 +19,7 @@ t itkShapedNeighborhoodIterator.h t itkImageRegionConstIteratorWithIndex.h t itkImageRegionIteratorWithIndex.h -d #dims=1;2;3;4 +d #dims=1;2;3 d #int=char;short;int;long d #float=float;double d #scalar=#int;unsigned #int;#float diff --git a/lib/cpPlugins_Instances/InPlaceImageFiltersBase.i b/lib/cpPlugins_Instances/InPlaceImageFiltersBase.i index 15469b6..7ec274d 100644 --- a/lib/cpPlugins_Instances/InPlaceImageFiltersBase.i +++ b/lib/cpPlugins_Instances/InPlaceImageFiltersBase.i @@ -2,7 +2,7 @@ f cpPlugins_Instances/ImageFiltersBase.h t itkInPlaceImageFilter.h -d #dims=1;2;3;4 +d #dims=2;3 d #int=char;short;int;long d #float=float;double d #scalar=#int;unsigned #int;#float diff --git a/lib/cpPlugins_Instances/ResamplingFilters.i b/lib/cpPlugins_Instances/ResamplingFilters.i index 864a0b4..46fc759 100644 --- a/lib/cpPlugins_Instances/ResamplingFilters.i +++ b/lib/cpPlugins_Instances/ResamplingFilters.i @@ -1,12 +1,14 @@ f cpPlugins_Instances/ImageFiltersBase.h f cpPlugins_Instances/Transforms.h -i itkContinuousIndex.h + t itkResampleImageFilter.h t itkLinearInterpolateImageFunction.h +t itkImageFunction.h -c itk::LinearInterpolateImageFunction< itk::Image< #scalars, #dims >, #float_types > -c itk::ResampleImageFilter< itk::Image< #scalars, #dims >, itk::Image< #scalars, #dims >, float, float > -c itk::ResampleImageFilter< itk::Image< #scalars, #dims >, itk::Image< #scalars, #dims >, double, double > +d #dims=2;3 +d #int=char;short;int;long +d #float=float;double +d #scalar=#int;unsigned #int;#float -d #scalars=#int_types;#uint_types;#float_types -d #dims=1;2;3;4 +c itk::LinearInterpolateImageFunction< itk::Image< #scalar, #dims >, #float > +c itk::ResampleImageFilter< itk::Image< #scalar, #dims >, itk::Image< #scalar, #dims >, #float, #float > diff --git a/lib/cpPlugins_Instances/ThresholdFilters.i b/lib/cpPlugins_Instances/ThresholdFilters.i index c0066be..125d7cc 100644 --- a/lib/cpPlugins_Instances/ThresholdFilters.i +++ b/lib/cpPlugins_Instances/ThresholdFilters.i @@ -4,7 +4,7 @@ t itkBinaryThresholdImageFilter.h t itkUnaryFunctorImageFilter.h t itkSimpleDataObjectDecorator.h -d #dims=1;2;3;4 +d #dims=2;3 d #int=char;short;int;long d #float=float;double d #scalar=#int;unsigned #int;#float diff --git a/lib/cpPlugins_Instances/Transforms.i b/lib/cpPlugins_Instances/Transforms.i index dc85eea..15ce975 100644 --- a/lib/cpPlugins_Instances/Transforms.i +++ b/lib/cpPlugins_Instances/Transforms.i @@ -1,6 +1,6 @@ f cpPlugins_Instances/Base.h -d #dims=1;2;3;4 +d #dims=2;3 d #float=float;double t itkTransform.h diff --git a/plugins/cpPluginsIO/ImageReader.cxx b/plugins/cpPluginsIO/ImageReader.cxx index 225bcde..f614a63 100644 --- a/plugins/cpPluginsIO/ImageReader.cxx +++ b/plugins/cpPluginsIO/ImageReader.cxx @@ -45,10 +45,10 @@ _GenerateData( ) { switch( io->GetNumberOfDimensions( ) ) { - case 1: r = this->_GD0< 1 >( io ); break; + // TODO: case 1: r = this->_GD0< 1 >( io ); break; case 2: r = this->_GD0< 2 >( io ); break; case 3: r = this->_GD0< 3 >( io ); break; - case 4: r = this->_GD0< 4 >( io ); break; + // TODO: case 4: r = this->_GD0< 4 >( io ); break; default: r = "IO::ImageReader: Image dimension not supported."; break; diff --git a/plugins/cpPluginsIO/ImageWriter.cxx b/plugins/cpPluginsIO/ImageWriter.cxx index ca4710a..8038417 100644 --- a/plugins/cpPluginsIO/ImageWriter.cxx +++ b/plugins/cpPluginsIO/ImageWriter.cxx @@ -31,8 +31,10 @@ _GenerateData( ) { std::string r = cpPlugin_Image_Demangle_Dim( _GD0, input, 3 ); if( r != "" ) r = cpPlugin_Image_Demangle_Dim( _GD0, input, 2 ); - if( r != "" ) r = cpPlugin_Image_Demangle_Dim( _GD0, input, 4 ); - if( r != "" ) r = cpPlugin_Image_Demangle_Dim( _GD0, input, 1 ); + /* TODO + if( r != "" ) r = cpPlugin_Image_Demangle_Dim( _GD0, input, 4 ); + if( r != "" ) r = cpPlugin_Image_Demangle_Dim( _GD0, input, 1 ); + */ return( r ); } catch( itk::ExceptionObject& err ) diff --git a/plugins/cpPluginsImageFilters/BinaryThresholdImageFilter.cxx b/plugins/cpPluginsImageFilters/BinaryThresholdImageFilter.cxx index 62cafdb..6c49a3e 100644 --- a/plugins/cpPluginsImageFilters/BinaryThresholdImageFilter.cxx +++ b/plugins/cpPluginsImageFilters/BinaryThresholdImageFilter.cxx @@ -33,10 +33,12 @@ std::string cpPluginsImageFilters::BinaryThresholdImageFilter:: _GenerateData( ) { auto image = this->GetInputData( "Input" )->GetITK< itk::DataObject >( ); - std::string cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 1 ); - if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 2 ); + std::string cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 2 ); if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 3 ); - if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 4 ); + /* TODO + if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 1 ); + if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 4 ); + */ return( r ); } diff --git a/plugins/cpPluginsImageFilters/CMakeLists.txt b/plugins/cpPluginsImageFilters/CMakeLists.txt index bd8d504..99fca15 100644 --- a/plugins/cpPluginsImageFilters/CMakeLists.txt +++ b/plugins/cpPluginsImageFilters/CMakeLists.txt @@ -5,27 +5,12 @@ SET(lib_DIR cpPluginsImageFilters) ## = Source code = ## =============== -#FILE(GLOB lib_HEADERS_H "*.h") +FILE(GLOB lib_HEADERS_H "*.h") FILE(GLOB lib_HEADERS_HPP "*.hpp") FILE(GLOB lib_HEADERS_HXX "*.hxx") FILE(GLOB lib_SOURCES_C "*.c") FILE(GLOB lib_SOURCES_CPP "*.cpp") -#FILE(GLOB lib_SOURCES_CXX "*.cxx") - -SET( - lib_HEADERS_H - ${CMAKE_CURRENT_SOURCE_DIR}/SignedMaurerDistanceMapImageFilter.h - ${CMAKE_CURRENT_SOURCE_DIR}/BinaryThresholdImageFilter.h - ${CMAKE_CURRENT_SOURCE_DIR}/BinaryContourImageFilter.h - ${CMAKE_CURRENT_SOURCE_DIR}/ResampleImageFilter.h - ) -SET( - lib_SOURCES_CXX - ${CMAKE_CURRENT_SOURCE_DIR}/SignedMaurerDistanceMapImageFilter.cxx - ${CMAKE_CURRENT_SOURCE_DIR}/BinaryThresholdImageFilter.cxx - ${CMAKE_CURRENT_SOURCE_DIR}/BinaryContourImageFilter.cxx - ${CMAKE_CURRENT_SOURCE_DIR}/ResampleImageFilter.cxx - ) +FILE(GLOB lib_SOURCES_CXX "*.cxx") # =================================== # = Integrate all source file names = diff --git a/plugins/cpPluginsImageFilters/ExtractImageFilter.cxx b/plugins/cpPluginsImageFilters/ExtractImageFilter.cxx deleted file mode 100644 index ac2b1cd..0000000 --- a/plugins/cpPluginsImageFilters/ExtractImageFilter.cxx +++ /dev/null @@ -1,79 +0,0 @@ -#include -#include -#include - -#include -#include -#include - -// ------------------------------------------------------------------------- -cpPluginsImageFilters::ExtractImageFilter:: -ExtractImageFilter( ) - : Superclass( ) -{ - this->_AddInput( "Input" ); - this->_AddOutput< cpPlugins::Image >( "Output" ); - this->m_Parameters.ConfigureAsBool( "ReduceDimension" ); - this->m_Parameters.SetBool( "ReduceDimension", false ); - - /* TODO - std::vector< std::string > choices; - choices.push_back( "float" ); - choices.push_back( "double" ); - this->m_Parameters.ConfigureAsChoices( "ScalarType", choices ); - this->m_Parameters.SetSelectedChoice( "ScalarType", "float" ); - this->m_Parameters.ConfigureAsReal( "UpperThresholdValue" ); - this->m_Parameters.ConfigureAsUint( "InsideValue" ); - this->m_Parameters.ConfigureAsUint( "OutsideValue" ); - - this->m_Parameters.SetReal( "LowerThresholdValue", 0 ); - this->m_Parameters.SetReal( "UpperThresholdValue", 10000 ); - this->m_Parameters.SetReal( "InsideValue", 1 ); - this->m_Parameters.SetReal( "OutsideValue", 0 ); - */ -} - -// ------------------------------------------------------------------------- -cpPluginsImageFilters::ExtractImageFilter:: -~ExtractImageFilter( ) -{ -} - -// ------------------------------------------------------------------------- -std::string cpPluginsImageFilters::ExtractImageFilter:: -_GenerateData( ) -{ - auto image = this->GetInputData( "Input" )->GetITK< itk::DataObject >( ); - std::string cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 3 ); - return( r ); -} - -// ------------------------------------------------------------------------- -template< class _TImage > -std::string cpPluginsImageFilters::ExtractImageFilter:: -_GD0( _TImage* image ) -{ - typedef - itk::Image< typename _TImage::PixelType, _TImage::ImageDimension - 1 > - _TOutImage; - typedef itk::ExtractImageFilter< _TImage, _TOutImage > _TFilter; - - if( image == NULL ) - return( - "ImageFilters::ExtractImageFilter: No valid input image." - ); - - - // Configure filter - typename _TImage::RegionType reg; - - _TFilter* filter = this->_CreateITK< _TFilter >( ); - filter->SetInput( image ); - filter->SetExtractionRegion( reg ); - - // Connect output - this->GetOutputData( "Output" )->SetITK( filter->GetOutput( ) ); - return( "" ); -} - -// eof - $RCSfile$ diff --git a/plugins/cpPluginsImageFilters/ExtractImageFilter.h b/plugins/cpPluginsImageFilters/ExtractImageFilter.h deleted file mode 100644 index 6910cd1..0000000 --- a/plugins/cpPluginsImageFilters/ExtractImageFilter.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef __CPPLUGINSIMAGEFILTERS__EXTRACTIMAGEFILTER__H__ -#define __CPPLUGINSIMAGEFILTERS__EXTRACTIMAGEFILTER__H__ - -#include -#include - -namespace cpPluginsImageFilters -{ - /** - */ - class cpPluginsImageFilters_EXPORT ExtractImageFilter - : public cpPlugins::ProcessObject - { - public: - typedef ExtractImageFilter Self; - typedef cpPlugins::ProcessObject Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - public: - itkNewMacro( Self ); - itkTypeMacro( ExtractImageFilter, cpPlugins::ProcessObject ); - cpPlugins_Id_Macro( ExtractImageFilter, ImageFilters ); - - protected: - ExtractImageFilter( ); - virtual ~ExtractImageFilter( ); - - virtual std::string _GenerateData( ) ITK_OVERRIDE; - - template< class _TImage > - inline std::string _GD0( _TImage* image ); - - private: - // Purposely not implemented - ExtractImageFilter( const Self& ); - Self& operator=( const Self& ); - }; - -} // ecapseman - -#endif // __CPPLUGINSIMAGEFILTERS__EXTRACTIMAGEFILTER__H__ - -// eof - $RCSfile$ diff --git a/plugins/cpPluginsImageFilters/HistogramThresholdImageFilter.cxx b/plugins/cpPluginsImageFilters/HistogramThresholdImageFilter.cxx deleted file mode 100644 index c890d83..0000000 --- a/plugins/cpPluginsImageFilters/HistogramThresholdImageFilter.cxx +++ /dev/null @@ -1,86 +0,0 @@ -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -// ------------------------------------------------------------------------- -cpPluginsImageFilters::HistogramThresholdImageFilter:: -HistogramThresholdImageFilter( ) - : Superclass( ) -{ - this->_AddInput( "Input" ); - this->_AddInput( "Calculator" ); - this->_AddInput( "Mask", false ); - this->_AddOutput< cpPlugins::Image >( "Output" ); - - this->m_Parameters.ConfigureAsUint( "NumberOfHistogramBins" ); - this->m_Parameters.ConfigureAsBool( "AutoMinimumMaximum" ); - this->m_Parameters.ConfigureAsBool( "MaskOutput" ); - this->m_Parameters.ConfigureAsReal( "MaskValue" ); - this->m_Parameters.ConfigureAsReal( "Threshold" ); - - this->m_Parameters.SetUint( "NumberOfHistogramBins", 256 ); - this->m_Parameters.SetBool( "AutoMinimumMaximum", true ); - this->m_Parameters.SetBool( "MaskOutput", false ); - this->m_Parameters.SetReal( "MaskValue", 1 ); - this->m_Parameters.SetReal( "Threshold", 0 ); -} - -// ------------------------------------------------------------------------- -cpPluginsImageFilters::HistogramThresholdImageFilter:: -~HistogramThresholdImageFilter( ) -{ -} - -// ------------------------------------------------------------------------- -std::string cpPluginsImageFilters::HistogramThresholdImageFilter:: -_GenerateData( ) -{ - auto image = this->GetInputData( "Input" )->GetITK< itk::DataObject >( ); - std::string cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 1 ); - if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 2 ); - if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 3 ); - if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 4 ); - return( r ); -} - -// ------------------------------------------------------------------------- -template< class _TImage > -std::string cpPluginsImageFilters::HistogramThresholdImageFilter:: -_GD0( _TImage* image ) -{ - if( image != NULL ) - return( this->_GD1< _TImage, unsigned char >( image ) ); - else - return( - "ImageFilters::HistogramThresholdImageFilter: No valid input image." - ); -} - -// ------------------------------------------------------------------------- -template< class _TImage, class _TBinaryPixel > -std::string cpPluginsImageFilters::HistogramThresholdImageFilter:: -_GD1( _TImage* image ) -{ - typedef itk::Image< _TBinaryPixel, _TImage::ImageDimension > _TBinaryImage; - typedef itk::HistogramThresholdImageFilter< _TImage, _TBinaryImage > _TFilter; - - // Get parameters - - // Configure filter - _TFilter* filter = this->_CreateITK< _TFilter >( ); - filter->SetInput( image ); - filter->Update( ); - - // Connect output - this->GetOutputData( "Output" )->SetITK( filter->GetOutput( ) ); - return( "HistogramThresholdImage: not complete yet." ); -} - -// eof - $RCSfile$ diff --git a/plugins/cpPluginsImageFilters/HistogramThresholdImageFilter.h b/plugins/cpPluginsImageFilters/HistogramThresholdImageFilter.h deleted file mode 100644 index 1c0260f..0000000 --- a/plugins/cpPluginsImageFilters/HistogramThresholdImageFilter.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef __CPPLUGINSIMAGEFILTERS__HISTOGRAMTHRESHOLDIMAGEFILTER__H__ -#define __CPPLUGINSIMAGEFILTERS__HISTOGRAMTHRESHOLDIMAGEFILTER__H__ - -#include -#include - -namespace cpPluginsImageFilters -{ - /** - */ - class cpPluginsImageFilters_EXPORT HistogramThresholdImageFilter - : public cpPlugins::ProcessObject - { - public: - typedef HistogramThresholdImageFilter Self; - typedef cpPlugins::ProcessObject Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - public: - itkNewMacro( Self ); - itkTypeMacro( HistogramThresholdImageFilter, cpPlugins::ProcessObject ); - cpPlugins_Id_Macro( HistogramThresholdImageFilter, ImageFilters ); - - protected: - HistogramThresholdImageFilter( ); - virtual ~HistogramThresholdImageFilter( ); - - virtual std::string _GenerateData( ) ITK_OVERRIDE; - - template< class _TImage > - inline std::string _GD0( _TImage* image ); - - template< class _TImage, class _TBinaryPixel > - inline std::string _GD1( _TImage* image ); - - private: - // Purposely not implemented - HistogramThresholdImageFilter( const Self& ); - Self& operator=( const Self& ); - }; - -} // ecapseman - -#endif // __CPPLUGINSIMAGEFILTERS__HISTOGRAMTHRESHOLDIMAGEFILTER__H__ - -// eof - $RCSfile$ diff --git a/plugins/cpPluginsImageFilters/ImageToHistogramFilter.cxx b/plugins/cpPluginsImageFilters/ImageToHistogramFilter.cxx deleted file mode 100644 index 968e5a5..0000000 --- a/plugins/cpPluginsImageFilters/ImageToHistogramFilter.cxx +++ /dev/null @@ -1,68 +0,0 @@ -#include -#include -#include - -#include -#include - -// ------------------------------------------------------------------------- -cpPluginsImageFilters::ImageToHistogramFilter:: -ImageToHistogramFilter( ) - : Superclass( ) -{ - this->_AddInput( "Input" ); - this->_AddOutput< cpPlugins::DataObject >( "Output" ); -} - -// ------------------------------------------------------------------------- -cpPluginsImageFilters::ImageToHistogramFilter:: -~ImageToHistogramFilter( ) -{ -} - -// ------------------------------------------------------------------------- -std::string cpPluginsImageFilters::ImageToHistogramFilter:: -_GenerateData( ) -{ - auto image = this->GetInputData( "Input" )->GetITK< itk::DataObject >( ); - std::string cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 1 ); - if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 2 ); - if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 3 ); - if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 4 ); - return( r ); -} - -// ------------------------------------------------------------------------- -template< class _TImage > -std::string cpPluginsImageFilters::ImageToHistogramFilter:: -_GD0( _TImage* image ) -{ - typedef itk::Statistics::ImageToHistogramFilter< _TImage > _TFilter; - /* - typedef typename _TImage::PixelType _TP; - typedef typename _TBinaryImage::PixelType _UP; - - // Get parameters - _TP lower_val = _TP( this->m_Parameters.GetReal( "LowerThresholdValue" ) ); - _TP upper_val = _TP( this->m_Parameters.GetReal( "UpperThresholdValue" ) ); - _UP in_val = _UP( this->m_Parameters.GetUint( "InsideValue" ) ); - _UP out_val = _UP( this->m_Parameters.GetUint( "OutsideValue" ) ); - */ - - // Configure filter - _TFilter* filter = this->_CreateITK< _TFilter >( ); - filter->SetInput( image ); - /* - filter->SetLowerThreshold( lower_val ); - filter->SetUpperThreshold( upper_val ); - filter->SetInsideValue( in_val ); - filter->SetOutsideValue( out_val ); - */ - filter->Update( ); - - // Connect output - this->GetOutputData( "Output" )->SetITK( filter->GetOutput( ) ); - return( "ImageToHistogramFilter: not ready yet." ); -} - -// eof - $RCSfile$ diff --git a/plugins/cpPluginsImageFilters/ImageToHistogramFilter.h b/plugins/cpPluginsImageFilters/ImageToHistogramFilter.h deleted file mode 100644 index d166a3c..0000000 --- a/plugins/cpPluginsImageFilters/ImageToHistogramFilter.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef __CPPLUGINSIMAGEFILTERS__IMAGETOHISTOGRAMFILTER__H__ -#define __CPPLUGINSIMAGEFILTERS__IMAGETOHISTOGRAMFILTER__H__ - -#include -#include - -namespace cpPluginsImageFilters -{ - /** - */ - class cpPluginsImageFilters_EXPORT ImageToHistogramFilter - : public cpPlugins::ProcessObject - { - public: - typedef ImageToHistogramFilter Self; - typedef cpPlugins::ProcessObject Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - public: - itkNewMacro( Self ); - itkTypeMacro( ImageToHistogramFilter, cpPlugins::ProcessObject ); - cpPlugins_Id_Macro( ImageToHistogramFilter, ImageFilters ); - - protected: - ImageToHistogramFilter( ); - virtual ~ImageToHistogramFilter( ); - - virtual std::string _GenerateData( ) ITK_OVERRIDE; - - template< class _TImage > - inline std::string _GD0( _TImage* image ); - - private: - // Purposely not implemented - ImageToHistogramFilter( const Self& ); - Self& operator=( const Self& ); - }; - -} // ecapseman - -#endif // __CPPLUGINSIMAGEFILTERS__IMAGETOHISTOGRAMFILTER__H__ - -// eof - $RCSfile$ diff --git a/plugins/cpPluginsImageFilters/IsoImageSlicer.cxx b/plugins/cpPluginsImageFilters/IsoImageSlicer.cxx deleted file mode 100644 index 5869746..0000000 --- a/plugins/cpPluginsImageFilters/IsoImageSlicer.cxx +++ /dev/null @@ -1,121 +0,0 @@ -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - #include - #include - #include -*/ - -// ------------------------------------------------------------------------- -cpPluginsImageFilters::IsoImageSlicer:: -IsoImageSlicer( ) - : Superclass( ) -{ - this->_AddInput( "Input" ); - this->_AddOutput< cpPlugins::Image >( "Output" ); - - std::vector< std::string > choices; - choices.push_back( "float" ); - choices.push_back( "double" ); - this->m_Parameters.ConfigureAsChoices( "ScalarType", choices ); - this->m_Parameters.SetSelectedChoice( "ScalarType", "float" ); - /* TODO - this->m_Parameters.ConfigureAsReal( "LowerThresholdValue" ); - this->m_Parameters.ConfigureAsReal( "UpperThresholdValue" ); - this->m_Parameters.ConfigureAsUint( "InsideValue" ); - this->m_Parameters.ConfigureAsUint( "OutsideValue" ); - - this->m_Parameters.SetReal( "LowerThresholdValue", 0 ); - this->m_Parameters.SetReal( "UpperThresholdValue", 10000 ); - this->m_Parameters.SetReal( "InsideValue", 1 ); - this->m_Parameters.SetReal( "OutsideValue", 0 ); - */ -} - -// ------------------------------------------------------------------------- -cpPluginsImageFilters::IsoImageSlicer:: -~IsoImageSlicer( ) -{ -} - -// ------------------------------------------------------------------------- -std::string cpPluginsImageFilters::IsoImageSlicer:: -_GenerateData( ) -{ - auto image = this->GetInputData( "Input" )->GetITK< itk::DataObject >( ); - std::string cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 3 ); - return( r ); -} - -// ------------------------------------------------------------------------- -template< class _TImage > -std::string cpPluginsImageFilters::IsoImageSlicer:: -_GD0( _TImage* image ) -{ - if( image != NULL ) - { - auto choice = this->m_Parameters.GetSelectedChoice( "OutputResolution" ); - if( choice == "float" ) - return( this->_GD1< _TImage, float >( image ) ); - else if( choice == "double" ) - return( this->_GD1< _TImage, double >( image ) ); - else return( "IsoImageSlicer: no valid scalar type." ); - } - else - return( - "ImageFilters::IsoImageSlicer: No valid input image." - ); -} - -// ------------------------------------------------------------------------- -template< class _TImage, class _TScalar > -std::string cpPluginsImageFilters::IsoImageSlicer:: -_GD1( _TImage* image ) -{ - typedef - cpExtensions::Algorithms::IsoImageSlicer< _TImage, _TScalar > - _TFilter; - typedef typename _TFilter::TVector _TVector; - typedef typename _TFilter::TMatrix _TMatrix; - - // Configure filter - _TFilter* filter = this->_CreateITK< _TFilter >( ); - filter->SetInput( image ); - filter->SetInterpolator( NULL ); - filter->SetTranslation( _TVector( ) ); - filter->SetRotation( _TMatrix( ) ); - filter->SetSize( 1 ); - /* TODO - filter->SetLowerThreshold( lower_val ); - filter->SetUpperThreshold( upper_val ); - filter->SetInsideValue( in_val ); - filter->SetOutsideValue( out_val ); - filter->Update( ); - */ - - // Connect output - this->GetOutputData( "Output" )->SetITK( filter->GetOutput( ) ); - return( "" ); -} - -#include -#include - -template class cpPluginsImageFilters_EXPORT cpExtensions::Algorithms::BezierCurveFunction< itk::Vector< float, 3 > >; -template class cpPluginsImageFilters_EXPORT cpExtensions::Algorithms::BezierCurveFunction< itk::Vector< double, 3 > >; - -// eof - $RCSfile$ diff --git a/plugins/cpPluginsImageFilters/IsoImageSlicer.h b/plugins/cpPluginsImageFilters/IsoImageSlicer.h deleted file mode 100644 index d0f6c9e..0000000 --- a/plugins/cpPluginsImageFilters/IsoImageSlicer.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef __CPPLUGINSIMAGEFILTERS__ISOIMAGESLICER__H__ -#define __CPPLUGINSIMAGEFILTERS__ISOIMAGESLICER__H__ - -#include -#include - -namespace cpPluginsImageFilters -{ - /** - */ - class cpPluginsImageFilters_EXPORT IsoImageSlicer - : public cpPlugins::ProcessObject - { - public: - typedef IsoImageSlicer Self; - typedef cpPlugins::ProcessObject Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - public: - itkNewMacro( Self ); - itkTypeMacro( IsoImageSlicer, cpPlugins::ProcessObject ); - cpPlugins_Id_Macro( IsoImageSlicer, ImageFilters ); - - protected: - IsoImageSlicer( ); - virtual ~IsoImageSlicer( ); - - virtual std::string _GenerateData( ) ITK_OVERRIDE; - - template< class _TImage > - inline std::string _GD0( _TImage* image ); - - template< class _TImage, class _TScalar > - inline std::string _GD1( _TImage* image ); - - private: - // Purposely not implemented - IsoImageSlicer( const Self& ); - Self& operator=( const Self& ); - }; - -} // ecapseman - -#endif // __CPPLUGINSIMAGEFILTERS__ISOIMAGESLICER__H__ - -// eof - $RCSfile$ diff --git a/plugins/cpPluginsImageFilters/JoinSeriesImageFilter.cxx b/plugins/cpPluginsImageFilters/JoinSeriesImageFilter.cxx deleted file mode 100644 index 9b58be4..0000000 --- a/plugins/cpPluginsImageFilters/JoinSeriesImageFilter.cxx +++ /dev/null @@ -1,64 +0,0 @@ -#include -#include -#include - -#include -#include -#include - -// ------------------------------------------------------------------------- -cpPluginsImageFilters::JoinSeriesImageFilter:: -JoinSeriesImageFilter( ) - : Superclass( ) -{ - this->_AddInput( "Input" ); - this->_AddOutput< cpPlugins::Image >( "Output" ); -} - -// ------------------------------------------------------------------------- -cpPluginsImageFilters::JoinSeriesImageFilter:: -~JoinSeriesImageFilter( ) -{ -} - -// ------------------------------------------------------------------------- -std::string cpPluginsImageFilters::JoinSeriesImageFilter:: -_GenerateData( ) -{ - auto image = this->GetInputData( "Input" )->GetITK< itk::DataObject >( ); - std::string cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 2 ); - return( r ); -} - -// ------------------------------------------------------------------------- -template< class _TImage > -std::string cpPluginsImageFilters::JoinSeriesImageFilter:: -_GD0( _TImage* image ) -{ - typedef - itk::Image< typename _TImage::PixelType, _TImage::ImageDimension + 1 > - _TOutImage; - typedef itk::JoinSeriesImageFilter< _TImage, _TOutImage > _TFilter; - - if( image == NULL ) - return( - "ImageFilters::JoinSeriesImageFilter: No valid input image." - ); - - // Configure filter - _TFilter* filter = this->_CreateITK< _TFilter >( ); - filter->SetInput( image ); - /* TODO - filter->SetLowerThreshold( lower_val ); - filter->SetUpperThreshold( upper_val ); - filter->SetInsideValue( in_val ); - filter->SetOutsideValue( out_val ); - filter->Update( ); - */ - - // Connect output - this->GetOutputData( "Output" )->SetITK( filter->GetOutput( ) ); - return( "" ); -} - -// eof - $RCSfile$ diff --git a/plugins/cpPluginsImageFilters/JoinSeriesImageFilter.h b/plugins/cpPluginsImageFilters/JoinSeriesImageFilter.h deleted file mode 100644 index 2e0aff5..0000000 --- a/plugins/cpPluginsImageFilters/JoinSeriesImageFilter.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef __CPPLUGINSIMAGEFILTERS__JOINSERIESIMAGEFILTER__H__ -#define __CPPLUGINSIMAGEFILTERS__JOINSERIESIMAGEFILTER__H__ - -#include -#include - -namespace cpPluginsImageFilters -{ - /** - */ - class cpPluginsImageFilters_EXPORT JoinSeriesImageFilter - : public cpPlugins::ProcessObject - { - public: - typedef JoinSeriesImageFilter Self; - typedef cpPlugins::ProcessObject Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - public: - itkNewMacro( Self ); - itkTypeMacro( JoinSeriesImageFilter, cpPlugins::ProcessObject ); - cpPlugins_Id_Macro( JoinSeriesImageFilter, ImageFilters ); - - protected: - JoinSeriesImageFilter( ); - virtual ~JoinSeriesImageFilter( ); - - virtual std::string _GenerateData( ) ITK_OVERRIDE; - - template< class _TImage > - inline std::string _GD0( _TImage* image ); - - template< class _TImage, class _TScalar > - inline std::string _GD1( _TImage* image ); - - private: - // Purposely not implemented - JoinSeriesImageFilter( const Self& ); - Self& operator=( const Self& ); - }; - -} // ecapseman - -#endif // __CPPLUGINSIMAGEFILTERS__JOINSERIESIMAGEFILTER__H__ - -// eof - $RCSfile$ diff --git a/plugins/cpPluginsImageFilters/MaskedImageToHistogramFilter.cxx b/plugins/cpPluginsImageFilters/MaskedImageToHistogramFilter.cxx deleted file mode 100644 index b2dd577..0000000 --- a/plugins/cpPluginsImageFilters/MaskedImageToHistogramFilter.cxx +++ /dev/null @@ -1,77 +0,0 @@ -#include -#include -#include - -#include -#include -#include - -// ------------------------------------------------------------------------- -cpPluginsImageFilters::MaskedImageToHistogramFilter:: -MaskedImageToHistogramFilter( ) - : Superclass( ) -{ - this->_AddInput( "Input" ); - this->_AddInput( "Mask" ); - this->_AddOutput< cpPlugins::DataObject >( "Output" ); -} - -// ------------------------------------------------------------------------- -cpPluginsImageFilters::MaskedImageToHistogramFilter:: -~MaskedImageToHistogramFilter( ) -{ -} - -// ------------------------------------------------------------------------- -std::string cpPluginsImageFilters::MaskedImageToHistogramFilter:: -_GenerateData( ) -{ - auto image = this->GetInputData( "Input" )->GetITK< itk::DataObject >( ); - std::string cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 1 ); - if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 2 ); - if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 3 ); - if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 4 ); - return( r ); -} - -// ------------------------------------------------------------------------- -template< class _TImage > -std::string cpPluginsImageFilters::MaskedImageToHistogramFilter:: -_GD0( _TImage* image ) -{ - if( image != NULL ) - return( - this->_GD1< _TImage, itk::Image< unsigned char, _TImage::ImageDimension > >( image ) - ); - else - return( - "ImageFilters::MaskedImageToHistogramFilter: No valid input image." - ); -} - -// ------------------------------------------------------------------------- -template< class _TImage, class _TMask > -std::string cpPluginsImageFilters::MaskedImageToHistogramFilter:: -_GD1( _TImage* image ) -{ - typedef itk::Statistics::MaskedImageToHistogramFilter< _TImage, _TMask > _F; - - // Get parameters - - // Configure filter - _F* filter = this->_CreateITK< _F >( ); - /* - filter->SetInput( image ); - filter->SetLowerThreshold( lower_val ); - filter->SetUpperThreshold( upper_val ); - filter->SetInsideValue( in_val ); - filter->SetOutsideValue( out_val ); - filter->Update( ); - - // Connect output - this->GetOutputData( "Output" )->SetITK( filter->GetOutput( ) ); - */ - return( "MaskedImageToHistogramFilter: not ready yet." ); -} - -// eof - $RCSfile$ diff --git a/plugins/cpPluginsImageFilters/MaskedImageToHistogramFilter.h b/plugins/cpPluginsImageFilters/MaskedImageToHistogramFilter.h deleted file mode 100644 index 4c41418..0000000 --- a/plugins/cpPluginsImageFilters/MaskedImageToHistogramFilter.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef __CPPLUGINSIMAGEFILTERS__MASKEDIMAGETOHISTOGRAMFILTER__H__ -#define __CPPLUGINSIMAGEFILTERS__MASKEDIMAGETOHISTOGRAMFILTER__H__ - -#include -#include - -namespace cpPluginsImageFilters -{ - /** - */ - class cpPluginsImageFilters_EXPORT MaskedImageToHistogramFilter - : public cpPlugins::ProcessObject - { - public: - typedef MaskedImageToHistogramFilter Self; - typedef cpPlugins::ProcessObject Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - public: - itkNewMacro( Self ); - itkTypeMacro( MaskedImageToHistogramFilter, cpPlugins::ProcessObject ); - cpPlugins_Id_Macro( MaskedImageToHistogramFilter, ImageFilters ); - - protected: - MaskedImageToHistogramFilter( ); - virtual ~MaskedImageToHistogramFilter( ); - - virtual std::string _GenerateData( ) ITK_OVERRIDE; - - template< class _TImage > - inline std::string _GD0( _TImage* image ); - - template< class _TImage, class _TMask > - inline std::string _GD1( _TImage* image ); - - private: - // Purposely not implemented - MaskedImageToHistogramFilter( const Self& ); - Self& operator=( const Self& ); - }; - -} // ecapseman - -#endif // __CPPLUGINSIMAGEFILTERS__MASKEDIMAGETOHISTOGRAMFILTER__H__ - -// eof - $RCSfile$ diff --git a/plugins/cpPluginsImageFilters/MultiScaleGaussianImageFilter.cxx b/plugins/cpPluginsImageFilters/MultiScaleGaussianImageFilter.cxx index b3f2210..224aa87 100644 --- a/plugins/cpPluginsImageFilters/MultiScaleGaussianImageFilter.cxx +++ b/plugins/cpPluginsImageFilters/MultiScaleGaussianImageFilter.cxx @@ -1,28 +1,30 @@ #include #include -#include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +/* + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +*/ // ------------------------------------------------------------------------- cpPluginsImageFilters::MultiScaleGaussianImageFilter:: diff --git a/plugins/cpPluginsImageFilters/OtsuThresholdImageFilter.cxx b/plugins/cpPluginsImageFilters/OtsuThresholdImageFilter.cxx deleted file mode 100644 index b765f44..0000000 --- a/plugins/cpPluginsImageFilters/OtsuThresholdImageFilter.cxx +++ /dev/null @@ -1,85 +0,0 @@ -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -// ------------------------------------------------------------------------- -cpPluginsImageFilters::OtsuThresholdImageFilter:: -OtsuThresholdImageFilter( ) - : Superclass( ) -{ - this->_AddInput( "Input" ); - this->_AddOutput< cpPlugins::Image >( "Output" ); - - this->m_Parameters.ConfigureAsUint( "NumberOfHistogramBins" ); - this->m_Parameters.ConfigureAsUint( "InsideValue" ); - this->m_Parameters.ConfigureAsUint( "OutsideValue" ); - - this->m_Parameters.SetUint( "NumberOfHistogramBins", 100 ); - this->m_Parameters.SetUint( "InsideValue", 255 ); - this->m_Parameters.SetUint( "OutsideValue", 0 ); -} - -// ------------------------------------------------------------------------- -cpPluginsImageFilters::OtsuThresholdImageFilter:: -~OtsuThresholdImageFilter( ) -{ -} - -// ------------------------------------------------------------------------- -std::string cpPluginsImageFilters::OtsuThresholdImageFilter:: -_GenerateData( ) -{ - auto image = this->GetInputData( "Input" )->GetITK< itk::DataObject >( ); - std::string cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 1 ); - if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 2 ); - if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 3 ); - if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 4 ); - return( r ); -} - -// ------------------------------------------------------------------------- -template< class _TImage > -std::string cpPluginsImageFilters::OtsuThresholdImageFilter:: -_GD0( _TImage* image ) -{ - if( image != NULL ) - return( this->_GD1< _TImage, unsigned char >( image ) ); - else - return( "ImageFilters::OtsuThresholdImageFilter: No valid input image." ); -} - -// ------------------------------------------------------------------------- -template< class _TImage, class _TBinaryPixel > -std::string cpPluginsImageFilters::OtsuThresholdImageFilter:: -_GD1( _TImage* image ) -{ - typedef itk::Image< _TBinaryPixel, _TImage::ImageDimension > _TBinaryImage; - typedef itk::OtsuThresholdImageFilter< _TImage, _TBinaryImage > _TFilter; - - // Get parameters - unsigned int bins = this->m_Parameters.GetUint( "NumberOfHistogramBins" ); - _TBinaryPixel in_val = _TBinaryPixel( this->m_Parameters.GetUint( "InsideValue" ) ); - _TBinaryPixel out_val = _TBinaryPixel( this->m_Parameters.GetUint( "OutsideValue" ) ); - - // Configure filter - _TFilter* filter = this->_CreateITK< _TFilter >( ); - filter->SetInput( image ); - filter->SetNumberOfHistogramBins( bins ); - filter->SetInsideValue( out_val ); // WARNING: these are inverted - filter->SetOutsideValue( in_val ); - filter->Update( ); - - // Connect output - this->GetOutputData( "Output" )->SetITK( filter->GetOutput( ) ); - return( "" ); -} - -// eof - $RCSfile$ diff --git a/plugins/cpPluginsImageFilters/OtsuThresholdImageFilter.h b/plugins/cpPluginsImageFilters/OtsuThresholdImageFilter.h deleted file mode 100644 index db5c201..0000000 --- a/plugins/cpPluginsImageFilters/OtsuThresholdImageFilter.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef __CPPLUGINSIMAGEFILTERS__OTSUTHRESHOLDIMAGEFILTER__H__ -#define __CPPLUGINSIMAGEFILTERS__OTSUTHRESHOLDIMAGEFILTER__H__ - -#include -#include - -namespace cpPluginsImageFilters -{ - /** - */ - class cpPluginsImageFilters_EXPORT OtsuThresholdImageFilter - : public cpPlugins::ProcessObject - { - public: - typedef OtsuThresholdImageFilter Self; - typedef cpPlugins::ProcessObject Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - public: - itkNewMacro( Self ); - itkTypeMacro( OtsuThresholdImageFilter, cpPlugins::ProcessObject ); - cpPlugins_Id_Macro( OtsuThresholdImageFilter, ImageFilters ); - - protected: - OtsuThresholdImageFilter( ); - virtual ~OtsuThresholdImageFilter( ); - - virtual std::string _GenerateData( ) ITK_OVERRIDE; - - template< class _TImage > - inline std::string _GD0( _TImage* image ); - - template< class _TImage, class _TBinaryPixel > - inline std::string _GD1( _TImage* image ); - - private: - // Purposely not implemented - OtsuThresholdImageFilter( const Self& ); - Self& operator=( const Self& ); - }; - -} // ecapseman - -#endif // __CPPLUGINSIMAGEFILTERS__OTSUTHRESHOLDIMAGEFILTER__H__ - -// eof - $RCSfile$ diff --git a/plugins/cpPluginsImageFilters/ResampleImageFilter.cxx b/plugins/cpPluginsImageFilters/ResampleImageFilter.cxx index 1d5b592..8c9a8dd 100644 --- a/plugins/cpPluginsImageFilters/ResampleImageFilter.cxx +++ b/plugins/cpPluginsImageFilters/ResampleImageFilter.cxx @@ -27,10 +27,12 @@ std::string cpPluginsImageFilters::ResampleImageFilter:: _GenerateData( ) { auto image = this->GetInputData( "Input" )->GetITK< itk::DataObject >( ); - std::string cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 1 ); - if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 2 ); + std::string cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 2 ); if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 3 ); - if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 4 ); + /* TODO + if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 1 ); + if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 4 ); + */ return( r ); } diff --git a/plugins/cpPluginsWidgets/SeedWidget.cxx b/plugins/cpPluginsWidgets/SeedWidget.cxx index 34e8efb..03e7215 100644 --- a/plugins/cpPluginsWidgets/SeedWidget.cxx +++ b/plugins/cpPluginsWidgets/SeedWidget.cxx @@ -5,6 +5,7 @@ #include #include #include +#include // ------------------------------------------------------------------------- itk::ModifiedTimeType cpPluginsWidgets::SeedWidget::