X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=plugins%2FITKSliceFilters%2FCPRImageFilter.cxx;fp=plugins%2FITKSliceFilters%2FCPRImageFilter.cxx;h=2f84bf5ba1d33e9c30a9495b5272447e7e8f4bed;hb=047bca987b3c26b529561b5ba3918156510501fe;hp=9c22570bb12e98ec4191d3a6ffd9c2240faa8996;hpb=924ef02257b6a3e987c1033567c7e83bdce170b5;p=cpPlugins.git 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$