From 9cf33dcd27d0c1b6c99bfbbd088d21ae1b75f572 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leonardo=20Fl=C3=B3rez-Valencia?= Date: Mon, 9 Oct 2017 15:56:44 -0500 Subject: [PATCH] ... --- CMakeLists.txt | 12 +- cmake/cpPlgUninstall.cmake.in | 27 ++ data/axial_CT_slice.bmp | Bin 0 -> 66614 bytes lib/fpa/CMakeLists.txt | 2 +- lib/fpa/Common/Image/PathReader.h | 85 ------ lib/fpa/Common/Image/PathReader.hxx | 172 ----------- lib/fpa/Common/Image/PathWriter.h | 69 ----- lib/fpa/Common/Image/PathWriter.hxx | 111 ------- lib/fpa/Common/Image/SkeletonReader.h | 85 ------ lib/fpa/Common/Image/SkeletonReader.hxx | 208 -------------- lib/fpa/Common/Image/SkeletonWriter.h | 74 ----- lib/fpa/Common/Image/SkeletonWriter.hxx | 161 ----------- ...{OriginalRandomWalker.h => RandomWalker.h} | 31 +- ...ginalRandomWalker.hxx => RandomWalker.hxx} | 83 +++--- lib/fpa/Config.h.in | 68 +---- lib/fpa/DataStructures/Graph.h | 167 ----------- lib/fpa/DataStructures/Graph.hxx | 270 ------------------ .../Image/MinimumSpanningTree.h | 77 ----- .../Image/MinimumSpanningTree.hxx | 71 ----- lib/fpa/DataStructures/Image/Path.h | 104 ------- lib/fpa/DataStructures/Image/Path.hxx | 215 -------------- lib/fpa/DataStructures/Image/Skeleton.h | 68 ----- lib/fpa/DataStructures/Image/Skeleton.hxx | 98 ------- lib/fpa/DataStructures/MinimumSpanningTree.h | 74 ----- .../DataStructures/MinimumSpanningTree.hxx | 236 --------------- lib/fpa/VTK/Image/PathToPolyDataFilter.h | 70 ----- lib/fpa/VTK/Image/PathToPolyDataFilter.hxx | 133 --------- lib/fpa/VTK/Image/SkeletonToPolyDataFilter.h | 71 ----- .../VTK/Image/SkeletonToPolyDataFilter.hxx | 154 ---------- 29 files changed, 89 insertions(+), 2907 deletions(-) create mode 100644 cmake/cpPlgUninstall.cmake.in create mode 100644 data/axial_CT_slice.bmp delete mode 100644 lib/fpa/Common/Image/PathReader.h delete mode 100644 lib/fpa/Common/Image/PathReader.hxx delete mode 100644 lib/fpa/Common/Image/PathWriter.h delete mode 100644 lib/fpa/Common/Image/PathWriter.hxx delete mode 100644 lib/fpa/Common/Image/SkeletonReader.h delete mode 100644 lib/fpa/Common/Image/SkeletonReader.hxx delete mode 100644 lib/fpa/Common/Image/SkeletonWriter.h delete mode 100644 lib/fpa/Common/Image/SkeletonWriter.hxx rename lib/fpa/Common/{OriginalRandomWalker.h => RandomWalker.h} (86%) rename lib/fpa/Common/{OriginalRandomWalker.hxx => RandomWalker.hxx} (90%) delete mode 100644 lib/fpa/DataStructures/Graph.h delete mode 100644 lib/fpa/DataStructures/Graph.hxx delete mode 100644 lib/fpa/DataStructures/Image/MinimumSpanningTree.h delete mode 100644 lib/fpa/DataStructures/Image/MinimumSpanningTree.hxx delete mode 100644 lib/fpa/DataStructures/Image/Path.h delete mode 100644 lib/fpa/DataStructures/Image/Path.hxx delete mode 100644 lib/fpa/DataStructures/Image/Skeleton.h delete mode 100644 lib/fpa/DataStructures/Image/Skeleton.hxx delete mode 100644 lib/fpa/DataStructures/MinimumSpanningTree.h delete mode 100644 lib/fpa/DataStructures/MinimumSpanningTree.hxx delete mode 100644 lib/fpa/VTK/Image/PathToPolyDataFilter.h delete mode 100644 lib/fpa/VTK/Image/PathToPolyDataFilter.hxx delete mode 100644 lib/fpa/VTK/Image/SkeletonToPolyDataFilter.h delete mode 100644 lib/fpa/VTK/Image/SkeletonToPolyDataFilter.hxx diff --git a/CMakeLists.txt b/CMakeLists.txt index 6031b51..4f4f232 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ endforeach(_p) find_package(cpPlugins CONFIG REQUIRED) ## == Find eigen3 (http://eigen.tuxfamily.org) -find_package(Eigen3 CONFIG) +find_package(Eigen3 QUIET CONFIG) if(Eigen3_FOUND) include(${EIGEN3_USE_FILE}) endif(Eigen3_FOUND) @@ -37,15 +37,5 @@ subdirs(lib examples appli) ## == Installation commands include(${cpPlugins_INSTALL_FILE}) -## == Uninstall target -configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" - IMMEDIATE @ONLY - ) -add_custom_target( - uninstall - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) - ## eof - $RCSfile$ diff --git a/cmake/cpPlgUninstall.cmake.in b/cmake/cpPlgUninstall.cmake.in new file mode 100644 index 0000000..34c9330 --- /dev/null +++ b/cmake/cpPlgUninstall.cmake.in @@ -0,0 +1,27 @@ +## ========================================================================= +## @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co) +## ========================================================================= + +if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") + message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") +endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") + +file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) +string(REGEX REPLACE "\n" ";" files "${files}") +foreach(file ${files}) + message(STATUS "Uninstalling $ENV{DESTDIR}${file}") + if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + exec_program( + "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" + OUTPUT_VARIABLE rm_out + RETURN_VALUE rm_retval + ) + if(NOT "${rm_retval}" STREQUAL 0) + message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") + endif(NOT "${rm_retval}" STREQUAL 0) + else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + message(STATUS "File $ENV{DESTDIR}${file} does not exist.") + endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") +endforeach(file) + +## eof - $RCSfile$ diff --git a/data/axial_CT_slice.bmp b/data/axial_CT_slice.bmp new file mode 100644 index 0000000000000000000000000000000000000000..1ca6b3b38c38086d958ae8ae0f59659748e46cf1 GIT binary patch literal 66614 zcmeFa2|SeB|2Y11lO-Y%iAY2u5|M~RB;txlL=$EjGiHn#Go~4%u}zjpM3yWOi7XL` zNJO$uCbC49NJL%QZj1jJwB6gixBL0s`~7|Xzi;PN^E~G~&zw2$_j#Z5UeDW(JsKPf zAa>E7~Ymtkbr;yv~=lGNKjA^TDEK%BqSsR2@4BD%a<>Q zL_|a&QBhH7#flY>n3x!}a^*@$TwENIkdS~@ty%?1N=iafQc}?B)vFmfx&MMz0W3EHq>1Ej3145_H7KpQu1 zgj7{kp-r1ML27Dhkh;1$w0ZMpNJB#d($v(1wrtq~X=!OeTeoh7w6(P%9UUEL+qP|x zuC6Ymr>6&P-@YBv*Vl)3?AQSr7#Ki?hKA72ojV~TBO}Pz*cjTiYZqi+1_0J9Z4B)9H|(pC9D! z?+*n81VDj-flyFT5X4|GpyS7nL&3qpP)JA!6dD=|g@uJdCr+Gz!o$O%h=>U2eMMHDk=(!j*f;-pFR!6#Kb_cv9ZvZGiRWrh2S1yosC3EjAH1FEX3f^Oct2~}5DLp3!u(5+jypxWA6 zsIIOKx_$dLR9{~Y-MMoIYG`PH8XFs-rluySxw#o?X=#C4TU#L}lL_6udlzbJYlB!U z7Ig34J*d6C9qQ=lfbQSF4|R5SLS0>5Ph0}?`uh5yhYue@{r&yW zz`y`BI5-Fm4Glq$9zBAFhlin&krC+e~Uw?((zI_Y5 zd-o1{|NcGn;ll@LW@ct~EBNv80|P%W@B;%sFz^EdKQQnE13xhE0|P%W@B;%sFz^Ed zKQQnE13xhE0|P%W@B;%sFz^EdKQQnE13xhE0|P%W@B;%sFz^EdKQQnE13xhE0|P%W z@B;(?5C)dniu^-8{r|HYdH&yyTky9H|GVl+8~%5}`vck^82EvK9~k)W$H4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bFUc6=?%hvPkB1?`SBu%Sq5}iMH@*8uey5HAjvGutQ-+e3rRM*iF8ukc zsAPFjXH(htQEv7dHGaSzz!vZMjXI_G^<+%X`}%WNe(XvQT - -namespace fpa -{ - namespace Common - { - namespace Image - { - /** - */ - template< class _TPath > - class PathReader - : public itk::ProcessObject - { - public: - // Basic types - typedef PathReader Self; - typedef itk::ProcessObject Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - typedef _TPath TPath; - - public: - itkNewMacro( Self ); - itkTypeMacro( PathReader, itk::ProcessObject ); - - itkGetConstMacro( FileName, std::string ); - itkSetMacro( FileName, std::string ); - - public: - TPath* GetOutput( ); - TPath* GetOutput( unsigned int i ); - - virtual void GraftOutput( itk::DataObject* out ); - virtual void GraftOutput( - const typename Superclass::DataObjectIdentifierType& key, - itk::DataObject* out - ); - virtual void GraftNthOutput( unsigned int i, itk::DataObject* out ); - virtual itk::DataObject::Pointer MakeOutput( - itk::ProcessObject::DataObjectPointerArraySizeType i - ) override; - - virtual void Update( ) override - { this->GenerateData( ); } - - protected: - PathReader( ); - virtual ~PathReader( ); - - virtual void GenerateData( ) override; - - // Do nothing - virtual void GenerateOutputInformation( ) override - { } - - private: - // Purposely not implemented - PathReader( const Self& ); - void operator=( const Self& ); - - protected: - std::string m_FileName; - }; - - } // ecapseman - - } // ecapseman - -} // ecapseman - -#ifndef ITK_MANUAL_INSTANTIATION -# include -#endif // ITK_MANUAL_INSTANTIATION -#endif // __fpa__Common__Image__PathReader__h__ - -// eof - $RCSfile$ diff --git a/lib/fpa/Common/Image/PathReader.hxx b/lib/fpa/Common/Image/PathReader.hxx deleted file mode 100644 index e66af4f..0000000 --- a/lib/fpa/Common/Image/PathReader.hxx +++ /dev/null @@ -1,172 +0,0 @@ -// ========================================================================= -// @author Leonardo Florez Valencia -// @email florez-l@javeriana.edu.co -// ========================================================================= -#ifndef __fpa__Common__Image__PathReader__hxx__ -#define __fpa__Common__Image__PathReader__hxx__ - -// ------------------------------------------------------------------------- -template< class _TPath > -_TPath* fpa::Common::Image::PathReader< _TPath >:: -GetOutput( ) -{ - return( - itkDynamicCastInDebugMode< TPath* >( this->GetPrimaryOutput( ) ) - ); -} - -// ------------------------------------------------------------------------- -template< class _TPath > -_TPath* fpa::Common::Image::PathReader< _TPath >:: -GetOutput( unsigned int i ) -{ - return( - itkDynamicCastInDebugMode< TPath* >( - this->itk::ProcessObject::GetOutput( i ) - ) - ); -} - -// ------------------------------------------------------------------------- -template< class _TPath > -void fpa::Common::Image::PathReader< _TPath >:: -GraftOutput( itk::DataObject* out ) -{ - this->GraftNthOutput( 0, out ); -} - -// ------------------------------------------------------------------------- -template< class _TPath > -void fpa::Common::Image::PathReader< _TPath >:: -GraftOutput( - const typename Superclass::DataObjectIdentifierType& key, - itk::DataObject* out - ) -{ - if( out == NULL ) - { - itkExceptionMacro( - << "Requested to graft output that is a NULL pointer" - ); - - } // fi - itk::DataObject* output = this->itk::ProcessObject::GetOutput( key ); - output->Graft( out ); -} - -// ------------------------------------------------------------------------- -template< class _TPath > -void fpa::Common::Image::PathReader< _TPath >:: -GraftNthOutput( unsigned int i, itk::DataObject* out ) -{ - if( i >= this->GetNumberOfIndexedOutputs( ) ) - { - itkExceptionMacro( - << "Requested to graft output " << i - << " but this filter only has " - << this->GetNumberOfIndexedOutputs( ) - << " indexed Outputs." - ); - - } // fi - this->GraftOutput( this->MakeNameFromOutputIndex( i ), out ); -} - -// ------------------------------------------------------------------------- -template< class _TPath > -itk::DataObject::Pointer fpa::Common::Image::PathReader< _TPath >:: -MakeOutput( itk::ProcessObject::DataObjectPointerArraySizeType i ) -{ - return( TPath::New( ).GetPointer( ) ); -} - -// ------------------------------------------------------------------------- -template< class _TPath > -fpa::Common::Image::PathReader< _TPath >:: -PathReader( ) - : Superclass( ) -{ - typename TPath::Pointer out = - static_cast< TPath* >( this->MakeOutput( 0 ).GetPointer( ) ); - this->itk::ProcessObject::SetNumberOfRequiredInputs( 0 ); - this->itk::ProcessObject::SetNumberOfRequiredOutputs( 1 ); - this->itk::ProcessObject::SetNthOutput( 0, out.GetPointer( ) ); -} - -// ------------------------------------------------------------------------- -template< class _TPath > -fpa::Common::Image::PathReader< _TPath >:: -~PathReader( ) -{ -} - -// ------------------------------------------------------------------------- -template< class _TPath > -void fpa::Common::Image::PathReader< _TPath >:: -GenerateData( ) -{ - std::string buffer; - std::ifstream file_stream( this->m_FileName.c_str( ) ); - if( !file_stream ) - { - itkExceptionMacro( - << "Error reading skeleton from \"" << this->m_FileName << "\"" - ); - return; - - } // fi - file_stream.seekg( 0, std::ios::end ); - buffer.reserve( ( unsigned int )( file_stream.tellg( ) ) ); - file_stream.seekg( 0, std::ios::beg ); - buffer.assign( - ( std::istreambuf_iterator< char >( file_stream ) ), - std::istreambuf_iterator< char >( ) - ); - file_stream.close( ); - - std::istringstream in( buffer ); - unsigned int dim; - in >> dim; - if( dim != TPath::Dimension ) - { - itkExceptionMacro( - << "Mismatched path dimension: " << dim - << " != " << TPath::Dimension - ); - return; - - } // fi - - // Read spatial parameters - typename TPath::TSpacing spa; - typename TPath::TDirection dir; - typename TPath::TPoint ori; - for( unsigned int d = 0; d < dim; ++d ) - in >> spa[ d ]; - for( unsigned int d = 0; d < dim; ++d ) - for( unsigned int e = 0; e < dim; ++e ) - in >> dir[ d ][ e ]; - for( unsigned int d = 0; d < dim; ++d ) - in >> ori[ d ]; - - // Read path - TPath* path = this->GetOutput( ); - path->SetSpacing( spa ); - path->SetOrigin( ori ); - path->SetDirection( dir ); - - unsigned long pathSize; - in >> pathSize; - for( unsigned long id = 0; id < pathSize; ++id ) - { - typename TPath::TIndex idx; - for( unsigned int d = 0; d < dim; ++d ) - in >> idx[ d ]; - path->AddVertex( idx ); - - } // rof -} - -#endif // __fpa__Common__Image__PathReader__hxx__ - -// eof - $RCSfile$ diff --git a/lib/fpa/Common/Image/PathWriter.h b/lib/fpa/Common/Image/PathWriter.h deleted file mode 100644 index 621161e..0000000 --- a/lib/fpa/Common/Image/PathWriter.h +++ /dev/null @@ -1,69 +0,0 @@ -// ========================================================================= -// @author Leonardo Florez Valencia -// @email florez-l@javeriana.edu.co -// ========================================================================= -#ifndef __fpa__Common__Image__PathWriter__h__ -#define __fpa__Common__Image__PathWriter__h__ - -#include - -namespace fpa -{ - namespace Common - { - namespace Image - { - /** - */ - template< class _TPath > - class PathWriter - : public itk::ProcessObject - { - public: - // Basic types - typedef PathWriter Self; - typedef itk::ProcessObject Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - typedef _TPath TPath; - - public: - itkNewMacro( Self ); - itkTypeMacro( PathWriter, itk::ProcessObject ); - - itkGetConstMacro( FileName, std::string ); - itkSetMacro( FileName, std::string ); - - public: - const TPath* GetInput( ) const; - void SetInput( const TPath* path ); - virtual void Update( ) override; - - protected: - PathWriter( ); - virtual ~PathWriter( ); - - virtual void GenerateData( ) override; - - private: - // Purposely not implemented - PathWriter( const Self& ); - void operator=( const Self& ); - - protected: - std::string m_FileName; - }; - - } // ecapseman - - } // ecapseman - -} // ecapseman - -#ifndef ITK_MANUAL_INSTANTIATION -# include -#endif // ITK_MANUAL_INSTANTIATION -#endif // __fpa__Common__Image__PathWriter__h__ - -// eof - $RCSfile$ diff --git a/lib/fpa/Common/Image/PathWriter.hxx b/lib/fpa/Common/Image/PathWriter.hxx deleted file mode 100644 index fc3d840..0000000 --- a/lib/fpa/Common/Image/PathWriter.hxx +++ /dev/null @@ -1,111 +0,0 @@ -// ========================================================================= -// @author Leonardo Florez Valencia -// @email florez-l@javeriana.edu.co -// ========================================================================= -#ifndef __fpa__Common__Image__PathWriter__hxx__ -#define __fpa__Common__Image__PathWriter__hxx__ - -#include - -// ------------------------------------------------------------------------- -template< class _TPath > -const _TPath* fpa::Common::Image::PathWriter< _TPath >:: -GetInput( ) const -{ - return( - dynamic_cast< const TPath* >( - this->itk::ProcessObject::GetInput( 0 ) - ) - ); -} - -// ------------------------------------------------------------------------- -template< class _TPath > -void fpa::Common::Image::PathWriter< _TPath >:: -SetInput( const _TPath* path ) -{ - this->itk::ProcessObject::SetNthInput( 0, const_cast< TPath* >( path ) ); -} - -// ------------------------------------------------------------------------- -template< class _TPath > -void fpa::Common::Image::PathWriter< _TPath >:: -Update( ) -{ - TPath* input = const_cast< TPath* >( this->GetInput( ) ); - if( input != NULL ) - { - input->UpdateOutputInformation( ); - input->UpdateOutputData( ); - this->GenerateData( ); - this->ReleaseInputs( ); - - } // fi -} - -// ------------------------------------------------------------------------- -template< class _TPath > -fpa::Common::Image::PathWriter< _TPath >:: -PathWriter( ) - : Superclass( ), - m_FileName( "" ) -{ - this->SetNumberOfRequiredInputs( 1 ); -} - -// ------------------------------------------------------------------------- -template< class _TPath > -fpa::Common::Image::PathWriter< _TPath >:: -~PathWriter( ) -{ -} - -// ------------------------------------------------------------------------- -template< class _TPath > -void fpa::Common::Image::PathWriter< _TPath >:: -GenerateData( ) -{ - const TPath* path = this->GetInput( ); - - // Write base information - std::stringstream out1, out2; - out1 << TPath::Dimension << std::endl; - typename TPath::TSpacing spa = path->GetSpacing( ); - for( unsigned int d = 0; d < TPath::Dimension; ++d ) - out1 << spa[ d ] << " "; - out1 << std::endl; - typename TPath::TDirection dir = path->GetDirection( ); - for( unsigned int d = 0; d < TPath::Dimension; ++d ) - for( unsigned int e = 0; e < TPath::Dimension; ++e ) - out1 << dir[ d ][ e ] << " "; - out1 << std::endl; - typename TPath::TPoint ori = path->GetOrigin( ); - for( unsigned int d = 0; d < TPath::Dimension; ++d ) - out1 << ori[ d ] << " "; - out1 << std::endl; - - // Write path - unsigned int size = path->GetSize( ); - out2 << size << std::endl; - for( unsigned int i = 0; i < path->GetSize( ); ++i ) - { - typename TPath::TIndex v = path->GetVertex( i ); - for( unsigned int d = 0; d < TPath::Dimension; ++d ) - out2 << v[ d ] << " "; - - } // rof - - // Real write - std::ofstream file_stream( this->m_FileName.c_str( ), std::ofstream::binary ); - if( !file_stream ) - itkExceptionMacro( - << "Unable to write skeleton to \"" - << this->m_FileName - << "\"" - ); - file_stream.write( out1.str( ).c_str( ), out1.str( ).size( ) ); -} - -#endif // __fpa__Common__Image__PathWriter__hxx__ - -// eof - $RCSfile$ diff --git a/lib/fpa/Common/Image/SkeletonReader.h b/lib/fpa/Common/Image/SkeletonReader.h deleted file mode 100644 index cc64aae..0000000 --- a/lib/fpa/Common/Image/SkeletonReader.h +++ /dev/null @@ -1,85 +0,0 @@ -// ========================================================================= -// @author Leonardo Florez Valencia -// @email florez-l@javeriana.edu.co -// ========================================================================= -#ifndef __fpa__Common__Image__SkeletonReader__h__ -#define __fpa__Common__Image__SkeletonReader__h__ - -#include - -namespace fpa -{ - namespace Common - { - namespace Image - { - /** - */ - template< class _TSkeleton > - class SkeletonReader - : public itk::ProcessObject - { - public: - // Basic types - typedef SkeletonReader Self; - typedef itk::ProcessObject Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - typedef _TSkeleton TSkeleton; - - public: - itkNewMacro( Self ); - itkTypeMacro( SkeletonReader, itk::ProcessObject ); - - itkGetConstMacro( FileName, std::string ); - itkSetMacro( FileName, std::string ); - - public: - TSkeleton* GetOutput( ); - TSkeleton* GetOutput( unsigned int i ); - - virtual void GraftOutput( itk::DataObject* out ); - virtual void GraftOutput( - const typename Superclass::DataObjectIdentifierType& key, - itk::DataObject* out - ); - virtual void GraftNthOutput( unsigned int i, itk::DataObject* out ); - virtual itk::DataObject::Pointer MakeOutput( - itk::ProcessObject::DataObjectPointerArraySizeType i - ) override; - - virtual void Update( ) override - { this->GenerateData( ); } - - protected: - SkeletonReader( ); - virtual ~SkeletonReader( ); - - virtual void GenerateData( ) override; - - // Do nothing - virtual void GenerateOutputInformation( ) override - { } - - private: - // Purposely not implemented - SkeletonReader( const Self& ); - void operator=( const Self& ); - - protected: - std::string m_FileName; - }; - - } // ecapseman - - } // ecapseman - -} // ecapseman - -#ifndef ITK_MANUAL_INSTANTIATION -# include -#endif // ITK_MANUAL_INSTANTIATION -#endif // __fpa__Common__Image__SkeletonReader__h__ - -// eof - $RCSfile$ diff --git a/lib/fpa/Common/Image/SkeletonReader.hxx b/lib/fpa/Common/Image/SkeletonReader.hxx deleted file mode 100644 index ee886c5..0000000 --- a/lib/fpa/Common/Image/SkeletonReader.hxx +++ /dev/null @@ -1,208 +0,0 @@ -// ========================================================================= -// @author Leonardo Florez Valencia -// @email florez-l@javeriana.edu.co -// ========================================================================= -#ifndef __fpa__Common__Image__SkeletonReader__hxx__ -#define __fpa__Common__Image__SkeletonReader__hxx__ - -// ------------------------------------------------------------------------- -template< class _TSkeleton > -_TSkeleton* fpa::Common::Image::SkeletonReader< _TSkeleton >:: -GetOutput( ) -{ - return( - itkDynamicCastInDebugMode< TSkeleton* >( this->GetPrimaryOutput( ) ) - ); -} - -// ------------------------------------------------------------------------- -template< class _TSkeleton > -_TSkeleton* fpa::Common::Image::SkeletonReader< _TSkeleton >:: -GetOutput( unsigned int i ) -{ - return( - itkDynamicCastInDebugMode< TSkeleton* >( - this->itk::ProcessObject::GetOutput( i ) - ) - ); -} - -// ------------------------------------------------------------------------- -template< class _TSkeleton > -void fpa::Common::Image::SkeletonReader< _TSkeleton >:: -GraftOutput( itk::DataObject* out ) -{ - this->GraftNthOutput( 0, out ); -} - -// ------------------------------------------------------------------------- -template< class _TSkeleton > -void fpa::Common::Image::SkeletonReader< _TSkeleton >:: -GraftOutput( - const typename Superclass::DataObjectIdentifierType& key, - itk::DataObject* out - ) -{ - if( out == NULL ) - { - itkExceptionMacro( - << "Requested to graft output that is a NULL pointer" - ); - - } // fi - itk::DataObject* output = this->itk::ProcessObject::GetOutput( key ); - output->Graft( out ); -} - -// ------------------------------------------------------------------------- -template< class _TSkeleton > -void fpa::Common::Image::SkeletonReader< _TSkeleton >:: -GraftNthOutput( unsigned int i, itk::DataObject* out ) -{ - if( i >= this->GetNumberOfIndexedOutputs( ) ) - { - itkExceptionMacro( - << "Requested to graft output " << i - << " but this filter only has " - << this->GetNumberOfIndexedOutputs( ) - << " indexed Outputs." - ); - - } // fi - this->GraftOutput( this->MakeNameFromOutputIndex( i ), out ); -} - -// ------------------------------------------------------------------------- -template< class _TSkeleton > -itk::DataObject::Pointer -fpa::Common::Image::SkeletonReader< _TSkeleton >:: -MakeOutput( itk::ProcessObject::DataObjectPointerArraySizeType i ) -{ - return( TSkeleton::New( ).GetPointer( ) ); -} - -// ------------------------------------------------------------------------- -template< class _TSkeleton > -fpa::Common::Image::SkeletonReader< _TSkeleton >:: -SkeletonReader( ) - : Superclass( ) -{ - typename TSkeleton::Pointer out = - static_cast< TSkeleton* >( this->MakeOutput( 0 ).GetPointer( ) ); - this->itk::ProcessObject::SetNumberOfRequiredInputs( 0 ); - this->itk::ProcessObject::SetNumberOfRequiredOutputs( 1 ); - this->itk::ProcessObject::SetNthOutput( 0, out.GetPointer( ) ); -} - -// ------------------------------------------------------------------------- -template< class _TSkeleton > -fpa::Common::Image::SkeletonReader< _TSkeleton >:: -~SkeletonReader( ) -{ -} - -// ------------------------------------------------------------------------- -template< class _TSkeleton > -void fpa::Common::Image::SkeletonReader< _TSkeleton >:: -GenerateData( ) -{ - typedef typename TSkeleton::TPath _TPath; - typedef typename _TPath::TIndex _TIndex; - typedef typename _TPath::TSpacing _TSpacing; - typedef typename _TPath::TPoint _TPoint; - typedef typename _TPath::TDirection _TDirection; - - std::string buffer; - std::ifstream file_stream( this->m_FileName.c_str( ) ); - if( !file_stream ) - { - itkExceptionMacro( - << "Error reading skeleton from \"" << this->m_FileName << "\"" - ); - return; - - } // fi - file_stream.seekg( 0, std::ios::end ); - buffer.reserve( ( unsigned int )( file_stream.tellg( ) ) ); - file_stream.seekg( 0, std::ios::beg ); - buffer.assign( - ( std::istreambuf_iterator< char >( file_stream ) ), - std::istreambuf_iterator< char >( ) - ); - file_stream.close( ); - - std::istringstream in( buffer ); - unsigned int dim; - in >> dim; - if( dim != TSkeleton::Dimension ) - { - itkExceptionMacro( - << "Mismatched skeletons dimension: " << dim - << " != " << TSkeleton::Dimension - ); - return; - - } // fi - - // Read spatial parameters - _TSpacing spa; - _TDirection dir; - _TPoint ori; - for( unsigned int d = 0; d < dim; ++d ) - in >> spa[ d ]; - for( unsigned int d = 0; d < dim; ++d ) - for( unsigned int e = 0; e < dim; ++e ) - in >> dir[ d ][ e ]; - for( unsigned int d = 0; d < dim; ++d ) - in >> ori[ d ]; - - // Read end-points, just to ignore - unsigned int n; - in >> n; - for( unsigned int i = 0; i < n; ++i ) - { - _TIndex idx; - for( unsigned int d = 0; d < dim; ++d ) - in >> idx[ d ]; - - } // rof - - // Read bifurcations, just to ignore - in >> n; - for( unsigned int i = 0; i < n; ++i ) - { - _TIndex idx; - for( unsigned int d = 0; d < dim; ++d ) - in >> idx[ d ]; - - } // rof - - // Read paths - TSkeleton* out = this->GetOutput( ); - unsigned int nPaths; - in >> nPaths; - for( unsigned int p = 0; p < nPaths; ++p ) - { - typename _TPath::Pointer path = _TPath::New( ); - path->SetSpacing( spa ); - path->SetOrigin( ori ); - path->SetDirection( dir ); - - unsigned long pathSize; - in >> pathSize; - for( unsigned long id = 0; id < pathSize; ++id ) - { - _TIndex idx; - for( unsigned int d = 0; d < dim; ++d ) - in >> idx[ d ]; - path->AddVertex( idx ); - - } // rof - out->AddBranch( path ); - - } // rof -} - -#endif // __fpa__Common__Image__SkeletonReader__hxx__ - -// eof - $RCSfile$ diff --git a/lib/fpa/Common/Image/SkeletonWriter.h b/lib/fpa/Common/Image/SkeletonWriter.h deleted file mode 100644 index 6348daf..0000000 --- a/lib/fpa/Common/Image/SkeletonWriter.h +++ /dev/null @@ -1,74 +0,0 @@ -// ========================================================================= -// @author Leonardo Florez Valencia -// @email florez-l@javeriana.edu.co -// ========================================================================= -#ifndef __fpa__Common__Image__SkeletonWriter__h__ -#define __fpa__Common__Image__SkeletonWriter__h__ - -#include - -namespace fpa -{ - namespace Common - { - namespace Image - { - /** - */ - template< class _TSkeleton > - class SkeletonWriter - : public itk::ProcessObject - { - public: - // Basic types - typedef SkeletonWriter Self; - typedef itk::ProcessObject Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - typedef _TSkeleton TSkeleton; - typedef typename TSkeleton::TEdges TEdges; - typedef typename TSkeleton::TMatrix TMatrix; - typedef typename TSkeleton::TMatrixRow TMatrixRow; - typedef typename TSkeleton::TPath TPath; - typedef typename TSkeleton::TVertex TVertex; - - public: - itkNewMacro( Self ); - itkTypeMacro( SkeletonWriter, itk::ProcessObject ); - - itkGetConstMacro( FileName, std::string ); - itkSetMacro( FileName, std::string ); - - public: - const TSkeleton* GetInput( ) const; - void SetInput( const TSkeleton* skeleton ); - virtual void Update( ) override; - - protected: - SkeletonWriter( ); - virtual ~SkeletonWriter( ); - - virtual void GenerateData( ) override; - - private: - // Purposely not implemented - SkeletonWriter( const Self& ); - void operator=( const Self& ); - - protected: - std::string m_FileName; - }; - - } // ecapseman - - } // ecapseman - -} // ecapseman - -#ifndef ITK_MANUAL_INSTANTIATION -# include -#endif // ITK_MANUAL_INSTANTIATION -#endif // __fpa__Common__Image__SkeletonWriter__h__ - -// eof - $RCSfile$ diff --git a/lib/fpa/Common/Image/SkeletonWriter.hxx b/lib/fpa/Common/Image/SkeletonWriter.hxx deleted file mode 100644 index 4f392ed..0000000 --- a/lib/fpa/Common/Image/SkeletonWriter.hxx +++ /dev/null @@ -1,161 +0,0 @@ -// ========================================================================= -// @author Leonardo Florez Valencia -// @email florez-l@javeriana.edu.co -// ========================================================================= -#ifndef __fpa__Common__Image__SkeletonWriter__hxx__ -#define __fpa__Common__Image__SkeletonWriter__hxx__ - -#include - -// ------------------------------------------------------------------------- -template< class _TSkeleton > -const _TSkeleton* fpa::Common::Image::SkeletonWriter< _TSkeleton >:: -GetInput( ) const -{ - return( - dynamic_cast< const TSkeleton* >( - this->itk::ProcessObject::GetInput( 0 ) - ) - ); -} - -// ------------------------------------------------------------------------- -template< class _TSkeleton > -void fpa::Common::Image::SkeletonWriter< _TSkeleton >:: -SetInput( const _TSkeleton* skeleton ) -{ - this->itk::ProcessObject::SetNthInput( - 0, const_cast< TSkeleton* >( skeleton ) - ); -} - -// ------------------------------------------------------------------------- -template< class _TSkeleton > -void fpa::Common::Image::SkeletonWriter< _TSkeleton >:: -Update( ) -{ - TSkeleton* input = const_cast< TSkeleton* >( this->GetInput( ) ); - if( input != NULL ) - { - input->UpdateOutputInformation( ); - input->UpdateOutputData( ); - this->GenerateData( ); - this->ReleaseInputs( ); - - } // fi -} - -// ------------------------------------------------------------------------- -template< class _TSkeleton > -fpa::Common::Image::SkeletonWriter< _TSkeleton >:: -SkeletonWriter( ) - : Superclass( ), - m_FileName( "" ) -{ - this->SetNumberOfRequiredInputs( 1 ); -} - -// ------------------------------------------------------------------------- -template< class _TSkeleton > -fpa::Common::Image::SkeletonWriter< _TSkeleton >:: -~SkeletonWriter( ) -{ -} - -// ------------------------------------------------------------------------- -template< class _TSkeleton > -void fpa::Common::Image::SkeletonWriter< _TSkeleton >:: -GenerateData( ) -{ - const TSkeleton* sk = this->GetInput( ); - typename TMatrix::const_iterator mIt = sk->BeginEdgesRows( ); - typename TMatrixRow::const_iterator rIt = mIt->second.begin( ); - typename TEdges::const_iterator eIt = rIt->second.begin( ); - const TPath* path = *eIt; - - // Write base information - std::stringstream out1, out2; - out1 << TSkeleton::Dimension << std::endl; - typename TPath::TSpacing spa = path->GetSpacing( ); - for( unsigned int d = 0; d < TSkeleton::Dimension; ++d ) - out1 << spa[ d ] << " "; - out1 << std::endl; - typename TPath::TDirection dir = path->GetDirection( ); - for( unsigned int d = 0; d < TSkeleton::Dimension; ++d ) - for( unsigned int e = 0; e < TSkeleton::Dimension; ++e ) - out1 << dir[ d ][ e ] << " "; - out1 << std::endl; - typename TPath::TPoint ori = path->GetOrigin( ); - for( unsigned int d = 0; d < TSkeleton::Dimension; ++d ) - out1 << ori[ d ] << " "; - out1 << std::endl; - - // End points - std::vector< TVertex > end_points = sk->GetEndPoints( ); - out1 << end_points.size( ) << std::endl; - typename std::vector< TVertex >::const_iterator epIt = end_points.begin( ); - for( ; epIt != end_points.end( ); ++epIt ) - { - for( unsigned int d = 0; d < TSkeleton::Dimension; ++d ) - out1 << ( *epIt )[ d ] << " "; - out1 << std::endl; - - } // rof - - // Bifurcations - std::vector< TVertex > bifurcations = sk->GetBifurcations( ); - out1 << bifurcations.size( ) << std::endl; - typename std::vector< TVertex >::const_iterator bIt = bifurcations.begin( ); - for( ; bIt != bifurcations.end( ); ++bIt ) - { - for( unsigned int d = 0; d < TSkeleton::Dimension; ++d ) - out1 << ( *bIt )[ d ] << " "; - out1 << std::endl; - - } // rof - - // Write paths - unsigned long pathCount = 0; - mIt = sk->BeginEdgesRows( ); - for( ; mIt != sk->EndEdgesRows( ); ++mIt ) - { - typename TMatrixRow::const_iterator rIt = mIt->second.begin( ); - for( ; rIt != mIt->second.end( ); ++rIt ) - { - typename TEdges::const_iterator eIt = rIt->second.begin( ); - for( ; eIt != rIt->second.end( ); ++eIt ) - { - TPath* path = *eIt; - pathCount++; - unsigned int size = path->GetSize( ); - out2 << size << std::endl; - for( unsigned int i = 0; i < path->GetSize( ); ++i ) - { - TVertex v = path->GetVertex( i ); - for( unsigned int d = 0; d < TSkeleton::Dimension; ++d ) - out2 << v[ d ] << " "; - - } // rof - out2 << std::endl; - - } // rof - - } // rof - - } // rof - out1 << pathCount << std::endl << out2.str( ); - - // Real write - std::ofstream file_stream( this->m_FileName.c_str( ), std::ofstream::binary ); - if( !file_stream ) - itkExceptionMacro( - << "Unable to write skeleton to \"" - << this->m_FileName - << "\"" - ); - file_stream.write( out1.str( ).c_str( ), out1.str( ).size( ) ); -} - -#endif // __fpa__Common__Image__SkeletonWriter__hxx__ - -// eof - $RCSfile$ diff --git a/lib/fpa/Common/OriginalRandomWalker.h b/lib/fpa/Common/RandomWalker.h similarity index 86% rename from lib/fpa/Common/OriginalRandomWalker.h rename to lib/fpa/Common/RandomWalker.h index 0c3a9f8..6a4afa5 100644 --- a/lib/fpa/Common/OriginalRandomWalker.h +++ b/lib/fpa/Common/RandomWalker.h @@ -2,8 +2,8 @@ // @author Leonardo Florez Valencia // @email florez-l@javeriana.edu.co // ========================================================================= -#ifndef __fpa__Common__OriginalRandomWalker__h__ -#define __fpa__Common__OriginalRandomWalker__h__ +#ifndef __fpa__Common__RandomWalker__h__ +#define __fpa__Common__RandomWalker__h__ #include #include @@ -20,7 +20,7 @@ namespace fpa /** */ template< class _TImage, class _TLabels, class _TScalar = float > - class OriginalRandomWalker + class RandomWalker : public itk::ImageToImageFilter< _TImage, _TLabels > { public: @@ -28,7 +28,7 @@ namespace fpa typedef _TLabels TLabels; typedef _TScalar TScalar; - typedef OriginalRandomWalker Self; + typedef RandomWalker Self; typedef itk::ImageToImageFilter< TImage, TLabels > Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; @@ -68,7 +68,7 @@ namespace fpa public: itkNewMacro( Self ); itkTypeMacro( - fpa::Common::OriginalRandomWalker, itk::ImageToImageFilter + fpa::Common::RandomWalker, itk::ImageToImageFilter ); itkGetConstObjectMacro( EdgeFunction, TEdgeFunction ); @@ -78,14 +78,9 @@ namespace fpa fpaFilterInputMacro( InputLabels, TLabels ); fpaFilterOutputMacro( OutputProbabilities, TScalarImage ); - /* TODO - public: - void AddSeed( const TIndex& seed, const TLabel& label ); - */ - protected: - OriginalRandomWalker( ); - virtual ~OriginalRandomWalker( ); + RandomWalker( ); + virtual ~RandomWalker( ); virtual void GenerateData( ) override; @@ -155,17 +150,11 @@ namespace fpa private: // Purposely not implemented - OriginalRandomWalker( const Self& other ); + RandomWalker( const Self& other ); Self& operator=( const Self& other ); protected: - /* TODO - std::vector< TIndex > m_Seeds; - std::vector< TLabel > m_Labels; - */ - typename TEdgeFunction::Pointer m_EdgeFunction; - itk::SimpleFastMutexLock m_Mutex; }; @@ -174,7 +163,7 @@ namespace fpa } // ecapseman #ifndef ITK_MANUAL_INSTANTIATION -# include +# include #endif // ITK_MANUAL_INSTANTIATION -#endif // __fpa__Common__OriginalRandomWalker__h__ +#endif // __fpa__Common__RandomWalker__h__ // eof - $RCSfile$ diff --git a/lib/fpa/Common/OriginalRandomWalker.hxx b/lib/fpa/Common/RandomWalker.hxx similarity index 90% rename from lib/fpa/Common/OriginalRandomWalker.hxx rename to lib/fpa/Common/RandomWalker.hxx index 2d3dc73..a798735 100644 --- a/lib/fpa/Common/OriginalRandomWalker.hxx +++ b/lib/fpa/Common/RandomWalker.hxx @@ -2,29 +2,19 @@ // @author Leonardo Florez Valencia // @email florez-l@javeriana.edu.co // ========================================================================= -#ifndef __fpa__Common__OriginalRandomWalker__hxx__ -#define __fpa__Common__OriginalRandomWalker__hxx__ +#ifndef __fpa__Common__RandomWalker__hxx__ +#define __fpa__Common__RandomWalker__hxx__ #include #include -#include - -// ------------------------------------------------------------------------- -/* TODO - template< class _TImage, class _TLabels, class _TScalar > - void fpa::Common::OriginalRandomWalker< _TImage, _TLabels, _TScalar >:: - AddSeed( const TIndex& seed, const TLabel& label ) - { - this->m_Seeds.push_back( seed ); - this->m_Labels.push_back( label ); - this->Modified( ); - } -*/ +#ifdef USE_Eigen3 +# include +#endif // USE_Eigen3 // ------------------------------------------------------------------------- template< class _TImage, class _TLabels, class _TScalar > -fpa::Common::OriginalRandomWalker< _TImage, _TLabels, _TScalar >:: -OriginalRandomWalker( ) +fpa::Common::RandomWalker< _TImage, _TLabels, _TScalar >:: +RandomWalker( ) : Superclass( ) { fpaFilterInputConfigureMacro( InputLabels, TLabels ); @@ -33,16 +23,17 @@ OriginalRandomWalker( ) // ------------------------------------------------------------------------- template< class _TImage, class _TLabels, class _TScalar > -fpa::Common::OriginalRandomWalker< _TImage, _TLabels, _TScalar >:: -~OriginalRandomWalker( ) +fpa::Common::RandomWalker< _TImage, _TLabels, _TScalar >:: +~RandomWalker( ) { } // ------------------------------------------------------------------------- template< class _TImage, class _TLabels, class _TScalar > -void fpa::Common::OriginalRandomWalker< _TImage, _TLabels, _TScalar >:: +void fpa::Common::RandomWalker< _TImage, _TLabels, _TScalar >:: GenerateData( ) { +#ifdef USE_Eigen3 // Useful typedefs typedef Eigen::Triplet< TScalar > _TTriplet; typedef std::vector< _TTriplet > _TTriplets; @@ -133,13 +124,15 @@ GenerateData( ) // Fill outputs itkDebugMacro( << "Filling output..." ); this->_Output( x, St, invLabels ); +#endif // USE_Eigen3 } // ------------------------------------------------------------------------- template< class _TImage, class _TLabels, class _TScalar > -_TScalar fpa::Common::OriginalRandomWalker< _TImage, _TLabels, _TScalar >:: +_TScalar fpa::Common::RandomWalker< _TImage, _TLabels, _TScalar >:: _L( const TIndex& i, const TIndex& j ) { +#ifdef USE_Eigen3 if( i == j ) { TRegion r = this->GetInput( )->GetRequestedRegion( ); @@ -160,14 +153,18 @@ _L( const TIndex& i, const TIndex& j ) } else return( -( this->m_EdgeFunction->Evaluate( i, j ) ) ); +#else // USE_Eigen3 + return( _TScalar( 0 ) ); +#endif // USE_Eigen3 } // ------------------------------------------------------------------------- template< class _TImage, class _TLabels, class _TScalar > template< class _TTriplets > -void fpa::Common::OriginalRandomWalker< _TImage, _TLabels, _TScalar >:: +void fpa::Common::RandomWalker< _TImage, _TLabels, _TScalar >:: _Boundary( _TTriplets& B, std::map< TLabel, unsigned long >& labels ) { +#ifdef USE_Eigen3 B.clear( ); // Set up the multithreaded processing @@ -190,15 +187,17 @@ _Boundary( _TTriplets& B, std::map< TLabel, unsigned long >& labels ) // Execute threader threads->SingleMethodExecute( ); +#endif // USE_Eigen3 } // ------------------------------------------------------------------------- template< class _TImage, class _TLabels, class _TScalar > template< class _TTriplets > ITK_THREAD_RETURN_TYPE -fpa::Common::OriginalRandomWalker< _TImage, _TLabels, _TScalar >:: +fpa::Common::RandomWalker< _TImage, _TLabels, _TScalar >:: _BoundaryCbk( void* arg ) { +#ifdef USE_Eigen3 _TBoundaryThreadStruct* thrStr; itk::ThreadIdType total, thrId, thrCount; itk::MultiThreader::ThreadInfoStruct* thrInfo = @@ -215,19 +214,21 @@ _BoundaryCbk( void* arg ) reinterpret_cast< _TTriplets* >( thrStr->Triplets ), thrStr->Labels ); +#endif // USE_Eigen3 return( ITK_THREAD_RETURN_VALUE ); } // ------------------------------------------------------------------------- template< class _TImage, class _TLabels, class _TScalar > template< class _TTriplets > -void fpa::Common::OriginalRandomWalker< _TImage, _TLabels, _TScalar >:: +void fpa::Common::RandomWalker< _TImage, _TLabels, _TScalar >:: _ThreadedBoundary( const TRegion& region, const itk::ThreadIdType& id, _TTriplets* B, std::map< TLabel, unsigned long >* labels ) { +#ifdef USE_Eigen3 typedef itk::ImageRegionConstIteratorWithIndex< TLabels > _TIt; typedef typename std::map< TLabel, unsigned long >::value_type _TMapValue; typedef typename std::map< unsigned long, TLabel >::value_type _TInvValue; @@ -250,14 +251,16 @@ _ThreadedBoundary( } // fi } // rof +#endif // USE_Eigen3 } // ------------------------------------------------------------------------- template< class _TImage, class _TLabels, class _TScalar > template< class _TTriplets > -void fpa::Common::OriginalRandomWalker< _TImage, _TLabels, _TScalar >:: +void fpa::Common::RandomWalker< _TImage, _TLabels, _TScalar >:: _Laplacian( _TTriplets& A, _TTriplets& R, const _TTriplets& B ) { +#ifdef USE_Eigen3 A.clear( ); R.clear( ); @@ -282,15 +285,17 @@ _Laplacian( _TTriplets& A, _TTriplets& R, const _TTriplets& B ) // Execute threader threads->SingleMethodExecute( ); +#endif // USE_Eigen3 } // ------------------------------------------------------------------------- template< class _TImage, class _TLabels, class _TScalar > template< class _TTriplets > ITK_THREAD_RETURN_TYPE -fpa::Common::OriginalRandomWalker< _TImage, _TLabels, _TScalar >:: +fpa::Common::RandomWalker< _TImage, _TLabels, _TScalar >:: _LaplacianCbk( void* arg ) { +#ifdef USE_Eigen3 _TLaplacianThreadStruct* thrStr; itk::ThreadIdType total, thrId, thrCount; itk::MultiThreader::ThreadInfoStruct* thrInfo = @@ -308,18 +313,20 @@ _LaplacianCbk( void* arg ) reinterpret_cast< _TTriplets* >( thrStr->R ), reinterpret_cast< const _TTriplets* >( thrStr->B ) ); +#endif // USE_Eigen3 return( ITK_THREAD_RETURN_VALUE ); } // ------------------------------------------------------------------------- template< class _TImage, class _TLabels, class _TScalar > template< class _TTriplets > -void fpa::Common::OriginalRandomWalker< _TImage, _TLabels, _TScalar >:: +void fpa::Common::RandomWalker< _TImage, _TLabels, _TScalar >:: _ThreadedLaplacian( const TRegion& region, const itk::ThreadIdType& id, _TTriplets* A, _TTriplets* R, const _TTriplets* B ) { +#ifdef USE_Eigen3 typedef itk::ImageRegionConstIteratorWithIndex< TImage > _TIt; typedef typename _TTriplets::value_type _TTriplet; @@ -383,16 +390,18 @@ _ThreadedLaplacian( } // rof } // rof +#endif // USE_Eigen3 } // ------------------------------------------------------------------------- template< class _TImage, class _TLabels, class _TScalar > template< class _TMatrix, class _TTriplets > -void fpa::Common::OriginalRandomWalker< _TImage, _TLabels, _TScalar >:: +void fpa::Common::RandomWalker< _TImage, _TLabels, _TScalar >:: _Output( const _TMatrix& X, const _TTriplets& S, const std::vector< TLabel >& invLabels ) { +#ifdef USE_Eigen3 // Set up the multithreaded processing _TOutputThreadStruct thrStr; thrStr.Filter = this; @@ -416,15 +425,17 @@ _Output( // Execute threader threads->SingleMethodExecute( ); +#endif // USE_Eigen3 } // ------------------------------------------------------------------------- template< class _TImage, class _TLabels, class _TScalar > template< class _TMatrix, class _TTriplets > ITK_THREAD_RETURN_TYPE -fpa::Common::OriginalRandomWalker< _TImage, _TLabels, _TScalar >:: +fpa::Common::RandomWalker< _TImage, _TLabels, _TScalar >:: _OutputCbk( void* arg ) { +#ifdef USE_Eigen3 _TOutputThreadStruct* thrStr; itk::ThreadIdType total, thrId, thrCount; itk::MultiThreader::ThreadInfoStruct* thrInfo = @@ -442,19 +453,21 @@ _OutputCbk( void* arg ) reinterpret_cast< const _TTriplets* >( thrStr->S ), thrStr->InvLabels ); +#endif // USE_Eigen3 return( ITK_THREAD_RETURN_VALUE ); } // ------------------------------------------------------------------------- template< class _TImage, class _TLabels, class _TScalar > template< class _TMatrix, class _TTriplets > -void fpa::Common::OriginalRandomWalker< _TImage, _TLabels, _TScalar >:: +void fpa::Common::RandomWalker< _TImage, _TLabels, _TScalar >:: _ThreadedOutput( const TRegion& region, const itk::ThreadIdType& id, const _TMatrix* X, const _TTriplets* S, const std::vector< TLabel >* invLabels ) { +#ifdef USE_Eigen3 // Fill outputs const TLabels* in_labels = this->GetInputLabels( ); TLabels* out_labels = this->GetOutput( ); @@ -496,12 +509,13 @@ _ThreadedOutput( } // fi } // rof +#endif // USE_Eigen3 } // ------------------------------------------------------------------------- template< class _TImage, class _TLabels, class _TScalar > unsigned long -fpa::Common::OriginalRandomWalker< _TImage, _TLabels, _TScalar >:: +fpa::Common::RandomWalker< _TImage, _TLabels, _TScalar >:: _1D( const TIndex& idx, const TRegion& region ) { unsigned long i = idx[ 0 ]; @@ -520,7 +534,7 @@ _1D( const TIndex& idx, const TRegion& region ) template< class _TImage, class _TLabels, class _TScalar > template< class _TTriplets > unsigned long -fpa::Common::OriginalRandomWalker< _TImage, _TLabels, _TScalar >:: +fpa::Common::RandomWalker< _TImage, _TLabels, _TScalar >:: _SeedIndex( const unsigned long& i, const _TTriplets& t ) { unsigned long s = 0; @@ -546,7 +560,7 @@ _SeedIndex( const unsigned long& i, const _TTriplets& t ) template< class _TImage, class _TLabels, class _TScalar > template< class _TTriplets > unsigned long -fpa::Common::OriginalRandomWalker< _TImage, _TLabels, _TScalar >:: +fpa::Common::RandomWalker< _TImage, _TLabels, _TScalar >:: _NearSeedIndex( const unsigned long& i, const _TTriplets& t ) { long s = 0; @@ -569,5 +583,6 @@ _NearSeedIndex( const unsigned long& i, const _TTriplets& t ) return( i - d ); } -#endif // __fpa__Common__OriginalRandomWalker__hxx__ +#endif // __fpa__Common__RandomWalker__hxx__ + // eof - $RCSfile$ diff --git a/lib/fpa/Config.h.in b/lib/fpa/Config.h.in index f93fb23..0e2f039 100644 --- a/lib/fpa/Config.h.in +++ b/lib/fpa/Config.h.in @@ -4,8 +4,8 @@ #ifndef __fpa__Config__h__ #define __fpa__Config__h__ +#include #include -#include #if @Eigen3_FOUND@ == 1 # define USE_Eigen3 @@ -24,71 +24,5 @@ typedef __t__::TInternalTraits::TSeeds TSeeds; \ typedef __t__::TInternalTraits::TVertex TVertex -// ------------------------------------------------------------------------- -#define fpaFilterInputMacro( __n__, __t__ ) \ - private: \ - unsigned int m_##__n__##Idx; \ - public: \ - __t__* Get##__n__( ) \ - { \ - return( \ - dynamic_cast< __t__* >( \ - this->itk::ProcessObject::GetInput( \ - this->m_##__n__##Idx \ - ) ) ); \ - } \ - const __t__* Get##__n__( ) const \ - { \ - return( \ - dynamic_cast< const __t__* >( \ - this->itk::ProcessObject::GetInput( \ - this->m_##__n__##Idx \ - ) ) ); \ - } \ - void Set##__n__( const __t__* i ) \ - { \ - this->itk::ProcessObject::SetNthInput( \ - this->m_##__n__##Idx, \ - const_cast< __t__* >( i ) \ - ); \ - } - -// ------------------------------------------------------------------------- -#define fpaFilterInputConfigureMacro( __n__, __t__ ) \ - this->m_##__n__##Idx = this->GetNumberOfRequiredInputs( ); \ - this->itk::ProcessObject::SetNumberOfRequiredInputs( \ - this->m_##__n__##Idx + 1 \ - ) - -// ------------------------------------------------------------------------- -#define fpaFilterOutputMacro( __n__, __t__ ) \ - private: \ - unsigned int m_##__n__##Idx; \ - public: \ - __t__* Get##__n__( ) \ - { \ - return( \ - dynamic_cast< __t__* >( \ - this->itk::ProcessObject::GetOutput( \ - this->m_##__n__##Idx \ - ) ) ); \ - } \ - const __t__* Get##__n__( ) const \ - { \ - return( \ - dynamic_cast< const __t__* >( \ - this->itk::ProcessObject::GetOutput( \ - this->m_##__n__##Idx \ - ) ) ); \ - } - -// ------------------------------------------------------------------------- -#define fpaFilterOutputConfigureMacro( __n__, __t__ ) \ - this->m_##__n__##Idx = this->GetNumberOfRequiredOutputs( ); \ - this->itk::ProcessObject::SetNumberOfRequiredOutputs( \ - this->m_##__n__##Idx + 1 \ - ); \ - this->SetNthOutput( this->m_##__n__##Idx, __t__::New( ) ) - #endif // __fpa__Config__h__ // eof - $RCSfile$ diff --git a/lib/fpa/DataStructures/Graph.h b/lib/fpa/DataStructures/Graph.h deleted file mode 100644 index 76a617a..0000000 --- a/lib/fpa/DataStructures/Graph.h +++ /dev/null @@ -1,167 +0,0 @@ -// ========================================================================= -// @author Leonardo Florez Valencia -// @email florez-l@javeriana.edu.co -// ========================================================================= -#ifndef __fpa__DataStructures__Graph__h__ -#define __fpa__DataStructures__Graph__h__ - -#include -#include -#include -#include -#include - -namespace fpa -{ - namespace DataStructures - { - /** \brief A generic graph with templated index types. - * - * @param _TVertex Vertex type. - * @param _TCost Cost type. - * @param _TIndex Index type (it should be a strict weak ordering type). - */ - template< class _TVertex, class _TCost, class _TIndex = unsigned long, class _TIndexCompare = std::less< _TIndex > > - class Graph - : public itk::DataObject - { - public: - typedef Graph Self; - typedef itk::DataObject Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - typedef _TVertex TVertex; - typedef _TCost TCost; - typedef _TIndex TIndex; - typedef _TIndexCompare TIndexCompare; - - // Base types - typedef std::map< TIndex, TVertex, TIndexCompare > TVertices; - typedef std::vector< TCost > TEdges; - typedef std::map< TIndex, TEdges, TIndexCompare > TMatrixRow; - typedef std::map< TIndex, TMatrixRow, TIndexCompare > TMatrix; - - public: - itkNewMacro( Self ); - itkTypeMacro( Graph, itk::DataObject ); - - public: - /*! \brief Iterators over vertices. - * These allow you to iterate over all of graph's vertices. - * - * Typical iteration should be done as: - * - * TGraph g; - * ... - * TGraph::TVertices::[const_]iterator vIt = g.BeginVertices( ); - * for( ; vIt != g.EndVertices( ); ++vIt ) - * { - * vIt->first; --> this is the vertex's index <-- - * vIt->second; --> this is the vertex's value <-- - * } - */ - inline typename TVertices::iterator BeginVertices( ) - { return( this->m_Vertices.begin( ) ); } - inline typename TVertices::iterator EndVertices( ) - { return( this->m_Vertices.end( ) ); } - inline typename TVertices::const_iterator BeginVertices( ) const - { return( this->m_Vertices.begin( ) ); } - inline typename TVertices::const_iterator EndVertices( ) const - { return( this->m_Vertices.end( ) ); } - - /*! \brief Iterators over edges. - * These allow you to iterate over all of graph's edges. - * - * Typical iteration should be done as: - * - * TGraph g; - * ... - * TGraph::TMatrix::[const_]iterator mIt = g.BeginEdgesRows( ); - * for( ; mIt != g.EndEdgesRows( ); ++mIt ) - * { - * mIt->first; --> this is the row index. <-- - * TGraph::TMatrixRow::[const_]iterator rIt = mIt->second.begin( ); - * for( ; rIt != mIt->second.end( ); ++rIt ) - * { - * rIt->first; --> this is the column index. - * TGraph::TEdges::[const_]iterator eIt = rIt->second.begin( ); - * for( ; eIt != rIt->second.end( ); ++eIt ) - * *eIt; --> this is the cost between mIt->first and rIt->first - * } - * } - */ - inline typename TMatrix::iterator BeginEdgesRows( ) - { return( this->m_Matrix.begin( ) ); } - inline typename TMatrix::iterator EndEdgetsRows( ) - { return( this->m_Matrix.end( ) ); } - inline typename TMatrix::const_iterator BeginEdgesRows( ) const - { return( this->m_Matrix.begin( ) ); } - inline typename TMatrix::const_iterator EndEdgesRows( ) const - { return( this->m_Matrix.end( ) ); } - - /*! \brief Clear all vertices and edges. - */ - void Clear( ); - - /*! \brief Clear all edges. - */ - inline void ClearEdges( ) - { this->m_Matrix.clear( ); } - - /*! \brief Vertex manipulation methods. - * Names are self-explanatory. - */ - inline bool HasVertexIndex( const TIndex& i ) const - { return( this->m_Vertices.find( i ) != this->m_Vertices.end( ) ); } - inline void SetVertex( const TIndex& index, TVertex& vertex ) - { this->m_Vertices[ index ] = vertex; } - inline TVertex& GetVertex( const TIndex& index ) - { return( this->m_Vertices[ index ] ); } - inline const TVertex& GetVertex( const TIndex& index ) const - { return( this->m_Vertices[ index ] ); } - bool RenameVertex( const TIndex& old_index, const TIndex& new_index ); - void RemoveVertex( const TIndex& index ); - - /*! \brief Edge manipulation methods. - * Names are self-explanatory. - */ - inline void AddEdge( const TIndex& orig, const TIndex& dest, const TCost& cost ) - { this->m_Matrix[ orig ][ dest ].push_back( cost ); } - TEdges& GetEdges( const TIndex& orig, const TIndex& dest ); - const TEdges& GetEdges( const TIndex& orig, const TIndex& dest ) const; - bool HasEdge( const TIndex& orig, const TIndex& dest ) const; - void RemoveEdge( const TIndex& orig, const TIndex& dest, const TCost& cost ); - void RemoveEdges( const TIndex& orig, const TIndex& dest ); - - /*! \brief Returns graph's sinks. - * - * A sink is a special vertex which does not have any "exiting" edges. - * - * @return Sinks ordered by their index. - */ - std::set< TIndex, TIndexCompare > GetSinks( ) const; - - protected: - Graph( ); - virtual ~Graph( ); - - private: - // Purposely not implemented - Graph( const Self& other ); - Self& operator=( const Self& other ); - - protected: - TVertices m_Vertices; - TMatrix m_Matrix; - }; - - } // ecapseman - -} // ecapseman - -#ifndef ITK_MANUAL_INSTANTIATION -# include -#endif // ITK_MANUAL_INSTANTIATION -#endif // __fpa__DataStructures__Graph__h__ -// eof - $RCSfile$ diff --git a/lib/fpa/DataStructures/Graph.hxx b/lib/fpa/DataStructures/Graph.hxx deleted file mode 100644 index 4d348d5..0000000 --- a/lib/fpa/DataStructures/Graph.hxx +++ /dev/null @@ -1,270 +0,0 @@ -// ========================================================================= -// @author Leonardo Florez Valencia -// @email florez-l@javeriana.edu.co -// ========================================================================= -#ifndef __fpa__DataStructures__Graph__hxx__ -#define __fpa__DataStructures__Graph__hxx__ - -// ------------------------------------------------------------------------- -template< class _TVertex, class _TCost, class _TIndex, class _TIndexCompare > -void fpa::DataStructures::Graph< _TVertex, _TCost, _TIndex, _TIndexCompare >:: -Clear( ) -{ - this->m_Vertices.clear( ); - this->m_Matrix.clear( ); -} - -// ------------------------------------------------------------------------- -template< class _TVertex, class _TCost, class _TIndex, class _TIndexCompare > -bool fpa::DataStructures::Graph< _TVertex, _TCost, _TIndex, _TIndexCompare >:: -RenameVertex( const TIndex& old_index, const TIndex& new_index ) -{ - typename TVertices::iterator old_v = this->m_Vertices.find( old_index ); - typename TVertices::iterator new_v = this->m_Vertices.find( new_index ); - if( old_v != this->m_Vertices.end( ) && new_v == this->m_Vertices.end( ) ) - { - // Replace vertex - this->m_Vertices[ new_index ] = old_v->second; - this->m_Vertices.erase( old_index ); - - // Duplicate edges - typename TMatrix::iterator mIt = this->m_Matrix.begin( ); - typename TMatrix::iterator found_row = this->m_Matrix.end( ); - for( ; mIt != this->m_Matrix.end( ); ++mIt ) - { - if( mIt->first == old_index ) - found_row = mIt; - - typename TMatrixRow::iterator rIt = mIt->second.begin( ); - for( ; rIt != mIt->second.end( ); ++rIt ) - { - if( mIt->first == old_index ) - this->m_Matrix[ new_index ][ rIt->first ] = rIt->second; - else if( rIt->first == old_index ) - this->m_Matrix[ mIt->first ][ new_index ] = rIt->second; - - } // rof - - } // rof - - // Delete old edges - if( found_row != this->m_Matrix.end( ) ) - this->m_Matrix.erase( found_row ); - - mIt = this->m_Matrix.begin( ); - for( ; mIt != this->m_Matrix.end( ); ++mIt ) - { - typename TMatrixRow::iterator rIt = mIt->second.begin( ); - while( rIt != mIt->second.end( ) ) - { - if( rIt->first == old_index ) - { - mIt->second.erase( rIt ); - rIt = mIt->second.begin( ); - } - else - ++rIt; - - } // elihw - - } // rof - return( true ); - } - else - return( false ); -} - -// ------------------------------------------------------------------------- -template< class _TVertex, class _TCost, class _TIndex, class _TIndexCompare > -void fpa::DataStructures::Graph< _TVertex, _TCost, _TIndex, _TIndexCompare >:: -RemoveVertex( const TIndex& index ) -{ - typename TVertices::iterator i = this->m_Vertices.find( index ); - if( i != this->m_Vertices.end( ) ) - { - // Delete vertex - this->m_Vertices.erase( i ); - - // Delete edges starting from given vertex - typename TMatrix::iterator mIt = this->m_Matrix.find( index ); - if( mIt != this->m_Matrix.end( ) ) - this->m_Matrix.erase( mIt ); - - // Delete edges arriving to given vertex - mIt = this->m_Matrix.begin( ); - for( ; mIt != this->m_Matrix.end( ); ++mIt ) - { - typename TMatrixRow::iterator rIt = mIt->second.begin( ); - while( rIt != mIt->second.end( ) ) - { - if( rIt->first == index ) - { - mIt->second.erase( rIt ); - rIt = mIt->second.begin( ); - } - else - ++rIt; - - } // elihw - - } // rof - - } // fi -} - -// ------------------------------------------------------------------------- -template< class _TVertex, class _TCost, class _TIndex, class _TIndexCompare > -typename -fpa::DataStructures::Graph< _TVertex, _TCost, _TIndex, _TIndexCompare >:: -TEdges& -fpa::DataStructures::Graph< _TVertex, _TCost, _TIndex, _TIndexCompare >:: -GetEdges( const TIndex& orig, const TIndex& dest ) -{ - static TEdges null_edges; - typename TMatrix::iterator o = this->m_Matrix.find( orig ); - if( o != this->m_Matrix.find( orig ) ) - { - typename TMatrixRow::iterator d = o->second.find( dest ); - if( d == o->second.end( ) ) - { - null_edges.clear( ); - return( null_edges ); - } - else - return( d->second ); - } - else - { - null_edges.clear( ); - return( null_edges ); - - } // fi -} - -// ------------------------------------------------------------------------- -template< class _TVertex, class _TCost, class _TIndex, class _TIndexCompare > -const typename -fpa::DataStructures::Graph< _TVertex, _TCost, _TIndex, _TIndexCompare >:: -TEdges& -fpa::DataStructures::Graph< _TVertex, _TCost, _TIndex, _TIndexCompare >:: -GetEdges( const TIndex& orig, const TIndex& dest ) const -{ - static const TEdges null_edges; - typename TMatrix::iterator o = this->m_Matrix.find( orig ); - if( o != this->m_Matrix.find( orig ) ) - { - typename TMatrixRow::iterator d = o->second.find( dest ); - if( d == o->second.end( ) ) - return( null_edges ); - else - return( d->second ); - } - else - return( null_edges ); -} - -// ------------------------------------------------------------------------- -template< class _TVertex, class _TCost, class _TIndex, class _TIndexCompare > -bool fpa::DataStructures::Graph< _TVertex, _TCost, _TIndex, _TIndexCompare >:: -HasEdge( const TIndex& orig, const TIndex& dest ) const -{ - typename TMatrix::const_iterator mIt = this->m_Matrix.find( orig ); - if( mIt != this->m_Matrix.end( ) ) - return( mIt->second.find( dest ) != mIt->second.end( ) ); - else - return( false ); -} - -// ------------------------------------------------------------------------- -template< class _TVertex, class _TCost, class _TIndex, class _TIndexCompare > -void fpa::DataStructures::Graph< _TVertex, _TCost, _TIndex, _TIndexCompare >:: -RemoveEdge( const TIndex& orig, const TIndex& dest, const TCost& cost ) -{ - typename TMatrix::iterator m = this->m_Matrix.find( orig ); - if( m != this->m_Matrix.end( ) ) - { - typename TMatrixRow::iterator r = m->second.find( dest ); - if( r != m->second.end( ) ) - { - typename TEdges::iterator e = r->second.end( ); - for( - typename TEdges::iterator i = r->second.begin( ); - i != r->second.end( ) && e == r->second.end( ); - ++i - ) - if( *i == cost ) - e = i; - if( e != r->second.end( ) ) - { - r->second.erase( e ); - if( r->second.size( ) == 0 ) - { - m->second.erase( r ); - if( m->second.size( ) == 0 ) - this->m_Matrix.erase( m ); - - } // fi - - } // fi - - } // fi - - } // fi -} - -// ------------------------------------------------------------------------- -template< class _TVertex, class _TCost, class _TIndex, class _TIndexCompare > -void fpa::DataStructures::Graph< _TVertex, _TCost, _TIndex, _TIndexCompare >:: -RemoveEdges( const TIndex& orig, const TIndex& dest ) -{ - typename TMatrix::iterator m = this->m_Matrix.find( orig ); - if( m != this->m_Matrix.end( ) ) - { - typename TMatrixRow::iterator r = m->second.find( dest ); - if( r != m->second.end( ) ) - { - m->second.erase( r ); - if( m->second.size( ) == 0 ) - this->m_Matrix.erase( m ); - - } // fi - - } // fi - -} - -// ------------------------------------------------------------------------- -template< class _TVertex, class _TCost, class _TIndex, class _TIndexCompare > -std::set< _TIndex, _TIndexCompare > -fpa::DataStructures::Graph< _TVertex, _TCost, _TIndex, _TIndexCompare >:: -GetSinks( ) const -{ - std::set< _TIndex, _TIndexCompare > sinks; - - typename TVertices::iterator vIt = this->m_Vertices.begin( ); - for( ; vIt != this->m_Vertices.end( ); ++vIt ) - sinks.insert( vIt->first ); - typename TMatrix::iterator mIt = this->m_Matrix.begin( ); - for( ; mIt != this->m_Matrix.end( ); ++mIt ) - sinks.erase( mIt->first ); - - return( sinks ); -} - -// ------------------------------------------------------------------------- -template< class _TVertex, class _TCost, class _TIndex, class _TIndexCompare > -fpa::DataStructures::Graph< _TVertex, _TCost, _TIndex, _TIndexCompare >:: -Graph( ) - : Superclass( ) -{ -} - -// ------------------------------------------------------------------------- -template< class _TVertex, class _TCost, class _TIndex, class _TIndexCompare > -fpa::DataStructures::Graph< _TVertex, _TCost, _TIndex, _TIndexCompare >:: -~Graph( ) -{ -} - -#endif // __fpa__DataStructures__Graph__hxx__ -// eof - $RCSfile$ diff --git a/lib/fpa/DataStructures/Image/MinimumSpanningTree.h b/lib/fpa/DataStructures/Image/MinimumSpanningTree.h deleted file mode 100644 index 5adcbad..0000000 --- a/lib/fpa/DataStructures/Image/MinimumSpanningTree.h +++ /dev/null @@ -1,77 +0,0 @@ -// ========================================================================= -// @author Leonardo Florez Valencia -// @email florez-l@javeriana.edu.co -// ========================================================================= -#ifndef __fpa__DataStructures__Image__MinimumSpanningTree__h__ -#define __fpa__DataStructures__Image__MinimumSpanningTree__h__ - -#include -#include -#include - -namespace fpa -{ - namespace DataStructures - { - namespace Image - { - /** - */ - template< unsigned int _VDim > - class MinimumSpanningTree - : public fpa::DataStructures::MinimumSpanningTree< itk::Index< _VDim >, itk::Image< itk::Offset< _VDim >, _VDim > > - { - public: - typedef itk::Index< _VDim > TVertex; - typedef itk::Image< itk::Offset< _VDim >, _VDim > TDataStructuresImage; - - typedef MinimumSpanningTree Self; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - typedef fpa::DataStructures::MinimumSpanningTree< TVertex, TDataStructuresImage > Superclass; - - typedef typename Superclass::TCollision TCollision; - typedef typename Superclass::TCollisionsRow TCollisionsRow; - typedef typename Superclass::TCollisions TCollisions; - typedef typename Superclass::TVertices TVertices; - - typedef fpa::DataStructures::Image::Path< _VDim > TPath; - - public: - itkNewMacro( Self ); - itkTypeMacro( - fpa::DataStructures::Image::MinimumSpanningTree, - fpa::DataStructures::MinimumSpanningTree - ); - - public: - virtual TVertex GetParent( const TVertex& v ) const override; - virtual void SetParent( const TVertex& v, const TVertex& p ) override; - - void GetPath( typename TPath::Pointer& path, const TVertex& a ) const; - void GetPath( - typename TPath::Pointer& path, - const TVertex& a, const TVertex& b - ) const; - - protected: - MinimumSpanningTree( ); - virtual ~MinimumSpanningTree( ); - - private: - MinimumSpanningTree( const Self& other ); - Self& operator=( const Self& other ); - }; - - } // ecapseman - - } // ecapseman - -} // ecapseman - -#ifndef ITK_MANUAL_INSTANTIATION -# include -#endif // ITK_MANUAL_INSTANTIATION -#endif // __fpa__DataStructures__Image__MinimumSpanningTree__h__ - -// eof - $RCSfile$ diff --git a/lib/fpa/DataStructures/Image/MinimumSpanningTree.hxx b/lib/fpa/DataStructures/Image/MinimumSpanningTree.hxx deleted file mode 100644 index 29a547c..0000000 --- a/lib/fpa/DataStructures/Image/MinimumSpanningTree.hxx +++ /dev/null @@ -1,71 +0,0 @@ -// ========================================================================= -// @author Leonardo Florez Valencia -// @email florez-l@javeriana.edu.co -// ========================================================================= -#ifndef __fpa__DataStructures__Image__MinimumSpanningTree__hxx__ -#define __fpa__DataStructures__Image__MinimumSpanningTree__hxx__ - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -typename fpa::DataStructures::Image::MinimumSpanningTree< _VDim >:: -TVertex fpa::DataStructures::Image::MinimumSpanningTree< _VDim >:: -GetParent( const TVertex& v ) const -{ - return( v + this->GetPixel( v ) ); -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -void fpa::DataStructures::Image::MinimumSpanningTree< _VDim >:: -SetParent( const TVertex& v, const TVertex& p ) -{ - this->SetPixel( v, p - v ); -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -void fpa::DataStructures::Image::MinimumSpanningTree< _VDim >:: -GetPath( typename TPath::Pointer& path, const TVertex& a ) const -{ - TVertices v = this->GetAxis( a ); - if( path.IsNull( ) ) - path = TPath::New( ); - path->SetReferenceImage( this ); - typename TVertices::const_iterator vIt = v.begin( ); - for( ; vIt != v.end( ); ++vIt ) - path->AddVertex( *vIt ); -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -void fpa::DataStructures::Image::MinimumSpanningTree< _VDim >:: -GetPath( - typename TPath::Pointer& path, const TVertex& a, const TVertex& b - ) const -{ - TVertices v = this->GetAxis( a, b ); - if( path.IsNull( ) ) - path = TPath::New( ); - path->SetReferenceImage( this ); - typename TVertices::const_iterator vIt = v.begin( ); - for( ; vIt != v.end( ); ++vIt ) - path->AddVertex( *vIt ); -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -fpa::DataStructures::Image::MinimumSpanningTree< _VDim >:: -MinimumSpanningTree( ) - : Superclass( ) -{ -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -fpa::DataStructures::Image::MinimumSpanningTree< _VDim >:: -~MinimumSpanningTree( ) -{ -} - -#endif // __fpa__DataStructures__Image__MinimumSpanningTree__hxx__ -// eof - $RCSfile$ diff --git a/lib/fpa/DataStructures/Image/Path.h b/lib/fpa/DataStructures/Image/Path.h deleted file mode 100644 index 3194f90..0000000 --- a/lib/fpa/DataStructures/Image/Path.h +++ /dev/null @@ -1,104 +0,0 @@ -// ========================================================================= -// @author Leonardo Florez Valencia -// @email florez-l@javeriana.edu.co -// ========================================================================= -#ifndef __fpa__DataStructures__Image__Path__h__ -#define __fpa__DataStructures__Image__Path__h__ - -#include -#include - -namespace fpa -{ - namespace DataStructures - { - namespace Image - { - /** - */ - template< unsigned int _VDim > - class Path - : public itk::PolyLineParametricPath< _VDim > - { - public: - typedef Path Self; - typedef itk::PolyLineParametricPath< _VDim > Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - itkStaticConstMacro( Dimension, unsigned int, _VDim ); - - typedef itk::ImageBase< _VDim > TImageBase; - typedef typename TImageBase::SpacingType TSpacing; - typedef typename TImageBase::PointType TPoint; - typedef typename TImageBase::DirectionType TDirection; - typedef typename Superclass::ContinuousIndexType TContinuousIndex; - typedef typename TContinuousIndex::IndexType TIndex; - - public: - itkNewMacro( Self ); - itkTypeMacro( Path, itk::PolyLineParametricPath ); - - itkGetConstReferenceMacro( Spacing, TSpacing ); - itkGetConstReferenceMacro( Origin, TPoint ); - itkGetConstReferenceMacro( Direction, TDirection ); - itkGetConstReferenceMacro( InverseDirection, TDirection ); - - itkSetMacro( Origin, TPoint ); - - public: - unsigned long GetSize( ) const; - TContinuousIndex GetContinuousVertex( unsigned long i ) const; - TIndex GetVertex( unsigned long i ) const; - TPoint GetPoint( unsigned long i ) const; - - virtual void SetSpacing( const TSpacing& spac ); - virtual void SetSpacing( const double spac[ _VDim ] ); - virtual void SetSpacing( const float spac[ _VDim ] ); - virtual void SetOrigin( const double ori[ _VDim ] ); - virtual void SetOrigin( const float ori[ _VDim ] ); - virtual void SetDirection( const TDirection& dir ); - - template< class _TRefImage > - inline void SetReferenceImage( const _TRefImage* image ) - { - this->SetSpacing( image->GetSpacing( ) ); - this->SetOrigin( image->GetOrigin( ) ); - this->SetDirection( image->GetDirection( ) ); - } - - virtual void Graft( itk::DataObject* o ); - - protected: - Path( ); - virtual ~Path( ); - - virtual void _ComputeIndexToPhysicalPointMatrices( ); - - private: - // Purposely not implemented - Path( const Self& other ); - Self& operator=( const Self& other ); - - protected: - TSpacing m_Spacing; - TPoint m_Origin; - TDirection m_Direction; - TDirection m_InverseDirection; - TDirection m_IndexToPhysicalPoint; - TDirection m_PhysicalPointToIndex; - }; - - } // ecapseman - - } // ecapseman - -} // ecapseman - -#ifndef ITK_MANUAL_INSTANTIATION -# include -#endif // ITK_MANUAL_INSTANTIATION - -#endif // __fpa__DataStructures__Image__Path__h__ - -// eof - $RCSfile$ diff --git a/lib/fpa/DataStructures/Image/Path.hxx b/lib/fpa/DataStructures/Image/Path.hxx deleted file mode 100644 index 7fc32cf..0000000 --- a/lib/fpa/DataStructures/Image/Path.hxx +++ /dev/null @@ -1,215 +0,0 @@ -// ========================================================================= -// @author Leonardo Florez Valencia -// @email florez-l@javeriana.edu.co -// ========================================================================= - -#ifndef __fpa__DataStructures__Image__Path__hxx__ -#define __fpa__DataStructures__Image__Path__hxx__ - -#include -#include - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -unsigned long fpa::DataStructures::Image::Path< _VDim >:: -GetSize( ) const -{ - return( this->GetVertexList( )->Size( ) ); -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -typename fpa::DataStructures::Image::Path< _VDim >:: -TContinuousIndex fpa::DataStructures::Image::Path< _VDim >:: -GetContinuousVertex( unsigned long i ) const -{ - return( this->GetVertexList( )->GetElement( i ) ); -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -typename fpa::DataStructures::Image::Path< _VDim >:: -TIndex fpa::DataStructures::Image::Path< _VDim >:: -GetVertex( unsigned long i ) const -{ - TContinuousIndex cidx = this->GetContinuousVertex( i ); - TIndex idx; - for( unsigned int d = 0; d < _VDim; ++d ) - idx[ d ] = cidx[ d ]; - return( idx ); -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -typename fpa::DataStructures::Image::Path< _VDim >:: -TPoint fpa::DataStructures::Image::Path< _VDim >:: -GetPoint( unsigned long i ) const -{ - typedef typename TPoint::CoordRepType _TCoordRep; - TPoint pnt; - TContinuousIndex idx = this->GetVertex( i ); - for( unsigned int r = 0; r < _VDim; ++r ) - { - _TCoordRep sum = itk::NumericTraits< _TCoordRep >::ZeroValue( ); - for( unsigned int c = 0; c < _VDim; ++c ) - sum += this->m_IndexToPhysicalPoint( r, c ) * idx[ c ]; - pnt[ r ] = sum + this->m_Origin[ r ]; - - } // rof - return( pnt ); -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -void fpa::DataStructures::Image::Path< _VDim >:: -SetSpacing( const TSpacing& spac ) -{ - if( this->m_Spacing != spac ) - { - this->m_Spacing = spac; - this->_ComputeIndexToPhysicalPointMatrices( ); - this->Modified( ); - - } // fi -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -void fpa::DataStructures::Image::Path< _VDim >:: -SetSpacing( const double spac[ _VDim ] ) -{ - this->SetSpacing( TSpacing( spac ) ); -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -void fpa::DataStructures::Image::Path< _VDim >:: -SetSpacing( const float spac[ _VDim ] ) -{ - TSpacing s; - for( unsigned int d = 0; d < _VDim; ++d ) - s[ d ] = spac[ d ]; - this->SetSpacing( s ); -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -void fpa::DataStructures::Image::Path< _VDim >:: -SetOrigin( const double ori[ _VDim ] ) -{ - this->SetOrigin( TPoint( ori ) ); -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -void fpa::DataStructures::Image::Path< _VDim >:: -SetOrigin( const float ori[ _VDim ] ) -{ - this->SetOrigin( TPoint( ori ) ); -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -void fpa::DataStructures::Image::Path< _VDim >:: -SetDirection( const TDirection& dir ) -{ - bool modified = false; - for( unsigned int r = 0; r < _VDim; r++ ) - { - for( unsigned int c = 0; c < _VDim; c++ ) - { - if( - itk::Math::NotExactlyEquals( - this->m_Direction[ r ][ c ], dir[ r ][ c ] - ) - ) - { - this->m_Direction[ r ][ c ] = dir[ r ][ c ]; - modified = true; - } // fi - - } // rof - - } // rof - if( modified ) - { - this->_ComputeIndexToPhysicalPointMatrices( ); - this->m_InverseDirection = this->m_Direction.GetInverse( ); - this->Modified( ); - - } // fi -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -void fpa::DataStructures::Image::Path< _VDim >:: -Graft( itk::DataObject* o ) -{ - this->Superclass::Graft( o ); - Self* other = dynamic_cast< Self* >( o ); - if( other != NULL ) - { - this->m_DefaultInputStepSize = other->m_DefaultInputStepSize; - this->Initialize( ); - for( unsigned long i = 0; i < other->GetSize( ); ++i ) - this->AddVertex( other->GetContinuousVertex( i ) ); - this->m_Spacing = other->m_Spacing; - this->m_Origin = other->m_Origin; - this->m_Direction = other->m_Direction; - this->m_InverseDirection = other->m_InverseDirection; - this->m_IndexToPhysicalPoint = other->m_IndexToPhysicalPoint; - this->m_PhysicalPointToIndex = other->m_PhysicalPointToIndex; - - } // fi -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -fpa::DataStructures::Image::Path< _VDim >:: -Path( ) - : Superclass( ) -{ - this->m_Spacing.Fill( 1.0 ); - this->m_Origin.Fill( 0.0 ); - this->m_Direction.SetIdentity( ); - this->m_InverseDirection.SetIdentity( ); - this->m_IndexToPhysicalPoint.SetIdentity( ); - this->m_PhysicalPointToIndex.SetIdentity( ); -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -fpa::DataStructures::Image::Path< _VDim >:: -~Path( ) -{ -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -void fpa::DataStructures::Image::Path< _VDim >:: -_ComputeIndexToPhysicalPointMatrices( ) -{ - TDirection scale; - scale.Fill( 0.0 ); - for( unsigned int i = 0; i < _VDim; i++ ) - { - if( this->m_Spacing[ i ] == 0.0 ) - itkExceptionMacro( - "A spacing of 0 is not allowed: Spacing is " << this->m_Spacing - ); - scale[ i ][ i ] = this->m_Spacing[ i ]; - - } // rof - - if( vnl_determinant( this->m_Direction.GetVnlMatrix( ) ) == 0.0 ) - itkExceptionMacro( - << "Bad direction, determinant is 0. Direction is " - << this->m_Direction - ); - this->m_IndexToPhysicalPoint = this->m_Direction * scale; - this->m_PhysicalPointToIndex = this->m_IndexToPhysicalPoint.GetInverse( ); - this->Modified( ); -} - -#endif // __fpa__DataStructures__Image__Path__hxx__ -// eof - $RCSfile$ diff --git a/lib/fpa/DataStructures/Image/Skeleton.h b/lib/fpa/DataStructures/Image/Skeleton.h deleted file mode 100644 index f51295a..0000000 --- a/lib/fpa/DataStructures/Image/Skeleton.h +++ /dev/null @@ -1,68 +0,0 @@ -// ========================================================================= -// @author Leonardo Florez Valencia -// @email florez-l@javeriana.edu.co -// ========================================================================= -#ifndef __fpa__DataStructures__Image__Skeleton__h__ -#define __fpa__DataStructures__Image__Skeleton__h__ - -#include -#include -#include - -namespace fpa -{ - namespace DataStructures - { - namespace Image - { - /** - */ - template< unsigned int _VDim > - class Skeleton - : public fpa::DataStructures::Graph< typename fpa::DataStructures::Image::Path< _VDim >::TIndex, typename fpa::DataStructures::Image::Path< _VDim >::Pointer, typename fpa::DataStructures::Image::Path< _VDim >::TIndex, typename fpa::DataStructures::Image::Path< _VDim >::TIndex::LexicographicCompare > - { - public: - typedef fpa::DataStructures::Image::Path< _VDim > TPath; - typedef typename TPath::TIndex TIndex; - typedef typename TIndex::LexicographicCompare TIndexCompare; - typedef typename TPath::Pointer TPathPointer; - - itkStaticConstMacro( Dimension, unsigned int, _VDim ); - - typedef fpa::DataStructures::Graph< TIndex, TPathPointer, TIndex, TIndexCompare > Superclass; - typedef Skeleton Self; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - public: - itkNewMacro( Self ); - itkTypeMacro( Skeleton, fpa::Image::Graph ); - - public: - void AddBranch( TPath* path ); - const TPath* GetBranch( const TIndex& a, const TIndex& b ) const; - - std::vector< TIndex > GetEndPoints( ) const; - std::vector< TIndex > GetBifurcations( ) const; - - protected: - Skeleton( ); - virtual ~Skeleton( ); - - private: - // Purposely not implemented - Skeleton( const Self& other ); - Self& operator=( const Self& other ); - }; - - } // ecapseman - - } // ecapseman - -} // ecapseman - -#ifndef ITK_MANUAL_INSTANTIATION -# include -#endif // ITK_MANUAL_INSTANTIATION -#endif // __fpa__DataStructures__Image__Skeleton__h__ -// eof - $RCSfile$ diff --git a/lib/fpa/DataStructures/Image/Skeleton.hxx b/lib/fpa/DataStructures/Image/Skeleton.hxx deleted file mode 100644 index c3316da..0000000 --- a/lib/fpa/DataStructures/Image/Skeleton.hxx +++ /dev/null @@ -1,98 +0,0 @@ -// ========================================================================= -// @author Leonardo Florez Valencia -// @email florez-l@javeriana.edu.co -// ========================================================================= -#ifndef __fpa__DataStructures__Image__Skeleton__hxx__ -#define __fpa__DataStructures__Image__Skeleton__hxx__ - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -void fpa::DataStructures::Image::Skeleton< _VDim >:: -AddBranch( TPath* path ) -{ - // Check inputs - if( path == NULL ) - return; - unsigned long size = path->GetSize( ); - if( size == 0 ) - return; - TIndex a = path->GetVertex( 0 ); - TIndex b = path->GetVertex( size - 1 ); - if( this->HasEdge( a, b ) ) - return; - - // Add path - this->SetVertex( a, a ); - this->SetVertex( b, b ); - this->AddEdge( a, b, path ); - this->AddEdge( b, a, path ); - this->Modified( ); -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -const typename fpa::DataStructures::Image::Skeleton< _VDim >:: -TPath* fpa::DataStructures::Image::Skeleton< _VDim >:: -GetBranch( const TIndex& a, const TIndex& b ) const -{ - static const TPath* null_path = NULL; - if( this->HasEdge( a, b ) ) - return( this->GetEdges( a, b ).front( ) ); - else - return( null_path ); -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -std::vector< typename fpa::DataStructures::Image::Skeleton< _VDim >::TIndex > -fpa::DataStructures::Image::Skeleton< _VDim >:: -GetEndPoints( ) const -{ - std::vector< TIndex > res; - typename Superclass::TMatrix::const_iterator mIt = this->BeginEdgesRows( ); - for( ; mIt != this->EndEdgesRows( ); ++mIt ) - { - unsigned long count = mIt->second.size( ); - if( count == 1 ) - res.push_back( mIt->first ); - - } // rof - return( res ); -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -std::vector< typename fpa::DataStructures::Image::Skeleton< _VDim >::TIndex > -fpa::DataStructures::Image::Skeleton< _VDim >:: -GetBifurcations( ) const -{ - std::vector< TIndex > res; - typename Superclass::TMatrix::const_iterator mIt = this->BeginEdgesRows( ); - for( ; mIt != this->EndEdgesRows( ); ++mIt ) - { - unsigned long count = mIt->second.size( ); - if( count > 1 ) - res.push_back( mIt->first ); - - } // rof - return( res ); -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -fpa::DataStructures::Image::Skeleton< _VDim >:: -Skeleton( ) - : Superclass( ) -{ -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -fpa::DataStructures::Image::Skeleton< _VDim >:: -~Skeleton( ) -{ -} - -#endif // __fpa__DataStructures__Image__Skeleton__hxx__ - -// eof - $RCSfile$ diff --git a/lib/fpa/DataStructures/MinimumSpanningTree.h b/lib/fpa/DataStructures/MinimumSpanningTree.h deleted file mode 100644 index 7d6ce1d..0000000 --- a/lib/fpa/DataStructures/MinimumSpanningTree.h +++ /dev/null @@ -1,74 +0,0 @@ -// ========================================================================= -// @author Leonardo Florez Valencia -// @email florez-l@javeriana.edu.co -// ========================================================================= -#ifndef __fpa__DataStructures__MinimumSpanningTree__h__ -#define __fpa__DataStructures__MinimumSpanningTree__h__ - -#include - -namespace fpa -{ - namespace DataStructures - { - /** - */ - template< class _TVertex, class _Superclass > - class MinimumSpanningTree - : public _Superclass - { - public: - typedef MinimumSpanningTree Self; - typedef _Superclass Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - typedef _TVertex TVertex; - typedef std::pair< TVertex, bool > TCollision; - typedef std::vector< TCollision > TCollisionsRow; - typedef std::vector< TCollisionsRow > TCollisions; - typedef std::vector< TVertex > TVertices; - - protected: - typedef std::vector< unsigned long > _TRow; - typedef std::vector< _TRow > _TMatrix; - - public: - itkTypeMacro( fpa::Base::MinimumSpanningTree, _Superclass ); - - public: - const TCollisions& GetCollisions( ) const; - void SetCollisions( const TCollisions& collisions ); - - void ClearSeeds( ); - void AddSeed( const TVertex& seed, unsigned long fId ); - - virtual TVertex GetParent( const TVertex& v ) const = 0; - virtual void SetParent( const TVertex& v, const TVertex& p ) = 0; - - virtual TVertices GetAxis( const TVertex& a ) const; - virtual TVertices GetAxis( const TVertex& a, const TVertex& b ) const; - - protected: - MinimumSpanningTree( ); - virtual ~MinimumSpanningTree( ); - - private: - MinimumSpanningTree( const Self& other ); - Self& operator=( const Self& other ); - - protected: - TCollisions m_Collisions; - _TMatrix m_FrontPaths; - std::vector< TVertex > m_Seeds; - }; - - } // ecapseman - -} // ecapseman - -#ifndef ITK_MANUAL_INSTANTIATION -# include -#endif // ITK_MANUAL_INSTANTIATION -#endif // __fpa__DataStructures__MinimumSpanningTree__h__ -// eof - $RCSfile$ diff --git a/lib/fpa/DataStructures/MinimumSpanningTree.hxx b/lib/fpa/DataStructures/MinimumSpanningTree.hxx deleted file mode 100644 index c7083d9..0000000 --- a/lib/fpa/DataStructures/MinimumSpanningTree.hxx +++ /dev/null @@ -1,236 +0,0 @@ -// ========================================================================= -// @author Leonardo Florez Valencia -// @email florez-l@javeriana.edu.co -// ========================================================================= -#ifndef __fpa__DataStructures__MinimumSpanningTree__hxx__ -#define __fpa__DataStructures__MinimumSpanningTree__hxx__ - -// ------------------------------------------------------------------------- -template< class _TVertex, class _Superclass > -const typename fpa::DataStructures::MinimumSpanningTree< _TVertex, _Superclass >:: -TCollisions& fpa::DataStructures::MinimumSpanningTree< _TVertex, _Superclass >:: -GetCollisions( ) const -{ - return( this->m_Collisions ); -} - -// ------------------------------------------------------------------------- -template< class _TVertex, class _Superclass > -void fpa::DataStructures::MinimumSpanningTree< _TVertex, _Superclass >:: -SetCollisions( const TCollisions& collisions ) -{ - static const unsigned long _inf = - std::numeric_limits< unsigned long >::max( ); - if( this->m_Collisions == collisions ) - return; - - this->m_Collisions = collisions; - - // Prepare a front graph - unsigned long N = this->m_Collisions.size( ); - _TMatrix dist( N, _TRow( N, _inf ) ); - this->m_FrontPaths = dist; - for( unsigned long i = 0; i < N; ++i ) - { - for( unsigned long j = 0; j < N; ++j ) - { - if( this->m_Collisions[ i ][ j ].second ) - { - dist[ i ][ j ] = 1; - dist[ j ][ i ] = 1; - this->m_FrontPaths[ i ][ j ] = j; - this->m_FrontPaths[ j ][ i ] = i; - - } // fi - - } // rof - dist[ i ][ i ] = 0; - this->m_FrontPaths[ i ][ i ] = i; - - } // rof - - // Use Floyd-Warshall to compute all possible paths between fronts - for( unsigned long k = 0; k < N; ++k ) - { - for( unsigned long i = 0; i < N; ++i ) - { - for( unsigned long j = 0; j < N; ++j ) - { - // WARNING: you don't want a numeric overflow!!! - unsigned long dik = dist[ i ][ k ]; - unsigned long dkj = dist[ k ][ j ]; - unsigned long sum = _inf; - if( dik < _inf && dkj < _inf ) - sum = dik + dkj; - - // Ok, continue Floyd-Warshall - if( sum < dist[ i ][ j ] ) - { - dist[ i ][ j ] = sum; - this->m_FrontPaths[ i ][ j ] = this->m_FrontPaths[ i ][ k ]; - - } // fi - - } // rof - - } // rof - - } // rof - this->m_Seeds.resize( N ); - this->Modified( ); -} - -// ------------------------------------------------------------------------- -template< class _TVertex, class _Superclass > -void fpa::DataStructures::MinimumSpanningTree< _TVertex, _Superclass >:: -ClearSeeds( ) -{ - this->m_Seeds.clear( ); - this->Modified( ); -} - -// ------------------------------------------------------------------------- -template< class _TVertex, class _Superclass > -void fpa::DataStructures::MinimumSpanningTree< _TVertex, _Superclass >:: -AddSeed( const _TVertex& seed, unsigned long fId ) -{ - this->m_Seeds[ fId - 1 ] = seed; - this->Modified( ); -} - -// ------------------------------------------------------------------------- -template< class _TVertex, class _Superclass > -typename fpa::DataStructures::MinimumSpanningTree< _TVertex, _Superclass >:: -TVertices fpa::DataStructures::MinimumSpanningTree< _TVertex, _Superclass >:: -GetAxis( const _TVertex& a ) const -{ - TVertices vertices; - _TVertex it = a; - _TVertex p = this->GetParent( it ); - while( it != p ) - { - vertices.push_back( it ); - it = p; - p = this->GetParent( it ); - - } // elihw - vertices.push_back( it ); - return( vertices ); -} - -// ------------------------------------------------------------------------- -template< class _TVertex, class _Superclass > -typename fpa::DataStructures::MinimumSpanningTree< _TVertex, _Superclass >:: -TVertices fpa::DataStructures::MinimumSpanningTree< _TVertex, _Superclass >:: -GetAxis( const _TVertex& a, const _TVertex& b ) const -{ - static const unsigned long _inf = - std::numeric_limits< unsigned long >::max( ); - - TVertices vertices; - TVertices pa = this->GetAxis( a ); - TVertices pb = this->GetAxis( b ); - if( pa.size( ) > 0 && pb.size( ) > 0 ) - { - // Find front identifiers - unsigned long ia = _inf, ib = _inf; - unsigned long N = this->m_Seeds.size( ); - for( unsigned long i = 0; i < N; ++i ) - { - if( this->m_Seeds[ i ] == pa[ pa.size( ) - 1 ] ) - ia = i; - if( this->m_Seeds[ i ] == pb[ pb.size( ) - 1 ] ) - ib = i; - - } // rof - - // Check if there is a front-jump between given seeds - if( ia != ib ) - { - // Compute front path - std::vector< long > fpath; - fpath.push_back( ia ); - while( ia != ib ) - { - ia = this->m_FrontPaths[ ia ][ ib ]; - fpath.push_back( ia ); - - } // elihw - - // Continue only if both fronts are connected - unsigned int N = fpath.size( ); - if( N > 0 ) - { - // First path: from start vertex to first collision - vertices = this->GetAxis( - a, this->m_Collisions[ fpath[ 0 ] ][ fpath[ 1 ] ].first - ); - - // Intermediary paths - for( unsigned int i = 1; i < N - 1; ++i ) - { - TVertices ipath = - this->GetAxis( - this->m_Collisions[ fpath[ i - 1 ] ][ fpath[ i ] ].first, - this->m_Collisions[ fpath[ i + 1 ] ][ fpath[ i ] ].first - ); - for( long id = 0; id < ipath.size( ); ++id ) - vertices.push_back( ipath[ id ] ); - - } // rof - - // Final path: from last collision to end point - TVertices lpath = - this->GetAxis( - this->m_Collisions[ fpath[ N - 1 ] ][ fpath[ N - 2 ] ].first, b - ); - for( long id = 0; id < lpath.size( ); ++id ) - vertices.push_back( lpath[ id ] ); - - } // fi - } - else - { - // Ignore common part: find common ancestor - long aIt = pa.size( ) - 1; - long bIt = pb.size( ) - 1; - bool cont = true; - while( aIt >= 0 && bIt >= 0 && cont ) - { - cont = ( pa[ aIt ] == pb[ bIt ] ); - aIt--; - bIt--; - - } // elihw - aIt++; - bIt++; - - // Glue both parts - for( long cIt = 0; cIt <= aIt; ++cIt ) - vertices.push_back( pa[ cIt ] ); - for( ; bIt >= 0; --bIt ) - vertices.push_back( pb[ bIt ] ); - - } // fi - - } // fi - return( vertices ); -} - -// ------------------------------------------------------------------------- -template< class _TVertex, class _Superclass > -fpa::DataStructures::MinimumSpanningTree< _TVertex, _Superclass >:: -MinimumSpanningTree( ) - : Superclass( ) -{ -} - -// ------------------------------------------------------------------------- -template< class _TVertex, class _Superclass > -fpa::DataStructures::MinimumSpanningTree< _TVertex, _Superclass >:: -~MinimumSpanningTree( ) -{ -} - -#endif // __fpa__DataStructures__MinimumSpanningTree__hxx__ -// eof - $RCSfile$ diff --git a/lib/fpa/VTK/Image/PathToPolyDataFilter.h b/lib/fpa/VTK/Image/PathToPolyDataFilter.h deleted file mode 100644 index d6157e0..0000000 --- a/lib/fpa/VTK/Image/PathToPolyDataFilter.h +++ /dev/null @@ -1,70 +0,0 @@ -// ========================================================================= -// @author Leonardo Florez Valencia -// @email florez-l@javeriana.edu.co -// ========================================================================= -#ifndef __fpa__VTK__Image__PathToPolyDataFilter__h__ -#define __fpa__VTK__Image__PathToPolyDataFilter__h__ - -#include - -namespace fpa -{ - namespace VTK - { - namespace Image - { - /** - */ - template< class _TPath > - class PathToPolyDataFilter - : public vtkPolyDataAlgorithm - { - public: - typedef PathToPolyDataFilter Self; - typedef _TPath TPath; - - public: - vtkTypeMacro( PathToPolyDataFilter, vtkPolyDataAlgorithm ); - - public: - static Self* New( ); - - const TPath* GetInput( ) const; - void SetInput( const TPath* path ); - - protected: - PathToPolyDataFilter( ); - virtual ~PathToPolyDataFilter( ); - - int RequestData( - vtkInformation* information, - vtkInformationVector** input, - vtkInformationVector* output - ); - int RequestInformation( - vtkInformation* information, - vtkInformationVector** input, - vtkInformationVector* output - ); - - private: - // Purposely not implemented - PathToPolyDataFilter( const Self& ); - void operator=( const Self& ); - - protected: - const TPath* m_Path; - }; - - } // ecapseman - - } // ecapseman - -} // ecapseman - -#ifndef ITK_MANUAL_INSTANTIATION -# include -#endif // ITK_MANUAL_INSTANTIATION -#endif // __fpa__VTK__Image__PathToPolyDataFilter__h__ - -// eof - $RCSfile$ diff --git a/lib/fpa/VTK/Image/PathToPolyDataFilter.hxx b/lib/fpa/VTK/Image/PathToPolyDataFilter.hxx deleted file mode 100644 index 4965778..0000000 --- a/lib/fpa/VTK/Image/PathToPolyDataFilter.hxx +++ /dev/null @@ -1,133 +0,0 @@ -// ========================================================================= -// @author Leonardo Florez Valencia -// @email florez-l@javeriana.edu.co -// ========================================================================= -#ifndef __fpa__VTK__Image__PathToPolyDataFilter__hxx__ -#define __fpa__VTK__Image__PathToPolyDataFilter__hxx__ - -#include -#include -#include -#include -#include -#include - -// ------------------------------------------------------------------------- -template< class _TPath > -typename fpa::VTK::Image::PathToPolyDataFilter< _TPath >:: -Self* fpa::VTK::Image::PathToPolyDataFilter< _TPath >:: -New( ) -{ - return( new Self( ) ); -} - -// ------------------------------------------------------------------------- -template< class _TPath > -const typename -fpa::VTK::Image::PathToPolyDataFilter< _TPath >:: -TPath* fpa::VTK::Image::PathToPolyDataFilter< _TPath >:: -GetInput( ) const -{ - return( this->m_Path ); -} - -// ------------------------------------------------------------------------- -template< class _TPath > -void fpa::VTK::Image::PathToPolyDataFilter< _TPath >:: -SetInput( const TPath* path ) -{ - if( this->m_Path != path ) - { - this->m_Path = path; - this->Modified( ); - - } // fi -} - -// ------------------------------------------------------------------------- -template< class _TPath > -fpa::VTK::Image::PathToPolyDataFilter< _TPath >:: -PathToPolyDataFilter( ) - : vtkPolyDataAlgorithm( ), - m_Path( NULL ) -{ - this->SetNumberOfInputPorts( 0 ); -} - -// ------------------------------------------------------------------------- -template< class _TPath > -fpa::VTK::Image::PathToPolyDataFilter< _TPath >:: -~PathToPolyDataFilter( ) -{ -} - -// ------------------------------------------------------------------------- -template< class _TPath > -int fpa::VTK::Image::PathToPolyDataFilter< _TPath >:: -RequestData( - vtkInformation* information, - vtkInformationVector** input, - vtkInformationVector* output - ) -{ - static const unsigned int dim = TPath::PathDimension; - if( this->m_Path == NULL ) - return( 0 ); - - // Get output - vtkInformation* info = output->GetInformationObject( 0 ); - vtkPolyData* out = vtkPolyData::SafeDownCast( - info->Get( vtkDataObject::DATA_OBJECT( ) ) - ); - - // Prepare data - out->SetPoints( vtkSmartPointer< vtkPoints >::New( ) ); - out->SetVerts( vtkSmartPointer< vtkCellArray >::New( ) ); - out->SetLines( vtkSmartPointer< vtkCellArray >::New( ) ); - out->SetPolys( vtkSmartPointer< vtkCellArray >::New( ) ); - out->SetStrips( vtkSmartPointer< vtkCellArray >::New( ) ); - vtkSmartPointer< vtkUnsignedIntArray > darray = - vtkSmartPointer< vtkUnsignedIntArray >::New( ); - darray->SetNumberOfComponents( 1 ); - out->GetPointData( )->SetScalars( darray ); - vtkPoints* points = out->GetPoints( ); - vtkCellArray* lines = out->GetLines( ); - - // Assign all data - const TPath* path = this->GetInput( ); - for( unsigned long i = 0; i < path->GetSize( ); ++i ) - { - auto pnt = path->GetPoint( i ); - if( dim == 1 ) - points->InsertNextPoint( pnt[ 0 ], 0, 0 ); - else if( dim == 2 ) - points->InsertNextPoint( pnt[ 0 ], pnt[ 1 ], 0 ); - else - points->InsertNextPoint( pnt[ 0 ], pnt[ 1 ], pnt[ 2 ] ); - darray->InsertNextTuple1( double( i ) ); - if( i > 0 ) - { - lines->InsertNextCell( 2 ); - lines->InsertCellPoint( points->GetNumberOfPoints( ) - 2 ); - lines->InsertCellPoint( points->GetNumberOfPoints( ) - 1 ); - - } // fi - - } // rof - return( 1 ); -} - -// ------------------------------------------------------------------------- -template< class _TPath > -int fpa::VTK::Image::PathToPolyDataFilter< _TPath >:: -RequestInformation( - vtkInformation* information, - vtkInformationVector** input, - vtkInformationVector* output - ) -{ - return( 1 ); -} - -#endif // __fpa__VTK__Image__PathToPolyDataFilterFilter__hxx__ -// eof - $RCSfile$ diff --git a/lib/fpa/VTK/Image/SkeletonToPolyDataFilter.h b/lib/fpa/VTK/Image/SkeletonToPolyDataFilter.h deleted file mode 100644 index f34ae2e..0000000 --- a/lib/fpa/VTK/Image/SkeletonToPolyDataFilter.h +++ /dev/null @@ -1,71 +0,0 @@ -// ========================================================================= -// @author Leonardo Florez Valencia -// @email florez-l@javeriana.edu.co -// ========================================================================= -#ifndef __fpa__VTK__Image__SkeletonToPolyDataFilter__h__ -#define __fpa__VTK__Image__SkeletonToPolyDataFilter__h__ - -#include - -namespace fpa -{ - namespace VTK - { - namespace Image - { - /** - */ - template< class _TSkeleton > - class SkeletonToPolyDataFilter - : public vtkPolyDataAlgorithm - { - public: - typedef SkeletonToPolyDataFilter Self; - typedef _TSkeleton TSkeleton; - - public: - vtkTypeMacro( SkeletonToPolyDataFilter, vtkPolyDataAlgorithm ); - - public: - static Self* New( ); - - const TSkeleton* GetInput( ) const; - void SetInput( const TSkeleton* sk ); - - protected: - SkeletonToPolyDataFilter( ); - virtual ~SkeletonToPolyDataFilter( ); - - int RequestData( - vtkInformation* information, - vtkInformationVector** input, - vtkInformationVector* output - ); - int RequestInformation( - vtkInformation* information, - vtkInformationVector** input, - vtkInformationVector* output - ); - - private: - // Purposely not implemented - SkeletonToPolyDataFilter( const Self& ); - void operator=( const Self& ); - - protected: - const TSkeleton* m_Skeleton; - }; - - } // ecapseman - - } // ecapseman - -} // ecapseman - -#ifndef ITK_MANUAL_INSTANTIATION -# include -#endif // ITK_MANUAL_INSTANTIATION - -#endif // __fpa__VTK__Image__SkeletonToPolyDataFilter__h__ - -// eof - $RCSfile$ diff --git a/lib/fpa/VTK/Image/SkeletonToPolyDataFilter.hxx b/lib/fpa/VTK/Image/SkeletonToPolyDataFilter.hxx deleted file mode 100644 index 6b1aeef..0000000 --- a/lib/fpa/VTK/Image/SkeletonToPolyDataFilter.hxx +++ /dev/null @@ -1,154 +0,0 @@ -// ========================================================================= -// @author Leonardo Florez Valencia -// @email florez-l@javeriana.edu.co -// ========================================================================= -#ifndef __fpa__VTK__Image__SkeletonToPolyDataFilter__hxx__ -#define __fpa__VTK__Image__SkeletonToPolyDataFilter__hxx__ - -#include -#include -#include -#include -#include -#include - -// ------------------------------------------------------------------------- -template< class _TSkeleton > -typename fpa::VTK::Image::SkeletonToPolyDataFilter< _TSkeleton >:: -Self* fpa::VTK::Image::SkeletonToPolyDataFilter< _TSkeleton >:: -New( ) -{ - return( new Self( ) ); -} - -// ------------------------------------------------------------------------- -template< class _TSkeleton > -const typename -fpa::VTK::Image::SkeletonToPolyDataFilter< _TSkeleton >:: -TSkeleton* fpa::VTK::Image::SkeletonToPolyDataFilter< _TSkeleton >:: -GetInput( ) const -{ - return( this->m_Skeleton ); -} - -// ------------------------------------------------------------------------- -template< class _TSkeleton > -void fpa::VTK::Image::SkeletonToPolyDataFilter< _TSkeleton >:: -SetInput( const TSkeleton* sk ) -{ - if( this->m_Skeleton != sk ) - { - this->m_Skeleton = sk; - this->Modified( ); - - } // fi -} - -// ------------------------------------------------------------------------- -template< class _TSkeleton > -fpa::VTK::Image::SkeletonToPolyDataFilter< _TSkeleton >:: -SkeletonToPolyDataFilter( ) - : vtkPolyDataAlgorithm( ), - m_Skeleton( NULL ) -{ - this->SetNumberOfInputPorts( 0 ); -} - -// ------------------------------------------------------------------------- -template< class _TSkeleton > -fpa::VTK::Image::SkeletonToPolyDataFilter< _TSkeleton >:: -~SkeletonToPolyDataFilter( ) -{ -} - -// ------------------------------------------------------------------------- -template< class _TSkeleton > -int fpa::VTK::Image::SkeletonToPolyDataFilter< _TSkeleton >:: -RequestData( - vtkInformation* information, - vtkInformationVector** input, - vtkInformationVector* output - ) -{ - typedef typename _TSkeleton::TPath _TPath; - static const unsigned int dim = _TPath::PathDimension; - - if( this->m_Skeleton == NULL ) - return( 0 ); - - // Get output - vtkInformation* info = output->GetInformationObject( 0 ); - vtkPolyData* out = vtkPolyData::SafeDownCast( - info->Get( vtkDataObject::DATA_OBJECT( ) ) - ); - - // Prepare data - out->SetPoints( vtkSmartPointer< vtkPoints >::New( ) ); - out->SetVerts( vtkSmartPointer< vtkCellArray >::New( ) ); - out->SetLines( vtkSmartPointer< vtkCellArray >::New( ) ); - out->SetPolys( vtkSmartPointer< vtkCellArray >::New( ) ); - out->SetStrips( vtkSmartPointer< vtkCellArray >::New( ) ); - vtkSmartPointer< vtkUnsignedIntArray > darray = - vtkSmartPointer< vtkUnsignedIntArray >::New( ); - darray->SetNumberOfComponents( 1 ); - out->GetPointData( )->SetScalars( darray ); - vtkPoints* points = out->GetPoints( ); - vtkCellArray* lines = out->GetLines( ); - - // Assign all data - unsigned int dcount = 0; - typename TSkeleton::TMatrix::const_iterator mIt = this->m_Skeleton->BeginEdgesRows( ); - for( ; mIt != this->m_Skeleton->EndEdgesRows( ); ++mIt ) - { - // TODO: mIt->first; --> this is the row index. <-- - typename TSkeleton::TMatrixRow::const_iterator rIt = mIt->second.begin( ); - for( ; rIt != mIt->second.end( ); ++rIt ) - { - // TODO: rIt->first; --> this is the column index. - typename TSkeleton::TEdges::const_iterator eIt = rIt->second.begin( ); - for( ; eIt != rIt->second.end( ); ++eIt ) - { - _TPath* path = *eIt; - for( unsigned long i = 0; i < path->GetSize( ); ++i ) - { - auto pnt = path->GetPoint( i ); - if( dim == 1 ) - points->InsertNextPoint( pnt[ 0 ], 0, 0 ); - else if( dim == 2 ) - points->InsertNextPoint( pnt[ 0 ], pnt[ 1 ], 0 ); - else - points->InsertNextPoint( pnt[ 0 ], pnt[ 1 ], pnt[ 2 ] ); - darray->InsertNextTuple1( double( dcount ) ); - if( i > 0 ) - { - lines->InsertNextCell( 2 ); - lines->InsertCellPoint( points->GetNumberOfPoints( ) - 2 ); - lines->InsertCellPoint( points->GetNumberOfPoints( ) - 1 ); - - } // fi - - } // rof - dcount++; - - } // rof - - } // rof - - } // rof - return( 1 ); -} - -// ------------------------------------------------------------------------- -template< class _TSkeleton > -int fpa::VTK::Image::SkeletonToPolyDataFilter< _TSkeleton >:: -RequestInformation( - vtkInformation* information, - vtkInformationVector** input, - vtkInformationVector* output - ) -{ - return( 1 ); -} - -#endif // __fpa__VTK__Image__SkeletonToPolyDataFilterFilter__hxx__ -// eof - $RCSfile$ -- 2.45.1