X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FIO%2FUniqueValuesContainerReader.hxx;fp=lib%2Ffpa%2FIO%2FUniqueValuesContainerReader.hxx;h=0000000000000000000000000000000000000000;hb=8fafb83c41ab35dfc25eb637170882a612924433;hp=16719f2df3191f8065e703e833a8f3c0ffa08f7e;hpb=1aff59e7c480d7448c63694da6f30e3dfb022edf;p=FrontAlgorithms.git diff --git a/lib/fpa/IO/UniqueValuesContainerReader.hxx b/lib/fpa/IO/UniqueValuesContainerReader.hxx deleted file mode 100644 index 16719f2..0000000 --- a/lib/fpa/IO/UniqueValuesContainerReader.hxx +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef __FPA__IO__UNIQUEVALUESCONTAINERREADER__HXX__ -#define __FPA__IO__UNIQUEVALUESCONTAINERREADER__HXX__ - -#include - -// ------------------------------------------------------------------------- -template< class T > -T* fpa::IO::UniqueValuesContainerReader< T >:: -GetOutput( ) -{ - return( itkDynamicCastInDebugMode< T* >( this->GetPrimaryOutput( ) ) ); -} - -// ------------------------------------------------------------------------- -template< class T > -void fpa::IO::UniqueValuesContainerReader< T >:: -Update( ) -{ - this->GenerateData( ); -} - -// ------------------------------------------------------------------------- -template< class T > -fpa::IO::UniqueValuesContainerReader< T >:: -UniqueValuesContainerReader( ) - : Superclass( ), - m_FileName( "" ) -{ - this->itk::ProcessObject::SetNumberOfRequiredOutputs( 1 ); - this->itk::ProcessObject::SetNthOutput( 0, T::New( ) ); -} - -// ------------------------------------------------------------------------- -template< class T > -fpa::IO::UniqueValuesContainerReader< T >:: -~UniqueValuesContainerReader( ) -{ -} - -// ------------------------------------------------------------------------- -template< class T > -void fpa::IO::UniqueValuesContainerReader< T >:: -GenerateData( ) -{ - T* output = this->GetOutput( ); - output->Clear( ); - - std::ifstream in( this->m_FileName.c_str( ) ); - if( !in ) - { - itkExceptionMacro( - << "Error opening file to read a minimum spanning tree: \"" - << this->m_FileName - << "\"" - ); - return; - - } // fi - - unsigned int dim; - unsigned long nVertices; - in >> dim >> nVertices; - for( unsigned long vId = 0; vId < nVertices; ++vId ) - { - typename T::TValue v; - for( unsigned int d = 0; d < dim; ++d ) - { - long val; - in >> val; - if( d < T::TValue::Dimension ) - v[ d ] = val; - - } // rof - output->Insert( v ); - - } // rof - in.close( ); -} - -#endif // __FPA__IO__UNIQUEVALUESCONTAINERREADER__HXX__ - -// eof - $RCSfile$