X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=plugins%2FImageGradientFilters%2FGulsunTekImageFilter.cxx;h=4c4689788472493282aa16d042a8a4ab41f03092;hb=d6b52a06acc7f4303583aad084c368912dbf2068;hp=b707d0067a791867518159079ca528609a3e83e1;hpb=f77263a8b9bbfb4d3f2f179b1da79cf5c55faed3;p=cpPlugins.git diff --git a/plugins/ImageGradientFilters/GulsunTekImageFilter.cxx b/plugins/ImageGradientFilters/GulsunTekImageFilter.cxx index b707d00..4c46897 100644 --- a/plugins/ImageGradientFilters/GulsunTekImageFilter.cxx +++ b/plugins/ImageGradientFilters/GulsunTekImageFilter.cxx @@ -1,22 +1,27 @@ -#include +#include #include +#include + +/* TODO + #include + #include -#include -#include - -#include -#include -#include -#include + #include + #include + #include + #include +*/ // ------------------------------------------------------------------------- cpPluginsImageGradientFilters::GulsunTekImageFilter:: GulsunTekImageFilter( ) : Superclass( ) { - this->_ConfigureInput< cpPlugins::DataObjects::Image >( "Input", true, false ); - this->_ConfigureInput< cpPlugins::DataObjects::Image >( "Mask", false, false ); - this->_ConfigureOutput< cpPlugins::DataObjects::Image >( "Output" ); + typedef cpPlugins::DataObjects::Image _TImage; + + this->_ConfigureInput< _TImage >( "Input", true, false ); + this->_ConfigureInput< _TImage >( "Mask", false, false ); + this->_ConfigureOutput< _TImage >( "Output" ); this->m_Parameters.ConfigureAsReal( "MinRadius" ); this->m_Parameters.ConfigureAsReal( "MaxRadius" ); @@ -39,9 +44,11 @@ cpPluginsImageGradientFilters::GulsunTekImageFilter:: void cpPluginsImageGradientFilters::GulsunTekImageFilter:: _GenerateData( ) { - auto o = this->GetInputData( "Input" ); - cpPlugins_Demangle_ImageCovariantVectors_Dims( o, _GD0 ); - else this->_Error( "Invalid input image." ); + /* TODO + auto o = this->GetInputData( "Input" ); + cpPlugins_Demangle_ImageCovariantVectors_Dims( o, _GD0 ); + else this->_Error( "Invalid input image." ); + */ } // ------------------------------------------------------------------------- @@ -49,39 +56,41 @@ template< class _TImage > void cpPluginsImageGradientFilters::GulsunTekImageFilter:: _GD0( _TImage* image ) { - typedef itk::Image< char, _TImage::ImageDimension > _TChar; - typedef itk::Image< short, _TImage::ImageDimension > _TShort; - typedef itk::Image< int, _TImage::ImageDimension > _TInt; - typedef itk::Image< long, _TImage::ImageDimension > _TLong; - typedef itk::Image< float, _TImage::ImageDimension > _TFloat; - typedef itk::Image< double, _TImage::ImageDimension > _TDouble; - typedef itk::Image< unsigned char, _TImage::ImageDimension > _TUChar; - typedef itk::Image< unsigned short, _TImage::ImageDimension > _TUShort; - typedef itk::Image< unsigned int, _TImage::ImageDimension > _TUInt; - typedef itk::Image< unsigned long, _TImage::ImageDimension > _TULong; + /* TODO + typedef itk::Image< char, _TImage::ImageDimension > _TChar; + typedef itk::Image< short, _TImage::ImageDimension > _TShort; + typedef itk::Image< int, _TImage::ImageDimension > _TInt; + typedef itk::Image< long, _TImage::ImageDimension > _TLong; + typedef itk::Image< float, _TImage::ImageDimension > _TFloat; + typedef itk::Image< double, _TImage::ImageDimension > _TDouble; + typedef itk::Image< unsigned char, _TImage::ImageDimension > _TUChar; + typedef itk::Image< unsigned short, _TImage::ImageDimension > _TUShort; + typedef itk::Image< unsigned int, _TImage::ImageDimension > _TUInt; + typedef itk::Image< unsigned long, _TImage::ImageDimension > _TULong; - auto m = this->GetInput( "Mask" ); - auto ci = m->GetITK< _TChar >( ); - auto si = m->GetITK< _TShort >( ); - auto ii = m->GetITK< _TInt >( ); - auto li = m->GetITK< _TLong >( ); - auto fi = m->GetITK< _TFloat >( ); - auto di = m->GetITK< _TDouble >( ); - auto uci = m->GetITK< _TUChar >( ); - auto usi = m->GetITK< _TUShort >( ); - auto uii = m->GetITK< _TUInt >( ); - auto uli = m->GetITK< _TULong >( ); - if ( ci != NULL ) this->_GD1( image, ci ); - else if( si != NULL ) this->_GD1( image, si ); - else if( ii != NULL ) this->_GD1( image, ii ); - else if( li != NULL ) this->_GD1( image, li ); - else if( fi != NULL ) this->_GD1( image, fi ); - else if( di != NULL ) this->_GD1( image, di ); - else if( uci != NULL ) this->_GD1( image, uci ); - else if( usi != NULL ) this->_GD1( image, usi ); - else if( uii != NULL ) this->_GD1( image, uii ); - else if( uli != NULL ) this->_GD1( image, uli ); - else this->_GD1( image, ci ); + auto m = this->GetInput( "Mask" ); + auto ci = m->GetITK< _TChar >( ); + auto si = m->GetITK< _TShort >( ); + auto ii = m->GetITK< _TInt >( ); + auto li = m->GetITK< _TLong >( ); + auto fi = m->GetITK< _TFloat >( ); + auto di = m->GetITK< _TDouble >( ); + auto uci = m->GetITK< _TUChar >( ); + auto usi = m->GetITK< _TUShort >( ); + auto uii = m->GetITK< _TUInt >( ); + auto uli = m->GetITK< _TULong >( ); + if ( ci != NULL ) this->_GD1( image, ci ); + else if( si != NULL ) this->_GD1( image, si ); + else if( ii != NULL ) this->_GD1( image, ii ); + else if( li != NULL ) this->_GD1( image, li ); + else if( fi != NULL ) this->_GD1( image, fi ); + else if( di != NULL ) this->_GD1( image, di ); + else if( uci != NULL ) this->_GD1( image, uci ); + else if( usi != NULL ) this->_GD1( image, usi ); + else if( uii != NULL ) this->_GD1( image, uii ); + else if( uli != NULL ) this->_GD1( image, uli ); + else this->_GD1( image, ci ); + */ } // ------------------------------------------------------------------------- @@ -89,29 +98,31 @@ template< class _TImage, class _TMask > void cpPluginsImageGradientFilters::GulsunTekImageFilter:: _GD1( _TImage* image, _TMask* mask ) { - typedef typename _TImage::PixelType _TGradient; - typedef cpExtensions::Algorithms::GulsunTekMedialness< _TImage, _TMask > _TFunction; - typedef typename _TFunction::TOutput _TScalar; - typedef itk::Image< _TScalar, _TImage::ImageDimension > _TOutputImage; - typedef cpExtensions::Algorithms::ImageFunctionFilter< _TImage, _TOutputImage, _TFunction > _TFilter; + /* TODO + typedef typename _TImage::PixelType _TGradient; + typedef cpExtensions::Algorithms::GulsunTekMedialness< _TImage, _TMask > _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->SetProfileSampling( this->m_Parameters.GetUint( "ProfileSampling" ) ); - function->SetRadialSampling( this->m_Parameters.GetUint( "RadialSampling" ) ); - filter->SetInput( image ); - if( mask != NULL ) - function->SetMask( mask ); - filter->Update( ); - this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) ); + } // fi + function->SetMinRadius( this->m_Parameters.GetReal( "MinRadius" ) ); + function->SetMaxRadius( this->m_Parameters.GetReal( "MaxRadius" ) ); + function->SetProfileSampling( this->m_Parameters.GetUint( "ProfileSampling" ) ); + function->SetRadialSampling( this->m_Parameters.GetUint( "RadialSampling" ) ); + filter->SetInput( image ); + if( mask != NULL ) + function->SetMask( mask ); + filter->Update( ); + this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) ); + */ } // eof - $RCSfile$