From: Leonardo Flórez-Valencia Date: Tue, 6 Dec 2016 21:25:21 +0000 (-0500) Subject: ... X-Git-Tag: v0.1~23 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=047bca987b3c26b529561b5ba3918156510501fe;p=cpPlugins.git ... --- diff --git a/lib/cpPlugins/BaseObjects/ProcessObject.h b/lib/cpPlugins/BaseObjects/ProcessObject.h index 5dbf8b3..ce5c5a6 100644 --- a/lib/cpPlugins/BaseObjects/ProcessObject.h +++ b/lib/cpPlugins/BaseObjects/ProcessObject.h @@ -51,8 +51,8 @@ namespace cpPlugins Parameters* GetParameters( ); const Parameters* GetParameters( ) const; - virtual void SetITK( itk::LightObject* o ) final; - virtual void SetVTK( vtkObjectBase* o ) final; + virtual void SetITK( itk::LightObject* o ); + virtual void SetVTK( vtkObjectBase* o ); // "Getters" std::set< std::string > GetInputsNames( ) const; diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 9a44ffb..4953e5a 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -73,6 +73,7 @@ TARGET_LINK_LIBRARIES( TARGET_LINK_LIBRARIES( cpPluginsITKSliceFilters cpPluginsITKImageInterpolators + cpPluginsITKImageGenericFilters_1 ) ## eof - $RCSfile$ diff --git a/plugins/ITKImageInterpolators/InterpolateImageFunction.cxx b/plugins/ITKImageInterpolators/InterpolateImageFunction.cxx index 8d85bc9..5089870 100644 --- a/plugins/ITKImageInterpolators/InterpolateImageFunction.cxx +++ b/plugins/ITKImageInterpolators/InterpolateImageFunction.cxx @@ -1,5 +1,21 @@ #include +// ------------------------------------------------------------------------- +void cpPluginsITKImageInterpolators::InterpolateImageFunction:: +SetITK( itk::LightObject* o ) +{ + if( this->m_ITK.GetPointer( ) != o ) + this->m_ITK = o; +} + +// ------------------------------------------------------------------------- +void cpPluginsITKImageInterpolators::InterpolateImageFunction:: +SetVTK( vtkObjectBase* o ) +{ + if( this->m_VTK.GetPointer( ) != o ) + this->m_VTK = o; +} + // ------------------------------------------------------------------------- cpPluginsITKImageInterpolators::InterpolateImageFunction:: InterpolateImageFunction( ) diff --git a/plugins/ITKImageInterpolators/InterpolateImageFunction.h b/plugins/ITKImageInterpolators/InterpolateImageFunction.h index 88b8b58..3a10dab 100644 --- a/plugins/ITKImageInterpolators/InterpolateImageFunction.h +++ b/plugins/ITKImageInterpolators/InterpolateImageFunction.h @@ -21,6 +21,10 @@ namespace cpPluginsITKImageInterpolators itkTypeMacro( BaseFilter, cpPlugins::BaseObjects::ProcessObject ); cpPlugins_Id_Macro( InterpolateImageFunction, ImageInterpolators ); + public: + virtual void SetITK( itk::LightObject* o ) cpPlugins_OVERRIDE; + virtual void SetVTK( vtkObjectBase* o ) cpPlugins_OVERRIDE; + protected: InterpolateImageFunction( ); virtual ~InterpolateImageFunction( ); diff --git a/plugins/ITKSliceFilters/CPRImageFilter.cxx b/plugins/ITKSliceFilters/CPRImageFilter.cxx index 9c22570..2f84bf5 100644 --- a/plugins/ITKSliceFilters/CPRImageFilter.cxx +++ b/plugins/ITKSliceFilters/CPRImageFilter.cxx @@ -1,28 +1,23 @@ #include -/* TODO - #include - #include +#include +#include - #include - #include - #include -*/ +#include +#include +#include // ------------------------------------------------------------------------- cpPluginsITKSliceFilters::CPRImageFilter:: CPRImageFilter( ) : Superclass( ) { - /* TODO - typedef cpInstances::Image _TImage; - typedef cpInstances::Simple3DCurve _TCurve; - this->_ConfigureInput< _TImage >( "Image", true, false ); - this->_ConfigureInput< _TCurve >( "Curve", true, false ); - this->_ConfigureOutput< _TImage >( "Output" ); - - this->m_Parameters.ConfigureAsReal( "SliceRadius", 1 ); - */ + typedef cpInstances::Image _TImage; + typedef cpInstances::Simple3DCurve _TCurve; + this->_ConfigureInput< _TImage >( "Image", true, false ); + this->_ConfigureInput< _TCurve >( "Curve", true, false ); + this->_ConfigureOutput< _TImage >( "Output" ); + this->m_Parameters.ConfigureAsReal( "SliceRadius", 1 ); } // ------------------------------------------------------------------------- @@ -35,11 +30,9 @@ cpPluginsITKSliceFilters::CPRImageFilter:: void cpPluginsITKSliceFilters::CPRImageFilter:: _GenerateData( ) { - /* TODO - auto o = this->GetInputData( "Image" ); - cpPlugins_Demangle_Image_ScalarPixels_1( o, _GD0, 3 ) - this->_Error( "Invalid input image." ); - */ + auto o = this->GetInputData( "Image" ); + cpPlugins_Demangle_Image_ScalarPixels_1( o, _GD0, 3 ) + this->_Error( "Invalid input image." ); } // ------------------------------------------------------------------------- @@ -47,11 +40,9 @@ template< class _TImage > void cpPluginsITKSliceFilters::CPRImageFilter:: _GD0( _TImage* image ) { - /* TODO - auto o = this->GetInputData( "Curve" ); - cpPlugins_Demangle_Simple3DCurve_All_2( o, _GD1, image ) - this->_Error( "Invalid input curve." ); - */ + auto o = this->GetInputData( "Curve" ); + cpPlugins_Demangle_Simple3DCurve_All_2( o, _GD1, image ) + this->_Error( "Invalid input curve." ); } // ------------------------------------------------------------------------- @@ -59,16 +50,14 @@ template< class _TCurve, class _TImage > void cpPluginsITKSliceFilters::CPRImageFilter:: _GD1( _TCurve* curve, _TImage* image ) { - /* TODO - typedef cpExtensions::Algorithms::CPRImageFilter< _TImage, _TCurve > _TFilter; - - auto filter = this->_CreateITK< _TFilter >( ); - filter->SetInput( image ); - filter->SetCurve( curve ); - filter->SetSliceRadius( this->m_Parameters.GetReal( "SliceRadius" ) ); - filter->Update( ); - this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) ); - */ + typedef cpExtensions::Algorithms::CPRImageFilter< _TImage, _TCurve > _TFilter; + + auto filter = this->_CreateITK< _TFilter >( ); + filter->SetInput( image ); + filter->SetCurve( curve ); + filter->SetSliceRadius( this->m_Parameters.GetReal( "SliceRadius" ) ); + filter->Update( ); + this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) ); } // eof - $RCSfile$ diff --git a/plugins/ITKSliceFilters/ITKSliceFilters.i b/plugins/ITKSliceFilters/ITKSliceFilters.i index c7966b4..ee71b1c 100644 --- a/plugins/ITKSliceFilters/ITKSliceFilters.i +++ b/plugins/ITKSliceFilters/ITKSliceFilters.i @@ -1,7 +1,20 @@ header #define ITK_MANUAL_INSTANTIATION -tinclude itkResampleImageFilter:h|hxx +tinclude itkImageToImageFilter:h|hxx +tinclude itkInPlaceImageFilter:h|hxx +instances itk::ImageToImageFilter< itk::Image< #scalar_types#, 3 >, itk::Image< #scalar_types#, 2 > > +instances itk::InPlaceImageFilter< itk::Image< #scalar_types#, 3 >, itk::Image< #scalar_types#, 2 > > +tinclude itkResampleImageFilter:h|hxx instances itk::ResampleImageFilter< itk::Image< #scalar_types#, #pdims# >, itk::Image< #scalar_types#, #pdims# >, #real_types#, #real_types# > +tinclude cpExtensions/Algorithms/IsoImageSlicer:h|hxx +tinclude itkExtractImageFilter:h|hxx +tinclude itkJoinSeriesImageFilter:h|hxx +tinclude itkImageAlgorithm:h|hxx + +cinclude cpExtensions/DataStructures/Simple3DCurve.h +tinclude cpExtensions/Algorithms/CPRImageFilter:h|hxx +instances cpExtensions::Algorithms::CPRImageFilter< itk::Image< #scalar_types#, 3 >, cpExtensions::DataStructures::Simple3DCurve< #real_types# > > + ** eof - $RCSfile$