X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=plugins%2FImageGradientFilters%2FFluxImageFilter.cxx;h=8aa7dd6a9951b52d4fa937024a1cf6fa1df2c5c9;hb=9b11582dc5062474361432e46838c4e790c21f10;hp=8231a82ae48fb673e11051fddb21f34b3ff8f6d2;hpb=9d315ac836e5fe246a8c987681085ee19898affc;p=cpPlugins.git diff --git a/plugins/ImageGradientFilters/FluxImageFilter.cxx b/plugins/ImageGradientFilters/FluxImageFilter.cxx index 8231a82..8aa7dd6 100644 --- a/plugins/ImageGradientFilters/FluxImageFilter.cxx +++ b/plugins/ImageGradientFilters/FluxImageFilter.cxx @@ -2,15 +2,8 @@ #include #include -/* TODO - #include - #include - - #include - #include - #include - #include -*/ +#include +#include // ------------------------------------------------------------------------- cpPluginsImageGradientFilters::FluxImageFilter:: @@ -22,15 +15,10 @@ FluxImageFilter( ) this->_ConfigureInput< _TImage >( "Mask", false, false ); this->_ConfigureOutput< _TImage >( "Output" ); - this->m_Parameters.ConfigureAsReal( "MinRadius" ); - this->m_Parameters.ConfigureAsReal( "MaxRadius" ); - this->m_Parameters.ConfigureAsReal( "RadiusStep" ); - this->m_Parameters.ConfigureAsUint( "RadialSampling" ); - - this->m_Parameters.SetReal( "MinRadius", 0 ); - this->m_Parameters.SetReal( "MaxRadius", 1 ); - this->m_Parameters.SetReal( "RadiusStep", 1 ); - this->m_Parameters.SetUint( "RadialSampling", 4 ); + this->m_Parameters.ConfigureAsReal( "MinRadius", 0 ); + this->m_Parameters.ConfigureAsReal( "MaxRadius", 1 ); + this->m_Parameters.ConfigureAsReal( "RadiusStep", 1 ); + this->m_Parameters.ConfigureAsUint( "RadialSampling", 4 ); } // ------------------------------------------------------------------------- @@ -43,11 +31,9 @@ cpPluginsImageGradientFilters::FluxImageFilter:: void cpPluginsImageGradientFilters::FluxImageFilter:: _GenerateData( ) { - /* TODO - auto o = this->GetInputData( "Input" ); - cpPlugins_Demangle_ImageCovariantVectors_Dims( o, _GD0 ); - else this->_Error( "Invalid input image." ); - */ + auto o = this->GetInputData( "Input" ); + cpPlugins_Demangle_Image_CovariantVectorPixels_AllDims_1( o, _GD0 ) + this->_Error( "Invalid input image." ); } // ------------------------------------------------------------------------- @@ -55,29 +41,27 @@ template< class _TImage > void cpPluginsImageGradientFilters::FluxImageFilter:: _GD0( _TImage* image ) { - /* TODO - typedef typename _TImage::PixelType _TGradient; - typedef cpExtensions::Algorithms::FluxMedialness< _TImage > _TFunction; - typedef typename _TFunction::TOutput _TScalar; - typedef itk::Image< _TScalar, _TImage::ImageDimension > _TOutputImage; - typedef cpExtensions::Algorithms::ImageFunctionFilter< _TImage, _TOutputImage, _TFunction > _TFilter; + typedef typename _TImage::PixelType _TGradient; + typedef cpExtensions::Algorithms::FluxMedialness< _TImage > _TFunction; + typedef typename _TFunction::TOutput _TScalar; + typedef itk::Image< _TScalar, _TImage::ImageDimension > _TOutputImage; + typedef cpExtensions::Algorithms::ImageFunctionFilter< _TImage, _TOutputImage, _TFunction > _TFilter; - auto filter = this->_CreateITK< _TFilter >( ); - auto function = filter->GetFunction( ); - if( function == NULL ) - { - filter->SetFunction( _TFunction::New( ) ); - function = filter->GetFunction( ); + auto filter = this->_CreateITK< _TFilter >( ); + auto function = filter->GetFunction( ); + if( function == NULL ) + { + filter->SetFunction( _TFunction::New( ) ); + function = filter->GetFunction( ); - } // fi - function->SetMinRadius( this->m_Parameters.GetReal( "MinRadius" ) ); - function->SetMaxRadius( this->m_Parameters.GetReal( "MaxRadius" ) ); - function->SetRadiusStep( this->m_Parameters.GetReal( "RadiusStep" ) ); - function->SetRadialSampling( this->m_Parameters.GetUint( "RadialSampling" ) ); - filter->SetInput( image ); - filter->Update( ); - this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) ); - */ + } // fi + function->SetMinRadius( this->m_Parameters.GetReal( "MinRadius" ) ); + function->SetMaxRadius( this->m_Parameters.GetReal( "MaxRadius" ) ); + function->SetRadiusStep( this->m_Parameters.GetReal( "RadiusStep" ) ); + function->SetRadialSampling( this->m_Parameters.GetUint( "RadialSampling" ) ); + filter->SetInput( image ); + filter->Update( ); + this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) ); } // eof - $RCSfile$