X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=plugins%2FcpExtensions%2FSkeletonReader.cxx;fp=plugins%2FcpExtensions%2FSkeletonReader.cxx;h=0000000000000000000000000000000000000000;hb=2e142df11d6f312a2a2b5097b8da73571ed523e8;hp=20ac274ceb71b8ed09ff2186e57553adec527a53;hpb=61b3659afe961ed248f30e26f9ca8f28fcfafddc;p=cpPlugins.git diff --git a/plugins/cpExtensions/SkeletonReader.cxx b/plugins/cpExtensions/SkeletonReader.cxx deleted file mode 100644 index 20ac274..0000000 --- a/plugins/cpExtensions/SkeletonReader.cxx +++ /dev/null @@ -1,93 +0,0 @@ -#include -#include - -#include -#include -#include - -#ifdef cpPlugins_QT4 -# include -#endif // cpPlugins_QT4 - -// ------------------------------------------------------------------------- -QDialog* cpPluginscpExtensions::SkeletonReader:: -CreateQDialog( ) -{ -#ifdef cpPlugins_QT4 - cpPlugins::QT::OpenFileDialog* dlg = NULL; - if( QApplication::instance( ) != NULL ) - { - dlg = new cpPlugins::QT::OpenFileDialog( ); - dlg->SetParameters( &( this->m_Parameters ), "FileName" ); - - } // fi - return( dlg ); -#else // cpPlugins_QT4 - return( NULL ); -#endif // cpPlugins_QT4 -} - -// ------------------------------------------------------------------------- -cpPluginscpExtensions::SkeletonReader:: -SkeletonReader( ) - : Superclass( ) -{ - this->_ConfigureOutput< cpInstances::DataObjects::Skeleton >( "Output" ); - this->m_Parameters.ConfigureAsOpenFileName( "FileName", "" ); - this->m_Parameters.SetAcceptedFileExtensions( - "FileName", - "Skeleton files (*.txt)" - ); -} - -// ------------------------------------------------------------------------- -cpPluginscpExtensions::SkeletonReader:: -~SkeletonReader( ) -{ -} - -// ------------------------------------------------------------------------- -void cpPluginscpExtensions::SkeletonReader:: -_GenerateData( ) -{ - std::string success = ""; -#ifdef cpPlugins_CONFIG_PROCESS_DIMENSIONS_1 - success = this->_GD0< 1 >( ); -#endif // cpPlugins_CONFIG_PROCESS_DIMENSIONS_1 -#ifdef cpPlugins_CONFIG_PROCESS_DIMENSIONS_2 - if( success != "" ) success = this->_GD0< 2 >( ); -#endif // cpPlugins_CONFIG_PROCESS_DIMENSIONS_2 -#ifdef cpPlugins_CONFIG_PROCESS_DIMENSIONS_3 - if( success != "" ) success = this->_GD0< 3 >( ); -#endif // cpPlugins_CONFIG_PROCESS_DIMENSIONS_3 -#ifdef cpPlugins_CONFIG_PROCESS_DIMENSIONS_4 - if( success != "" ) success = this->_GD0< 4 >( ); -#endif // cpPlugins_CONFIG_PROCESS_DIMENSIONS_4 - if( success != "" ) - this->_Error( success ); -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -std::string cpPluginscpExtensions::SkeletonReader:: -_GD0( ) -{ - typedef cpExtensions::DataStructures::Skeleton< _VDim > _TSkeleton; - typedef cpExtensions::Algorithms::SkeletonReader< _TSkeleton > _TReader; - - auto filter = this->_CreateITK< _TReader >( ); - filter->SetFileName( this->m_Parameters.GetOpenFileName( "FileName" ) ); - try - { - filter->Update( ); - } - catch( std::exception& err ) - { - return( err.what( ) ); - - } // yrt - this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) ); - return( "" ); -} - -// eof - $RCSfile$