From: Leonardo Florez-Valencia Date: Sun, 10 Apr 2016 03:52:52 +0000 (-0500) Subject: More macos issues... X-Git-Tag: v0.1~199 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=a45c494fd214d02909f227909db3d9e04986b130;p=cpPlugins.git More macos issues... --- diff --git a/CMakeLists.txt b/CMakeLists.txt index fc58dd7..7a6b789 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,9 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) INCLUDE(cmake/cpPlugins_Policies.cmake) -## ================ -## = Project name = -## ================ +## ================== +## == Project name == +## ================== PROJECT(cpPlugins) SET(prj_MAJ_VER "0") @@ -12,23 +12,23 @@ SET(prj_REL_VER "0") SET(prj_VER "${prj_MAJ_VER}.${prj_MIN_VER}.${prj_REL_VER}") SET(prj_sVER "${prj_MAJ_VER}") -## =========== -## = Options = -## =========== +## ============= +## == Options == +## ============= OPTION(BUILD_EXAMPLES "Build examples" OFF) -## ======================== -## = Packages and options = -## ======================== +## ========================== +## == Packages and options == +## ========================== INCLUDE(cmake/cpPlugins_Options.cmake) INCLUDE(cmake/cpPlugins_KitwareTools.cmake) INCLUDE(cmake/cpPlugins_Qt4Tools.cmake) -## ======================= -## = Include directories = -## ======================= +## ========================= +## == Include directories == +## ========================= INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR} @@ -47,9 +47,9 @@ INCLUDE_DIRECTORIES( ${PROJECT_BINARY_DIR}/lib/ItkVtkGlue ) -## =========================== -## = Subdirs containing code = -## =========================== +## ============================= +## == Subdirs containing code == +## ============================= SUBDIRS( cmake diff --git a/appli/bash/CMakeLists.txt b/appli/bash/CMakeLists.txt index 7d9154c..a498850 100644 --- a/appli/bash/CMakeLists.txt +++ b/appli/bash/CMakeLists.txt @@ -1,17 +1,36 @@ -SET( - bash_SOURCES - cpPlugins_HostCreator - cpPlugins_CreateInstances +## ============================ +## == Configure source files == +## ============================ + +FILE( + GLOB all_SOURCE_CXX_FILES RELATIVE + "${CMAKE_CURRENT_SOURCE_DIR}" + "${CMAKE_CURRENT_SOURCE_DIR}/*.cxx" ) -FOREACH(program ${bash_SOURCES}) - ADD_EXECUTABLE(${program} ${program}.cxx) +## ========================== +## == Compile source files == +## ========================== + +FOREACH(source ${all_SOURCE_CXX_FILES}) + GET_FILENAME_COMPONENT(name ${source} NAME_WE) + ADD_EXECUTABLE(${name} ${source}) INSTALL( - TARGETS ${program} + TARGETS ${name} RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib/static ) -ENDFOREACH(program) +ENDFOREACH(source) + +## ============================= +## == Create global variables == +## ============================= + +SET( + cpPluginsInstances_APP + ${PROJECT_BINARY_DIR}/cpPlugins_CreateInstances + CACHE INTERNAL "Target location" + ) ## eof - $RCSfile$ diff --git a/appli/bash/cpPlugins_CreateInstances.cxx b/appli/bash/cpPlugins_CreateInstances.cxx index 6dccd2b..a286d93 100644 --- a/appli/bash/cpPlugins_CreateInstances.cxx +++ b/appli/bash/cpPlugins_CreateInstances.cxx @@ -1,33 +1,19 @@ -#include -#include - -#include -#include +#include #include #include #include -#if defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) -# define cpPlugins_STRTOK( A, B, N ) strtok_s( A, B, N ) -#else // defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) -# define cpPlugins_STRTOK( A, B, N ) std::strtok( A, B ) -#endif // defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) - // ------------------------------------------------------------------------- typedef std::vector< std::string > TLines; typedef std::map< char, TLines > TParsedLines; typedef std::map< std::string, TLines > TVariables; // ------------------------------------------------------------------------- -bool cpPlugins_ISBLANK( const char& value ); -TLines Tokenize( const std::string& str, const std::string& delims ); -std::string Replace( - const std::string& str, const std::string& sub, const std::string& nsub - ); bool ReadFile( TParsedLines& lines, const std::string& fname ); -void ExpandGroups( TLines& res, const TLines& lines, const TVariables& vars ); -void ExpandVariables( TLines& res, const TLines& lines, const TVariables& vars ); -void ParseIncludes( TLines& res, const TLines& lines, const std::string& ext = "" ); +void ExpandGroups( TLines& res, const TLines& lines ); +void ExpandDefinitions( + TLines& res, const TLines& lines, const TVariables& vars + ); void PrintLines( const std::string& prefix, const std::string& suffix, const TLines& lines, std::ostream& out @@ -62,11 +48,12 @@ int main( int argc, char* argv[] ) } // fi - // Expand variable definitions + // Expand definitions TVariables vars; for( auto dIt = lines[ 'd' ].begin( ); dIt != lines[ 'd' ].end( ); ++dIt ) { - auto tokens = Tokenize( *dIt, "=;" ); + TLines tokens; + cpPlugins::TokenizeString( tokens, *dIt, "=;" ); auto tIt = tokens.begin( ); auto vName = *tIt; tIt++; @@ -74,27 +61,26 @@ int main( int argc, char* argv[] ) vars[ vName ].push_back( *tIt ); TLines res; - ExpandVariables( res, vars[ vName ], vars ); + ExpandDefinitions( res, vars[ vName ], vars ); vars[ vName ] = res; } // rof - // First include section - TLines first_includes, normal_includes, template_includes, template_sources; - ParseIncludes( first_includes, lines[ 'f' ] ); - ParseIncludes( normal_includes, lines[ 'i' ] ); - ParseIncludes( template_includes, lines[ 't' ] ); - ParseIncludes( template_sources, lines[ 't' ], "xx" ); - // Expand groups - TLines pre_classes; - ExpandGroups( pre_classes, lines[ 'c' ], vars ); - - // Expand variables - TLines real_classes; - ExpandVariables( real_classes, pre_classes, vars ); - - // Prepare header file + TLines f_includes_groups, includes_groups, templates_groups, classes_groups; + ExpandGroups( f_includes_groups, lines[ 'f' ] ); + ExpandGroups( includes_groups, lines[ 'i' ] ); + ExpandGroups( templates_groups, lines[ 't' ] ); + ExpandGroups( classes_groups, lines[ 'c' ] ); + + // Expand definitions + TLines f_includes_list, includes_list, templates_list, classes_list; + ExpandDefinitions( f_includes_list, f_includes_groups, vars ); + ExpandDefinitions( includes_list, includes_groups, vars ); + ExpandDefinitions( templates_list, templates_groups, vars ); + ExpandDefinitions( classes_list, classes_groups, vars ); + + // Write header file std::ofstream header_file( header_file_fname.c_str( ) ); if( !header_file ) { @@ -113,7 +99,7 @@ int main( int argc, char* argv[] ) << "#include <" << library_name << "_Export.h>" << std::endl << std::endl; PrintLines( "", "", lines[ 'b' ], header_file ); header_file << std::endl; - PrintLines( "", "", first_includes, header_file ); + PrintLines( "#include <", ">", f_includes_list, header_file ); header_file << "#ifdef " << library_name << "_EXPORTS" << std::endl << "# define " << library_name << "_PREFIX template class " @@ -122,16 +108,16 @@ int main( int argc, char* argv[] ) << "# define " << library_name << "_PREFIX extern template class" << std::endl << "#endif // " - << library_name << "_EXPORTS" << std::endl; - PrintLines( "", "", normal_includes, header_file ); - PrintLines( "", "", template_includes, header_file ); + << library_name << "_EXPORTS" << std::endl << std::endl; + PrintLines( "#include <", ">", includes_list, header_file ); + PrintLines( "#include <", ">", templates_list, header_file ); header_file << std::endl << "#ifdef " << library_name << "_EXPORTS" << std::endl; - PrintLines( "", "", template_sources, header_file ); - header_file << "#endif // " << library_name << "_EXPORTS" << std::endl; - header_file << std::endl; + PrintLines( "#include <", "xx>", templates_list, header_file ); + header_file + << "#endif // " << library_name << "_EXPORTS" << std::endl << std::endl; PrintLines( - library_name + std::string( "_PREFIX " ), ";", real_classes, header_file + library_name + std::string( "_PREFIX " ), ";", classes_list, header_file ); header_file << std::endl << "#endif // __" << library_name << "__H__" << std::endl; @@ -149,134 +135,87 @@ int main( int argc, char* argv[] ) source_file << "#include \"" << header_file_fname << "\"" << std::endl; source_file.close( ); - return( 0 ); -} -// ------------------------------------------------------------------------- -bool cpPlugins_ISBLANK( const char& value ) -{ - return( value == ' ' || value == '\t' || value == '\n' || value == '\r' ); -} - -// ------------------------------------------------------------------------- -TLines Tokenize( const std::string& str, const std::string& delims ) -{ - TLines tokens; - if( str.size( ) > 0 ) - { - auto ssize = str.size( ); - char* buffer = new char[ ssize + 1 ]; - for( unsigned long i = 0; i < ssize; ++i ) - buffer[ i ] = str[ i ]; - buffer[ ssize ] = '\0'; - char* next; - char* it = cpPlugins_STRTOK( buffer, delims.c_str( ), &next ); - while( it != NULL ) - { - tokens.push_back( std::string( it ) ); - it = cpPlugins_STRTOK( NULL, delims.c_str( ), &next ); - - } // elihw - delete [] buffer; - - } // fi - return( tokens ); -} - -// ------------------------------------------------------------------------- -std::string Replace( - const std::string& str, const std::string& sub, const std::string& nsub - ) -{ - std::string res = str; - size_t index; - while( ( index = res.find( sub ) ) != std::string::npos ) - res.replace( index, sub.size( ), nsub ); - return( res ); + return( 0 ); } // ------------------------------------------------------------------------- bool ReadFile( TParsedLines& lines, const std::string& fname ) { - // Load file into a string stream - std::ifstream file_stream( fname.c_str( ) ); - if( !file_stream ) - return( false ); std::string buffer; - 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 input_stream( buffer ); - - // Read line by line - std::string line; - while( std::getline( input_stream, line ) ) + if( cpPlugins::ReadFileIntoString( buffer, fname ) ) { - auto cmd_pos = line.end( ); - auto arg_pos = line.end( ); - auto lIt = line.begin( ); - while( lIt != line.end( ) ) + std::istringstream input_stream( buffer ); + + // Read line by line + std::string line; + while( std::getline( input_stream, line ) ) { - if( !cpPlugins_ISBLANK( *lIt ) ) + auto cmd_pos = line.end( ); + auto arg_pos = line.end( ); + auto lIt = line.begin( ); + while( lIt != line.end( ) ) { - if( cmd_pos == line.end( ) ) + if( !cpPlugins::IsBlank( *lIt ) ) { - cmd_pos = lIt; - ++lIt; + if( cmd_pos == line.end( ) ) + { + cmd_pos = lIt; + ++lIt; + } + else if( arg_pos == line.end( ) ) + { + arg_pos = lIt; + lIt = line.end( ); + + } // fi } - else if( arg_pos == line.end( ) ) - { - arg_pos = lIt; - lIt = line.end( ); + else + ++lIt; + + } // elihw + char cmd = *cmd_pos; + std::string arg; + arg.resize( line.end( ) - arg_pos ); + std::copy( arg_pos, line.end( ), arg.begin( ) ); + lines[ cmd ].push_back( arg ); - } // fi - } - else - ++lIt; - } // elihw - char cmd = *cmd_pos; - std::string arg; - arg.resize( line.end( ) - arg_pos ); - std::copy( arg_pos, line.end( ), arg.begin( ) ); - lines[ cmd ].push_back( arg ); - - } // elihw - return( true ); + return( true ); + } + else + return( false ); } // ------------------------------------------------------------------------- -void ExpandGroups( TLines& res, const TLines& lines, const TVariables& vars ) +void ExpandGroups( TLines& res, const TLines& lines ) { for( auto lIt = lines.begin( ); lIt != lines.end( ); ++lIt ) { auto b_pos = lIt->find( "@{" ); if( b_pos != std::string::npos ) { - auto e_pos = lIt->find( "}" ); - auto expansion = lIt->substr( b_pos + 2, e_pos - b_pos - 2 ); - auto tokens = Tokenize( expansion, ";" ); - for( auto tIt = tokens.begin( ); tIt != tokens.end( ); ++tIt ) + unsigned int braces_count = 1; + auto e_pos = b_pos; + e_pos += 2; + while( braces_count != 0 && e_pos < lIt->size( ) ) { - auto vIt = vars.find( *tIt ); - if( vIt != vars.end( ) ) - { - auto wIt = vIt->second.begin( ); - std::string values = *wIt; - for( wIt++; wIt != vIt->second.end( ); ++wIt ) - values += ";" + *wIt; - *tIt = Replace( *lIt, vIt->first, values ); - } - else - *tIt = lIt->substr( 0, b_pos ) + *tIt + lIt->substr( e_pos + 1 ); + auto v = ( *lIt )[ e_pos ]; + braces_count += ( v == '{' )? 1: ( ( v == '}' )? -1: 0 ); + e_pos++; + + } // elihw + if( braces_count == 0 ) + { + auto replace = lIt->substr( b_pos, e_pos - b_pos ); + auto expansion = replace.substr( 2, replace.size( ) - 3 ); + TLines tokens; + cpPlugins::TokenizeString( tokens, expansion, ";" ); + for( auto tIt = tokens.begin( ); tIt != tokens.end( ); ++tIt ) + *tIt = cpPlugins::ReplaceString( *lIt, replace, *tIt ); + ExpandGroups( res, tokens ); - } // rof - ExpandGroups( res, tokens, vars ); + } // fi } else res.push_back( *lIt ); @@ -285,14 +224,19 @@ void ExpandGroups( TLines& res, const TLines& lines, const TVariables& vars ) } // ------------------------------------------------------------------------- -void ExpandVariables( TLines& res, const TLines& lines, const TVariables& vars ) +void ExpandDefinitions( + TLines& res, const TLines& lines, const TVariables& vars + ) { + std::string seps = " ,;:{}[]()\"$&<>*."; + for( auto lIt = lines.begin( ); lIt != lines.end( ); ++lIt ) { auto b_pos = lIt->find( "#" ); if( b_pos != std::string::npos ) { - auto tokens = Tokenize( lIt->substr( b_pos ), " ,;:{}[]()\"$&<>*" ); + TLines tokens; + cpPlugins::TokenizeString( tokens, lIt->substr( b_pos ), seps ); std::string cmd = tokens[ 0 ]; auto vIt = vars.find( cmd ); if( vIt != vars.end( ) ) @@ -300,29 +244,26 @@ void ExpandVariables( TLines& res, const TLines& lines, const TVariables& vars ) if( vIt->second.size( ) > 0 ) { TLines new_res; - for( auto wIt = vIt->second.begin( ); wIt != vIt->second.end( ); ++wIt ) - new_res.push_back( Replace( *lIt, cmd, *wIt ) ); - ExpandVariables( res, new_res, vars ); + for( + auto wIt = vIt->second.begin( ); wIt != vIt->second.end( ); ++wIt + ) + new_res.push_back( cpPlugins::ReplaceString( *lIt, cmd, *wIt ) ); + ExpandDefinitions( res, new_res, vars ); } // fi } // fi } else - res.push_back( *lIt ); + res.push_back( + cpPlugins::ReplaceString( + cpPlugins::ReplaceString( *lIt, "{", "" ), "}", "" + ) + ); } // rof } -// ------------------------------------------------------------------------- -void ParseIncludes( TLines& res, const TLines& lines, const std::string& ext ) -{ - for( auto lIt = lines.begin( ); lIt != lines.end( ); ++lIt ) - res.push_back( - std::string( "#include <" ) + *lIt + ext + std::string( ">" ) - ); -} - // ------------------------------------------------------------------------- void PrintLines( const std::string& prefix, const std::string& suffix, diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 7db97e9..bd309ba 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -1,3 +1,13 @@ +## ============================ +## == Configure source files == +## ============================ + +FILE(GLOB all_CMAKE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.cmake" ) + +## ===================== +## == Configure files == +## ===================== + CONFIGURE_FILE( cpPluginsConfig.cmake.in ${PROJECT_BINARY_DIR}/cpPluginsConfig.cmake @@ -5,13 +15,10 @@ CONFIGURE_FILE( ) ## ======================== -## -- Installation rules -- +## == Installation rules == ## ======================== -INSTALL( - FILES - ${PROJECT_BINARY_DIR}/cpPluginsConfig.cmake - DESTINATION share/cmake - ) +INSTALL(FILES ${PROJECT_BINARY_DIR}/cpPluginsConfig.cmake DESTINATION share/cmake) +INSTALL(FILES ${all_CMAKE_FILES} DESTINATION share/cmake) ## eof - $RCSfile$ diff --git a/cmake/cpPluginsConfig.cmake.in b/cmake/cpPluginsConfig.cmake.in index b612b9d..a07c54c 100644 --- a/cmake/cpPluginsConfig.cmake.in +++ b/cmake/cpPluginsConfig.cmake.in @@ -1,11 +1,11 @@ # =================================== -# -- Some configurations variables -- +# == Some configurations variables == # =================================== SET(USE_QT4 "@QT4_FOUND@") # ======================= -# -- Find dependencies -- +# == Find dependencies == # ======================= # Find ITK and VTK @@ -17,7 +17,7 @@ SET(VTK_DIR @VTK_DIR@) FIND_PACKAGE(VTK REQUIRED) INCLUDE(${VTK_USE_FILE}) -# Do not use itk-vtk glue --> problems ahead!!! +# Do not use itk-vtk glue ==> problems ahead!!! IF(ITKVtkGlue_LOADED) MESSAGE(FATAL_ERROR "ITKVtkGlue module is available. Please re-compile your ITK without it. It could lead to nasty compilation problems... Just waiting for Kitware to solve it.") ENDIF(ITKVtkGlue_LOADED) @@ -45,7 +45,7 @@ ENDIF(USE_QT4 EQUAL "1") # ========================= -# -- Include directories -- +# == Include directories == # ========================= INCLUDE_DIRECTORIES( @@ -69,7 +69,7 @@ INCLUDE_DIRECTORIES( ) # ========================= -# -- Library directories -- +# == Library directories == # ========================= IF(MSVC) @@ -87,17 +87,16 @@ ELSE(MSVC) ENDIF(MSVC) # =================== -# -- Library names -- +# == Library names == # =================== SET(cpExtensions_LIBRARY cpExtensions) SET(cpPlugins_tinyxml2_LIBRARY cpPlugins_tinyxml2) -SET(cpPlugins_ALL_INSTANCES_LIBRARIES "@cpPlugins_ALL_INSTANCES@") -SET(cpPlugins_LIBRARY cpPlugins) SET(cpPipelineEditor_LIBRARY cpPipelineEditor) +SET(cpPlugins_LIBRARIES "@cpPlugins_LIBRARIES@;cpPlugins") # ====================== -# -- Executable names -- +# == Executable names == # ====================== SET( exec_PROGRAMS diff --git a/lib/cpPlugins/CMakeLists.txt b/lib/cpPlugins/CMakeLists.txt index 971707f..abf5082 100644 --- a/lib/cpPlugins/CMakeLists.txt +++ b/lib/cpPlugins/CMakeLists.txt @@ -83,7 +83,7 @@ SET( SET( target_LIBRARIES - ${cpPlugins_ALL_INSTANCES} + ${cpPlugins_LIBRARIES} cpPlugins_tinyxml2 ) IF(NOT WIN32) diff --git a/lib/cpPlugins_Config.h b/lib/cpPlugins_Config.h index 84314e8..7a228b1 100644 --- a/lib/cpPlugins_Config.h +++ b/lib/cpPlugins_Config.h @@ -1,18 +1,169 @@ #ifndef __CPPLUGINS_CONFIG__H__ #define __CPPLUGINS_CONFIG__H__ +/* + * ========================================================================= + * ITK related macros + * ========================================================================= + */ #include - #define ITK_MANUAL_INSTANTIATION - #ifndef ITK_DELETE_FUNCTION # define ITK_DELETE_FUNCTION #endif // ITK_DELETE_FUNCTION - #ifndef ITK_OVERRIDE # define ITK_OVERRIDE #endif // ITK_OVERRIDE +/* + * ========================================================================= + * Identify OS + * ========================================================================= + */ +#if defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) +# define cpPlugins_SYS_WINDOWS +# define cpPlugins_LIB_PREFIX "" +# define cpPlugins_LIB_EXT "dll" +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif +# define NOMINMAX +# include +# include +#elif defined( linux ) || defined( __linux ) +# define cpPlugins_SYS_LINUX +# define cpPlugins_LIB_PREFIX "lib" +# define cpPlugins_LIB_EXT "so" +#elif defined( __APPLE__ ) || defined( MACOSX ) || defined( macintosh ) || defined( Macintosh ) +# define cpPlugins_SYS_MACOS +# define cpPlugins_LIB_PREFIX "lib" +# define cpPlugins_LIB_EXT "dylib" +#elif defined( __FreeBSD__ ) || defined( __FreeBSD_kernel__ ) +# define cpPlugins_SYS_FREEBSD +# define cpPlugins_LIB_PREFIX "lib" +# define cpPlugins_LIB_EXT "so" +#else +# error "This operating system is not supported by cpPlugins" +#endif + +/* + * ========================================================================= + * Some helper functions + * ========================================================================= + */ + +#include +#include +#include +#include + +#ifdef cpPlugins_SYS_WINDOWS +# define cpPlugins_STRTOK( A, B, N ) strtok_s( A, B, N ) +#else // cpPlugins_SYS_WINDOWS +# define cpPlugins_STRTOK( A, B, N ) std::strtok( A, B ) +#endif // cpPlugins_SYS_WINDOWS + +namespace cpPlugins +{ + struct IsSeparator + { + // --------------------------------------------------------------------- + inline bool operator()( char c ) const + { +#ifdef cpPlugins_SYS_WINDOWS + return( c == '\\' || c == '/' ); +#else // cpPlugins_SYS_WINDOWS + return( c == '/' ); +#endif // cpPlugins_SYS_WINDOWS + } + }; + + // ----------------------------------------------------------------------- + inline bool IsBlank( const char& value ) + { + return( value == ' ' || value == '\t' || value == '\n' || value == '\r' ); + } + + // ----------------------------------------------------------------------- + template< class _TTokens > + inline void TokenizeString( + _TTokens& tokens, const std::string& str, const std::string& delims + ) + { + tokens.clear( ); + if( str.size( ) > 0 ) + { + auto ssize = str.size( ); + char* buffer = new char[ ssize + 1 ]; + for( unsigned long i = 0; i < ssize; ++i ) + buffer[ i ] = str[ i ]; + buffer[ ssize ] = '\0'; + char* next; + char* it = cpPlugins_STRTOK( buffer, delims.c_str( ), &next ); + while( it != NULL ) + { + tokens.push_back( std::string( it ) ); + it = cpPlugins_STRTOK( NULL, delims.c_str( ), &next ); + + } // elihw + delete [] buffer; + + } // fi + } + + // ----------------------------------------------------------------------- + inline std::string ReplaceString( + const std::string& str, const std::string& sub, const std::string& nsub + ) + { + std::string res = str; + size_t index; + while( ( index = res.find( sub ) ) != std::string::npos ) + res.replace( index, sub.size( ), nsub ); + return( res ); + } + + // ----------------------------------------------------------------------- + inline bool ReadFileIntoString( std::string& buffer, const std::string& fname ) + { + buffer = ""; + std::ifstream file_stream( fname.c_str( ) ); + if( !file_stream ) + return( false ); + 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( ); + return( true ); + } + + // ----------------------------------------------------------------------- + inline std::string CanonicalPath( const std::string& path ) + { + std::string ret = ""; +#ifdef cpPlugins_SYS_WINDOWS + TCHAR buffer[ 4096 ] = TEXT( "" ); + TCHAR** lppPart = { NULL }; + GetFullPathName( path.c_str( ), 4096, buffer, lppPart ); + ret = std::string( buffer ); +#else // cpPlugins_SYS_WINDOWS + char* canonical_path = realpath( path.c_str( ), NULL ); + if( canonical_path != NULL ) + { + ret = canonical_path; + free( canonical_path ); + + } // fi +#endif // cpPlugins_SYS_WINDOWS + return( ret ); + } + +} // ecapseman + #endif // __CPPLUGINS_CONFIG__H__ // eof - $RCSfile$ diff --git a/lib/cpPlugins_Instances/Base.i b/lib/cpPlugins_Instances/Base.i deleted file mode 100644 index bbd88c4..0000000 --- a/lib/cpPlugins_Instances/Base.i +++ /dev/null @@ -1,38 +0,0 @@ -f cpPlugins_Config.h - -t itkArray.h -t itkArray2D.h -t itkBoundingBox.h -t itkCovariantVector.h -t itkDiffusionTensor3D.h -t itkFixedArray.h -t itkMatrix.h -t itkPoint.h -t itkRGBPixel.h -t itkRGBAPixel.h -t itkSimpleDataObjectDecorator.h -t itkSymmetricEigenAnalysis.h -t itkSymmetricSecondRankTensor.h -t itkVariableLengthVector.h -t itkVector.h -t itkVectorContainer.h - -d #dims=1;2;3 -d #int=char;short;int;long -d #float=float;double -d #scalar=#int;unsigned #int;#float -d #color_pixels=itk::RGBPixel< #scalar >;itk::RGBAPixel< #scalar > -d #lin_alg_vectors=itk::CovariantVector;itk::Point;itk::Vector - -c @{itk::Array;itk::Array2D;itk::VariableLengthVector}< #scalar > -c itk::FixedArray< #scalar, #dims > -c itk::FixedArray< #scalar, @{4;6} > -c #color_pixels -c #lin_alg_vectors< #float, #dims > -c itk::Matrix< #float, #dims, #dims > -c itk::SymmetricEigenAnalysis< itk::Matrix< #float, #dims, #dims >, itk::FixedArray< #float, #dims >, itk::Matrix< #float, #dims, #dims > > -c itk::SymmetricSecondRankTensor< #float, #dims > -c itk::DiffusionTensor3D< #float > -c itk::VectorContainer< unsigned long, itk::Point< #float, #dims > > -c itk::BoundingBox< unsigned long, #dims, #float, itk::VectorContainer< unsigned long, itk::Point< #float, #dims > > > -c itk::SimpleDataObjectDecorator< #lin_alg_vectors< #float, #dims > > diff --git a/lib/cpPlugins_Instances/BaseObjects.i b/lib/cpPlugins_Instances/BaseObjects.i new file mode 100644 index 0000000..fb7b4d4 --- /dev/null +++ b/lib/cpPlugins_Instances/BaseObjects.i @@ -0,0 +1,27 @@ +d #itk_objs=FixedArray;CovariantVector;Point;Vector;Matrix;SymmetricSecondRankTensor;DiffusionTensor3D +d #ints=char;short;int;long +d #uints=unsigned #ints +d #floats=float;double +d #dims=1;2;3;4 +d #pixels=#ints;#uints;#floats + +t itk#itk_objs.h +t itkArray.h +t itkArray2D.h +t itkSymmetricEigenAnalysis.h +t itkSimpleDataObjectDecorator.h +t itkVariableLengthVector.h +t itkVectorContainer.h + +c itk::Array< #pixels > +c itk::@{Array2D;VariableLengthVector}< #floats > +c itk::FixedArray< #pixels, #dims > +c itk::FixedArray< #floats, @{6;10} > +c itk::@{CovariantVector;Point;Vector;SymmetricSecondRankTensor}< #floats, #dims > +c itk::DiffusionTensor3D< #floats > +c itk::Matrix< #floats, #dims, #dims > +c itk::SimpleDataObjectDecorator< itk::@{CovariantVector;Point;Vector}< #floats, #dims > > +c itk::SimpleDataObjectDecorator< itk::Matrix< #floats, #dims, #dims > > +c itk::VectorContainer< unsigned long, itk::Point< #floats, #dims > > + +* eof - $RCSfile$ diff --git a/lib/cpPlugins_Instances/BaseObjects_extra.cxx b/lib/cpPlugins_Instances/BaseObjects_extra.cxx new file mode 100644 index 0000000..aeaaaad --- /dev/null +++ b/lib/cpPlugins_Instances/BaseObjects_extra.cxx @@ -0,0 +1,71 @@ +#include +#include + +/* + #include + #include + #include + #include + #include + + #include + #include + #include + #include + #include +*/ + +// ------------------------------------------------------------------------- +/* TODO + #define cpPlugins_Instances_BaseObjects_extra_SimpleArray( V, D ) \ + template cpPlugins_Instances_BaseObjects_EXPORT \ + std::ostream& itk::operator<< < D >( \ + std::ostream& a, V< D > const& b \ + ) + + cpPlugins_Instances_BaseObjects_extra_SimpleArray( itk::ImageRegion, 1 ); + cpPlugins_Instances_BaseObjects_extra_SimpleArray( itk::ImageRegion, 2 ); + cpPlugins_Instances_BaseObjects_extra_SimpleArray( itk::ImageRegion, 3 ); + cpPlugins_Instances_BaseObjects_extra_SimpleArray( itk::ImageRegion, 4 ); +*/ + +// ------------------------------------------------------------------------- +#define cpPlugins_Instances_BaseObjects_extra_Array( V, T, D ) \ + template cpPlugins_Instances_BaseObjects_EXPORT \ + std::ostream& itk::operator<< < T, D >( \ + std::ostream& a, V< T, D > const& b \ + ) + +#define cpPlugins_Instances_BaseObjects_extra_Array_AllScalars( V, D ) \ + cpPlugins_Instances_BaseObjects_extra_Array( V, float, D ); \ + cpPlugins_Instances_BaseObjects_extra_Array( V, double, D ) + +#define cpPlugins_Instances_BaseObjects_extra_Array_AllScalars_AllDims( V ) \ + cpPlugins_Instances_BaseObjects_extra_Array_AllScalars( V, 1 ); \ + cpPlugins_Instances_BaseObjects_extra_Array_AllScalars( V, 2 ); \ + cpPlugins_Instances_BaseObjects_extra_Array_AllScalars( V, 3 ); \ + cpPlugins_Instances_BaseObjects_extra_Array_AllScalars( V, 4 ) + +cpPlugins_Instances_BaseObjects_extra_Array_AllScalars_AllDims( itk::FixedArray ); +cpPlugins_Instances_BaseObjects_extra_Array_AllScalars_AllDims( itk::Point ); +cpPlugins_Instances_BaseObjects_extra_Array_AllScalars_AllDims( itk::Vector ); + +// ------------------------------------------------------------------------- +/* TODO + #define cpPlugins_Instances_BaseObjects_extra_VariableLengthVector_SetSize( T, P, Q ) \ + template cpPlugins_Instances_BaseObjects_EXPORT void itk::VariableLengthVector< T >:: \ + SetSize \ + < itk::VariableLengthVector< T >::P, itk::VariableLengthVector< T >::Q > \ + ( \ + unsigned int, \ + itk::VariableLengthVector< T >::P, \ + itk::VariableLengthVector< T >::Q \ + ) + + cpPlugins_Instances_BaseObjects_extra_VariableLengthVector_SetSize( float, AlwaysReallocate, KeepOldValues ); + cpPlugins_Instances_BaseObjects_extra_VariableLengthVector_SetSize( float, ShrinkToFit, KeepOldValues ); + cpPlugins_Instances_BaseObjects_extra_VariableLengthVector_SetSize( double, AlwaysReallocate, KeepOldValues ); + cpPlugins_Instances_BaseObjects_extra_VariableLengthVector_SetSize( double, ShrinkToFit, KeepOldValues ); +*/ + +// eof - $RCSfile$ diff --git a/lib/cpPlugins_Instances/Base_extra.cxx b/lib/cpPlugins_Instances/Base_extra.cxx deleted file mode 100644 index b3b33f5..0000000 --- a/lib/cpPlugins_Instances/Base_extra.cxx +++ /dev/null @@ -1,65 +0,0 @@ -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -// ------------------------------------------------------------------------- -#define cpPlugins_Base_extra_SimpleArray( V, D ) \ - template cpPlugins_Base_EXPORT \ - std::ostream& itk::operator<< < D >( \ - std::ostream& a, V< D > const& b \ - ) - -cpPlugins_Base_extra_SimpleArray( itk::ImageRegion, 1 ); -cpPlugins_Base_extra_SimpleArray( itk::ImageRegion, 2 ); -cpPlugins_Base_extra_SimpleArray( itk::ImageRegion, 3 ); -cpPlugins_Base_extra_SimpleArray( itk::ImageRegion, 4 ); - -// ------------------------------------------------------------------------- -#define cpPlugins_Base_extra_Array( V, T, D ) \ - template cpPlugins_Base_EXPORT \ - std::ostream& itk::operator<< < T, D >( \ - std::ostream& a, V< T, D > const& b \ - ) - -#define cpPlugins_Base_extra_Array_AllScalars( V, D ) \ - cpPlugins_Base_extra_Array( V, float, D ); \ - cpPlugins_Base_extra_Array( V, double, D ) - -#define cpPlugins_Base_extra_Array_AllScalars_AllDims( V ) \ - cpPlugins_Base_extra_Array_AllScalars( V, 1 ); \ - cpPlugins_Base_extra_Array_AllScalars( V, 2 ); \ - cpPlugins_Base_extra_Array_AllScalars( V, 3 ); \ - cpPlugins_Base_extra_Array_AllScalars( V, 4 ) - -cpPlugins_Base_extra_Array_AllScalars_AllDims( itk::FixedArray ); -cpPlugins_Base_extra_Array_AllScalars_AllDims( itk::Point ); -cpPlugins_Base_extra_Array_AllScalars_AllDims( itk::Vector ); - -// ------------------------------------------------------------------------- -#define cpPlugins_Base_extra_VariableLengthVector_SetSize( T, P, Q ) \ - template cpPlugins_Base_EXPORT void itk::VariableLengthVector< T >:: \ - SetSize \ - < itk::VariableLengthVector< T >::P, itk::VariableLengthVector< T >::Q > \ - ( \ - unsigned int, \ - itk::VariableLengthVector< T >::P, \ - itk::VariableLengthVector< T >::Q \ - ) - -cpPlugins_Base_extra_VariableLengthVector_SetSize( float, AlwaysReallocate, KeepOldValues ); -cpPlugins_Base_extra_VariableLengthVector_SetSize( float, ShrinkToFit, KeepOldValues ); -cpPlugins_Base_extra_VariableLengthVector_SetSize( double, AlwaysReallocate, KeepOldValues ); -cpPlugins_Base_extra_VariableLengthVector_SetSize( double, ShrinkToFit, KeepOldValues ); - -// eof - $RCSfile$ diff --git a/lib/cpPlugins_Instances/CMakeLists.txt b/lib/cpPlugins_Instances/CMakeLists.txt index 175ee40..8042a98 100644 --- a/lib/cpPlugins_Instances/CMakeLists.txt +++ b/lib/cpPlugins_Instances/CMakeLists.txt @@ -1,74 +1,72 @@ +## ============================ +## == Configure source files == +## ============================ + FILE( - GLOB libs_DEFS RELATIVE + GLOB all_INSTANCES_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*.i" ) -SET(aux_ALL_INSTANCES) -FOREACH(i ${libs_DEFS}) - GET_FILENAME_COMPONENT(l_DEF ${i} NAME_WE) - SET(i_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${l_DEF}.i") - SET(h_FILE "${CMAKE_CURRENT_BINARY_DIR}/${l_DEF}.h") - SET(s_FILE "${CMAKE_CURRENT_BINARY_DIR}/${l_DEF}.cxx") - SET(o_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${l_DEF}_extra.cxx") - SET(l_NAME "cpPlugins_${l_DEF}") - SET(aux_ALL_INSTANCES ${aux_ALL_INSTANCES} ${l_NAME}) +## ================================= +## == Compile instances libraries == +## ================================= +SET(all_INSTANCES_LIBS "") +FOREACH(libID ${all_INSTANCES_FILES}) + GET_FILENAME_COMPONENT(name ${libID} NAME_WE) + SET(instances "${CMAKE_CURRENT_SOURCE_DIR}/${name}.i") + SET(header "${CMAKE_CURRENT_BINARY_DIR}/${name}.h") + SET(source "${CMAKE_CURRENT_BINARY_DIR}/${name}.cxx") + SET(extra "${CMAKE_CURRENT_SOURCE_DIR}/${name}_extra.cxx") + SET(libname cpPlugins_Instances_${name}) ADD_CUSTOM_COMMAND( - OUTPUT ${h_FILE} ${s_FILE} - DEPENDS cpPlugins_CreateInstances ${i_FILE} - COMMAND cpPlugins_CreateInstances ${i_FILE} ${l_NAME} ${h_FILE} ${s_FILE} + OUTPUT ${header} ${source} + DEPENDS "${cpPluginsInstances_APP}" ${instances} + COMMAND "${cpPluginsInstances_APP}" ${instances} ${libname} ${header} ${source} ) - IF(EXISTS ${o_FILE}) - ADD_LIBRARY(${l_NAME} SHARED ${s_FILE} ${o_FILE}) - ELSE(EXISTS ${o_FILE}) - ADD_LIBRARY(${l_NAME} SHARED ${s_FILE}) - ENDIF(EXISTS ${o_FILE}) + IF(EXISTS ${extra}) + ADD_LIBRARY(${libname} SHARED ${source} ${extra}) + ELSE(EXISTS ${extra}) + ADD_LIBRARY(${libname} SHARED ${source}) + ENDIF(EXISTS ${extra}) SET_TARGET_PROPERTIES( - ${l_NAME} PROPERTIES + ${libname} PROPERTIES VERSION "${prj_VER}" SOVERSION "${prj_sVER}" ) GENERATE_EXPORT_HEADER( - ${l_NAME} - BASE_NAME ${l_NAME} - EXPORT_MACRO_NAME ${l_NAME}_EXPORT - EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/${l_NAME}_Export.h - STATIC_DEFINE ${l_NAME}_BUILT_AS_STATIC + ${libname} + BASE_NAME ${libname} + EXPORT_MACRO_NAME ${libname}_EXPORT + EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/${libname}_Export.h + STATIC_DEFINE ${libname}_BUILT_AS_STATIC ) -ENDFOREACH(i) + SET(all_INSTANCES_LIBS "${all_INSTANCES_LIBS};${libname}") +ENDFOREACH(libID) +SET(cpPlugins_LIBRARIES ${all_INSTANCES_LIBS} CACHE INTERNAL "All libraries" FORCE) -SET( - cpPlugins_ALL_INSTANCES - ${aux_ALL_INSTANCES} - CACHE STRING "All instances libraries." - ) +## ============= +## == Linking == +## ============= -## Target links -TARGET_LINK_LIBRARIES(cpPlugins_Base ${ITK_LIBRARIES}) -TARGET_LINK_LIBRARIES(cpPlugins_Transforms ${ITK_LIBRARIES} cpPlugins_Base) -TARGET_LINK_LIBRARIES(cpPlugins_Mesh cpPlugins_Base) -TARGET_LINK_LIBRARIES(cpPlugins_Image cpPlugins_Base) -TARGET_LINK_LIBRARIES(cpPlugins_Paths cpPlugins_Base cpPlugins_Image ${VTK_LIBRARIES}) -TARGET_LINK_LIBRARIES(cpPlugins_ImageIterators ${ITK_LIBRARIES} cpPlugins_Image) -TARGET_LINK_LIBRARIES(cpPlugins_ImageFiltersBase cpPlugins_Image) -TARGET_LINK_LIBRARIES(cpPlugins_InPlaceImageFiltersBase cpPlugins_ImageFiltersBase) -TARGET_LINK_LIBRARIES(cpPlugins_ImageITK2VTK cpPlugins_ImageFiltersBase ${VTK_LIBRARIES}) -TARGET_LINK_LIBRARIES(cpPlugins_ThresholdFilters cpPlugins_InPlaceImageFiltersBase cpPlugins_ImageIterators) -TARGET_LINK_LIBRARIES(cpPlugins_DistanceMapFilters cpPlugins_ThresholdFilters cpPlugins_ImageIterators) -TARGET_LINK_LIBRARIES(cpPlugins_ResamplingFilters cpPlugins_ImageFiltersBase cpPlugins_ImageIterators cpPlugins_Transforms) -TARGET_LINK_LIBRARIES(cpPlugins_GaussianImageFilters cpPlugins_ImageFiltersBase cpPlugins_ImageIterators) -TARGET_LINK_LIBRARIES(cpPlugins_ImageIO cpPlugins_ImageFiltersBase cpPlugins_ImageIterators) -TARGET_LINK_LIBRARIES(cpPlugins_ImageMeshFilters cpPlugins_ImageFiltersBase cpPlugins_ImageIterators cpPlugins_Mesh) -# INSTALL( -# TARGETS ${l_NAME} -# RUNTIME DESTINATION bin -# LIBRARY DESTINATION lib -# ARCHIVE DESTINATION lib/static -# ) -# INSTALL( -# FILES -# ${lib_HEADERS} -# DESTINATION include/${lib_DIR} -# ) +TARGET_LINK_LIBRARIES(cpPlugins_Instances_BaseObjects ${ITK_LIBRARIES}) +TARGET_LINK_LIBRARIES(cpPlugins_Instances_Decorators ${ITK_LIBRARIES}) +TARGET_LINK_LIBRARIES(cpPlugins_Instances_ColorPixels cpPlugins_Instances_BaseObjects) +TARGET_LINK_LIBRARIES(cpPlugins_Instances_ScalarImages cpPlugins_Instances_BaseObjects) +TARGET_LINK_LIBRARIES(cpPlugins_Instances_ColorImages cpPlugins_Instances_ColorPixels cpPlugins_Instances_ScalarImages) +TARGET_LINK_LIBRARIES(cpPlugins_Instances_VectorImages cpPlugins_Instances_ColorPixels cpPlugins_Instances_ScalarImages) +TARGET_LINK_LIBRARIES(cpPlugins_Instances_ScalarImagesBaseFilters cpPlugins_Instances_ScalarImages) +TARGET_LINK_LIBRARIES(cpPlugins_Instances_ImagesIO cpPlugins_Instances_ScalarImages cpPlugins_Instances_ColorImages cpPlugins_Instances_VectorImages cpPlugins_Instances_Decorators) +TARGET_LINK_LIBRARIES(cpPlugins_Instances_ImageITK2VTK cpPlugins_Instances_ScalarImages cpPlugins_Instances_ColorImages cpPlugins_Instances_VectorImages ${VTK_LIBRARIES}) +TARGET_LINK_LIBRARIES(cpPlugins_Instances_Paths cpPlugins_Instances_ScalarImages ${VTK_LIBRARIES}) +TARGET_LINK_LIBRARIES(cpPlugins_Instances_Mesh cpPlugins_Instances_BaseObjects) +TARGET_LINK_LIBRARIES(cpPlugins_Instances_Transforms cpPlugins_Instances_BaseObjects) +TARGET_LINK_LIBRARIES(cpPlugins_Instances_ScalarVectorImagesBaseFilters cpPlugins_Instances_ScalarImages cpPlugins_Instances_VectorImages) +TARGET_LINK_LIBRARIES(cpPlugins_Instances_GaussianImageFilters cpPlugins_Instances_ScalarImagesBaseFilters cpPlugins_Instances_ScalarVectorImagesBaseFilters) +TARGET_LINK_LIBRARIES(cpPlugins_Instances_ThresholdFilters cpPlugins_Instances_ScalarImagesBaseFilters) +TARGET_LINK_LIBRARIES(cpPlugins_Instances_ResamplingFilters cpPlugins_Instances_ScalarImagesBaseFilters cpPlugins_Instances_Transforms) +TARGET_LINK_LIBRARIES(cpPlugins_Instances_ImageMeshFilters cpPlugins_Instances_ScalarImagesBaseFilters cpPlugins_Instances_Mesh) +TARGET_LINK_LIBRARIES(cpPlugins_Instances_NeighborhoodIterators cpPlugins_Instances_ScalarImages) +TARGET_LINK_LIBRARIES(cpPlugins_Instances_DistanceMapFilters cpPlugins_Instances_ScalarImagesBaseFilters cpPlugins_Instances_NeighborhoodIterators cpPlugins_Instances_ThresholdFilters) ## eof - $RCSfile$ diff --git a/lib/cpPlugins_Instances/ColorImages.i b/lib/cpPlugins_Instances/ColorImages.i new file mode 100644 index 0000000..fce45e1 --- /dev/null +++ b/lib/cpPlugins_Instances/ColorImages.i @@ -0,0 +1,36 @@ +d #itk_pixels=RGB;RGBA +d #itk_objs=ImportImageContainer;Image;ImageSource +d #itk_it=ImageRegion;ImageScanline +d #itk_it_wi=Image;ImageRegion;ImageLinear +d #ints=char;short;int;long +d #uints=unsigned #ints +d #floats=float;double +d #pixels=#ints;#uints;#floats +d #dims=1;2;3;4 + +i cpPlugins_Instances/ColorPixels.h +t itk{#itk_objs}.h +t itk{#itk_it}Iterator.h +t itk{#itk_it}ConstIterator.h +t itk{#itk_it_wi}IteratorWithIndex.h +t itk{#itk_it_wi}ConstIteratorWithIndex.h + +* ============== +* = Base types = +* ============== +c itk::ImportImageContainer< unsigned long, itk::{#itk_pixels}Pixel< #pixels > > +c itk::Image< itk::{#itk_pixels}Pixel< #pixels >, #dims > + +* =============================== +* = All of filters superclasses = +* =============================== +c itk::ImageSource< itk::Image< itk::{#itk_pixels}Pixel< #pixels >, #dims > > + +* =============================== +* = All of base image iterators = +* =============================== +b #define ITK_LEGACY_REMOVE +c itk::{#itk_it}@{Const;{}}Iterator< itk::Image< itk::{#itk_pixels}Pixel< #pixels >, #dims > > +c itk::{#itk_it_wi}@{Const;{}}IteratorWithIndex< itk::Image< itk::{#itk_pixels}Pixel< #pixels >, #dims > > + +* eof - $RCSfile$ diff --git a/lib/cpPlugins_Instances/ColorPixels.i b/lib/cpPlugins_Instances/ColorPixels.i new file mode 100644 index 0000000..7d1ab08 --- /dev/null +++ b/lib/cpPlugins_Instances/ColorPixels.i @@ -0,0 +1,11 @@ +d #itk_objs=RGB;RGBA +d #ints=char;short;int;long +d #uints=unsigned #ints +d #floats=float;double +d #pixels=#ints;#uints;#floats + +t itk{#itk_objs}Pixel.h + +c itk::{#itk_objs}Pixel< #pixels > + +* eof - $RCSfile$ diff --git a/lib/cpPlugins_Instances/Decorators.i b/lib/cpPlugins_Instances/Decorators.i new file mode 100644 index 0000000..948344c --- /dev/null +++ b/lib/cpPlugins_Instances/Decorators.i @@ -0,0 +1,11 @@ +d #ints=char;short;int;long +d #uints=unsigned #ints +d #floats=float;double +d #pixels=#ints;#uints;#floats + +t itkSimpleDataObjectDecorator.h + +c itk::SimpleDataObjectDecorator< std::string > +c itk::SimpleDataObjectDecorator< #pixels > + +* eof - $RCSfile$ \ No newline at end of file diff --git a/lib/cpPlugins_Instances/DistanceMapFilters.i b/lib/cpPlugins_Instances/DistanceMapFilters.i index 1938f35..59dfe0a 100644 --- a/lib/cpPlugins_Instances/DistanceMapFilters.i +++ b/lib/cpPlugins_Instances/DistanceMapFilters.i @@ -1,4 +1,4 @@ -f cpPlugins_Instances/InPlaceImageFiltersBase.h +f cpPlugins_Instances/ScalarImagesBaseFilters.h i itkProgressReporter.h t itkBinaryContourImageFilter.h @@ -10,4 +10,4 @@ d #float=float;double d #scalar=#int;unsigned #int;#float d #filters=itk::BinaryContourImageFilter;itk::SignedMaurerDistanceMapImageFilter -c #filters< itk::Image< @{#scalar}, #dims >, itk::Image< @{#float}, #dims > > +c #filters< itk::Image< #scalar, #dims >, itk::Image< #float, #dims > > diff --git a/lib/cpPlugins_Instances/GaussianImageFilters.i b/lib/cpPlugins_Instances/GaussianImageFilters.i index 9792abd..faec2c4 100644 --- a/lib/cpPlugins_Instances/GaussianImageFilters.i +++ b/lib/cpPlugins_Instances/GaussianImageFilters.i @@ -1,4 +1,5 @@ -f cpPlugins_Instances/ImageFiltersBase.h +f cpPlugins_Instances/ScalarImagesBaseFilters.h +f cpPlugins_Instances/VectorImages.h t cpExtensions/Algorithms/MultiScaleGaussianImageFilter.h t itkGradientRecursiveGaussianImageFilter.h diff --git a/lib/cpPlugins_Instances/Image.i b/lib/cpPlugins_Instances/Image.i deleted file mode 100644 index 7e8c24d..0000000 --- a/lib/cpPlugins_Instances/Image.i +++ /dev/null @@ -1,31 +0,0 @@ -f cpPlugins_Instances/Base.h - -i complex -t itkImage.h -t itkImageBase.h -t itkImportImageContainer.h -t itkImageRegion.h - -d #dims=1;2;3 -d #int=char;short;int;long -d #float=float;double -d #scalar=#int;unsigned #int;#float -d #color_pixels=itk::RGBPixel< #scalar >;itk::RGBAPixel< #scalar > -d #complex_pixels=std::complex< #float > -d #lin_alg_vectors=itk::CovariantVector;itk::Point;itk::Vector -d #pixels=#scalar;#color_pixels;#complex_pixels -d #array_pixels=#lin_alg_vectors;itk::SymmetricSecondRankTensor -d #double_array_pixels=itk::Matrix - -c itk::ImageRegion< #dims > -c itk::ImageBase< #dims > - -c itk::ImportImageContainer< unsigned long, #pixels > -c itk::ImportImageContainer< unsigned long, #array_pixels< #float, #dims > > -c itk::ImportImageContainer< unsigned long, #double_array_pixels< #float, #dims, #dims > > -c itk::ImportImageContainer< unsigned long, itk::DiffusionTensor3D< #float > > - -c itk::Image< #pixels, #dims > -c itk::Image< #array_pixels< #float, #dims >, #dims > -c itk::Image< #double_array_pixels< #float, #dims, #dims >, #dims > -c itk::Image< itk::DiffusionTensor3D< #float >, #dims > diff --git a/lib/cpPlugins_Instances/ImageFiltersBase.i b/lib/cpPlugins_Instances/ImageFiltersBase.i deleted file mode 100644 index c93f469..0000000 --- a/lib/cpPlugins_Instances/ImageFiltersBase.i +++ /dev/null @@ -1,24 +0,0 @@ -f cpPlugins_Instances/Image.h - -t itkImageSource.h -t itkImageToImageFilter.h - -d #dims=2;3 -d #int=char;short;int;long -d #float=float;double -d #scalar=#int;unsigned #int;#float -d #color_pixels=itk::RGBPixel< #scalar >;itk::RGBAPixel< #scalar > -d #complex_pixels=std::complex< #float > -d #lin_alg_vectors=itk::CovariantVector;itk::Point;itk::Vector -d #pixels=#scalar;#color_pixels;#complex_pixels -d #array_pixels=#lin_alg_vectors;itk::SymmetricSecondRankTensor -d #double_array_pixels=itk::Matrix -d #filters=itk::ImageToImageFilter - -c itk::ImageSource< itk::Image< #pixels, #dims > > -c itk::ImageSource< itk::Image< #array_pixels< #float, #dims >, #dims > > -c itk::ImageSource< itk::Image< #double_array_pixels< #float, #dims, #dims >, #dims > > - -c #filters< itk::Image< @{#pixels}, #dims >, itk::Image< @{#pixels}, #dims > > -c #filters< itk::Image< #array_pixels< @{#float}, #dims >, #dims >, itk::Image< #array_pixels< @{#float}, #dims >, #dims > > -c #filters< itk::Image< #double_array_pixels< @{#float}, #dims, #dims >, #dims >, itk::Image< #double_array_pixels< @{#float}, #dims, #dims >, #dims > > diff --git a/lib/cpPlugins_Instances/ImageIO.i b/lib/cpPlugins_Instances/ImageIO.i deleted file mode 100644 index e6397bc..0000000 --- a/lib/cpPlugins_Instances/ImageIO.i +++ /dev/null @@ -1,31 +0,0 @@ -b #include -b #undef ITKIOImageBase_HIDDEN -b #define ITKIOImageBase_HIDDEN - -f cpPlugins_Instances/Image.h - -i itkImageIOFactory.h -i itkGDCMSeriesFileNames.h - -t itkImageFileReader.h -t itkImageFileWriter.h -t itkImageSeriesReader.h -t itkConvertPixelBuffer.h -t itkImageAlgorithm.h -t itkSimpleDataObjectDecorator.h - -d #dims=2;3 -d #int=char;short;int;long -d #float=float;double -d #scalar=#int;unsigned #int;#float -d #color_pixels=itk::RGBPixel< #scalar >;itk::RGBAPixel< #scalar > -d #complex_pixels=std::complex< #float > -d #lin_alg_vectors=itk::CovariantVector;itk::Point;itk::Vector -d #pixels=#scalar;#color_pixels;#complex_pixels -d #array_pixels=#lin_alg_vectors;itk::SymmetricSecondRankTensor -d #double_array_pixels=itk::Matrix -d #filters=itk::ImageFileReader;itk::ImageFileWriter;itk::ImageSeriesReader - -c #filters< itk::Image< #pixels, #dims > > -c #filters< itk::Image< #array_pixels< #float, #dims >, #dims > > -c #filters< itk::Image< #double_array_pixels< #float, #dims, #dims >, #dims > > diff --git a/lib/cpPlugins_Instances/ImageITK2VTK.i b/lib/cpPlugins_Instances/ImageITK2VTK.i index 7529a31..03c98f6 100644 --- a/lib/cpPlugins_Instances/ImageITK2VTK.i +++ b/lib/cpPlugins_Instances/ImageITK2VTK.i @@ -1,4 +1,7 @@ -f cpPlugins_Instances/Image.h +f cpPlugins_Instances/ScalarImages.h +f cpPlugins_Instances/ColorImages.h +f cpPlugins_Instances/VectorImages.h + t itkImageToVTKImageFilter.h t itkVTKImageToImageFilter.h t itkVTKImageExport.h @@ -10,9 +13,11 @@ d #float=float;double d #scalar=#int;unsigned #int;#float d #color_pixels=itk::RGBPixel< #scalar >;itk::RGBAPixel< #scalar > d #lin_alg_vectors=itk::CovariantVector;itk::Point;itk::Vector -d #pixels=#scalar;#color_pixels;#complex_pixels +d #pixels=#scalar;#color_pixels d #array_pixels=#lin_alg_vectors;itk::SymmetricSecondRankTensor d #filters=itk::ImageToVTKImageFilter;itk::VTKImageToImageFilter c #filters< itk::Image< #pixels, #dims > > c #filters< itk::Image< #array_pixels< #float, #dims >, #dims > > + +* eof - $RCSfile$ diff --git a/lib/cpPlugins_Instances/ImageIterators.i b/lib/cpPlugins_Instances/ImageIterators.i deleted file mode 100644 index f815b21..0000000 --- a/lib/cpPlugins_Instances/ImageIterators.i +++ /dev/null @@ -1,41 +0,0 @@ -b #define ITK_LEGACY_REMOVE - -f cpPlugins_Instances/Image.h - -t itkImageRegionConstIterator.h -t itkImageRegionIterator.h -t itkImageScanlineConstIterator.h -t itkImageScanlineIterator.h -t itkImageLinearConstIteratorWithIndex.h -t itkImageLinearIteratorWithIndex.h -t itkImageConstIteratorWithIndex.h -t itkImageIteratorWithIndex.h -t itkZeroFluxNeumannBoundaryCondition.h -t itkConstNeighborhoodIterator.h -t itkNeighborhoodIterator.h -t itkNeighborhood.h -t itkConstShapedNeighborhoodIterator.h -t itkShapedNeighborhoodIterator.h -t itkImageRegionConstIteratorWithIndex.h -t itkImageRegionIteratorWithIndex.h - -d #dims=1;2;3 -d #int=char;short;int;long -d #float=float;double -d #scalar=#int;unsigned #int;#float -d #color_pixels=itk::RGBPixel< #scalar >;itk::RGBAPixel< #scalar > -d #complex_pixels=std::complex< #float > -d #lin_alg_vectors=itk::CovariantVector;itk::Point;itk::Vector -d #pixels=#scalar;#color_pixels;#complex_pixels -d #array_pixels=#lin_alg_vectors;itk::SymmetricSecondRankTensor -d #double_array_pixels=itk::Matrix -d #iterators=itk::ImageRegionConstIterator;itk::ImageRegionIterator;itk::ImageConstIteratorWithIndex;itk::ImageIteratorWithIndex;itk::ImageScanlineConstIterator;itk::ImageScanlineIterator;itk::ImageLinearConstIteratorWithIndex;itk::ImageLinearIteratorWithIndex;itk::ImageRegionConstIteratorWithIndex;itk::ImageRegionIteratorWithIndex -d #conds=itk::ZeroFluxNeumannBoundaryCondition -d #neigh_iterators=itk::ConstNeighborhoodIterator;itk::NeighborhoodIterator;itk::ConstShapedNeighborhoodIterator;itk::ShapedNeighborhoodIterator - -c itk::Neighborhood< #pixels*, #dims, itk::NeighborhoodAllocator< #pixels* > > -c #iterators< itk::Image< #pixels, #dims > > -c #iterators< itk::Image< #array_pixels< #float, #dims >, #dims > > -c #iterators< itk::Image< #double_array_pixels< #float, #dims, #dims >, #dims > > -c #conds< itk::Image< #scalar, #dims >, itk::Image< #scalar, #dims > > -c #neigh_iterators< itk::Image< #scalar, #dims >, #conds< itk::Image< #scalar, #dims >, itk::Image< #scalar, #dims > > > diff --git a/lib/cpPlugins_Instances/ImageMeshFilters.i b/lib/cpPlugins_Instances/ImageMeshFilters.i index f15e51b..fe883c7 100644 --- a/lib/cpPlugins_Instances/ImageMeshFilters.i +++ b/lib/cpPlugins_Instances/ImageMeshFilters.i @@ -1,4 +1,4 @@ -f cpPlugins_Instances/Image.h +f cpPlugins_Instances/ScalarImages.h f cpPlugins_Instances/Mesh.h t itkTriangleMeshToBinaryImageFilter.h diff --git a/lib/cpPlugins_Instances/ImagesIO.i b/lib/cpPlugins_Instances/ImagesIO.i new file mode 100644 index 0000000..32ed783 --- /dev/null +++ b/lib/cpPlugins_Instances/ImagesIO.i @@ -0,0 +1,28 @@ +b #include +b #undef ITKIOImageBase_HIDDEN +b #define ITKIOImageBase_HIDDEN + +d #ints=char;short;int;long +d #uints=unsigned #ints +d #floats=float;double +d #pixels=#ints;#uints;#floats +d #dims=1;2;3;4 +d #vectors=CovariantVector;Point;Vector;SymmetricSecondRankTensor +d #colors=RGB;RGBA +d #io=ImageFileReader;ImageFileWriter;ImageSeriesReader + +i cpPlugins_Instances/ScalarImages.h +i cpPlugins_Instances/ColorImages.h +i cpPlugins_Instances/VectorImages.h + +t itk{#io}.h +t itkConvertPixelBuffer.h +t itkImageAlgorithm.h + +c itk::{#io}< itk::Image< #pixels, #dims > > +c itk::{#io}< itk::Image< std::complex< #floats >, #dims > > +c itk::{#io}< itk::Image< itk::{#colors}Pixel< #pixels >, #dims > > +c itk::{#io}< itk::Image< itk::#vectors< #floats, #dims >, #dims > > +c itk::{#io}< itk::Image< itk::DiffusionTensor3D< #floats >, 3 > > + +* eof - $RCSfile$ diff --git a/lib/cpPlugins_Instances/InPlaceImageFiltersBase.i b/lib/cpPlugins_Instances/InPlaceImageFiltersBase.i deleted file mode 100644 index 7ec274d..0000000 --- a/lib/cpPlugins_Instances/InPlaceImageFiltersBase.i +++ /dev/null @@ -1,19 +0,0 @@ -f cpPlugins_Instances/ImageFiltersBase.h - -t itkInPlaceImageFilter.h - -d #dims=2;3 -d #int=char;short;int;long -d #float=float;double -d #scalar=#int;unsigned #int;#float -d #color_pixels=itk::RGBPixel< #scalar >;itk::RGBAPixel< #scalar > -d #complex_pixels=std::complex< #float > -d #lin_alg_vectors=itk::CovariantVector;itk::Point;itk::Vector -d #pixels=#scalar;#color_pixels;#complex_pixels -d #array_pixels=#lin_alg_vectors;itk::SymmetricSecondRankTensor -d #double_array_pixels=itk::Matrix -d #filters=itk::InPlaceImageFilter - -c #filters< itk::Image< @{#pixels}, #dims >, itk::Image< @{#pixels}, #dims > > -c #filters< itk::Image< #array_pixels< @{#float}, #dims >, #dims >, itk::Image< #array_pixels< @{#float}, #dims >, #dims > > -c #filters< itk::Image< #double_array_pixels< @{#float}, #dims, #dims >, #dims >, itk::Image< #double_array_pixels< @{#float}, #dims, #dims >, #dims > > diff --git a/lib/cpPlugins_Instances/Mesh.i b/lib/cpPlugins_Instances/Mesh.i index cfd6e44..ea67b8f 100644 --- a/lib/cpPlugins_Instances/Mesh.i +++ b/lib/cpPlugins_Instances/Mesh.i @@ -1,4 +1,4 @@ -f cpPlugins_Instances/Base.h +f cpPlugins_Instances/BaseObjects.h d #dims=2;3 d #float=float;double @@ -20,3 +20,5 @@ c itk::VectorContainer< unsigned long, itk::CellInterface< #float, itk::CellTrai c @{itk::VertexCell;itk::LineCell;itk::TriangleCell}< itk::CellInterface< #float, itk::CellTraitsInfo< #dims, float, float, unsigned long, unsigned long, unsigned long, itk::Point< float, #dims >, itk::VectorContainer< unsigned long, itk::Point< float, #dims > >, std::set< unsigned long > > > > c @{itk::PointSet;itk::Mesh}< #float, #dims > c itk::MeshSource< itk::Mesh< #float, #dims > > + +* eof - $RCSfile$ diff --git a/lib/cpPlugins_Instances/NeighborhoodIterators.i b/lib/cpPlugins_Instances/NeighborhoodIterators.i new file mode 100644 index 0000000..7cb2865 --- /dev/null +++ b/lib/cpPlugins_Instances/NeighborhoodIterators.i @@ -0,0 +1,20 @@ +f cpPlugins_Instances/ScalarImages.h + +t itkZeroFluxNeumannBoundaryCondition.h +t itkConstNeighborhoodIterator.h +t itkNeighborhoodIterator.h +t itkNeighborhood.h +t itkConstShapedNeighborhoodIterator.h +t itkShapedNeighborhoodIterator.h + +d #dims=1;2;3;4 +d #int=char;short;int;long +d #float=float;double +d #scalar=#int;unsigned #int;#float +d #pixels=#scalar;#color_pixels;#complex_pixels +d #conds=itk::ZeroFluxNeumannBoundaryCondition +d #neigh_iterators=itk::ConstNeighborhoodIterator;itk::NeighborhoodIterator;itk::ConstShapedNeighborhoodIterator;itk::ShapedNeighborhoodIterator + +c itk::Neighborhood< #pixels*, #dims, itk::NeighborhoodAllocator< #pixels* > > +c #conds< itk::Image< #scalar, #dims >, itk::Image< #scalar, #dims > > +c #neigh_iterators< itk::Image< #scalar, #dims >, #conds< itk::Image< #scalar, #dims >, itk::Image< #scalar, #dims > > > diff --git a/lib/cpPlugins_Instances/Paths.i b/lib/cpPlugins_Instances/Paths.i index 148ac75..c19c971 100644 --- a/lib/cpPlugins_Instances/Paths.i +++ b/lib/cpPlugins_Instances/Paths.i @@ -1,4 +1,4 @@ -f cpPlugins_Instances/Base.h +f cpPlugins_Instances/BaseObjects.h i cpExtensions/DataStructures/PolyLineParametricPath.h i cpExtensions/DataStructures/ImageIndexesContainer.h @@ -20,3 +20,4 @@ c cpExtensions::DataStructures::ImageIndexesContainer< #dims > c cpExtensions::Visualization::PolyLineParametricPathToPolyData< cpExtensions::DataStructures::PolyLineParametricPath< #dims > > c cpExtensions::Visualization::ImageIndexesContainerToPolyData< cpExtensions::DataStructures::ImageIndexesContainer< #dims > > +* eof - $RCSfile$ diff --git a/lib/cpPlugins_Instances/ResamplingFilters.i b/lib/cpPlugins_Instances/ResamplingFilters.i index 46fc759..a9e742e 100644 --- a/lib/cpPlugins_Instances/ResamplingFilters.i +++ b/lib/cpPlugins_Instances/ResamplingFilters.i @@ -1,4 +1,4 @@ -f cpPlugins_Instances/ImageFiltersBase.h +f cpPlugins_Instances/ScalarImagesBaseFilters.h f cpPlugins_Instances/Transforms.h t itkResampleImageFilter.h diff --git a/lib/cpPlugins_Instances/ScalarImages.i b/lib/cpPlugins_Instances/ScalarImages.i new file mode 100644 index 0000000..f7886d8 --- /dev/null +++ b/lib/cpPlugins_Instances/ScalarImages.i @@ -0,0 +1,41 @@ +d #itk_objs=ImageBase;ImageRegion;ImportImageContainer;Image;ImageSource +d #itk_it=ImageRegion;ImageScanline +d #itk_it_wi=Image;ImageRegion;ImageLinear +d #ints=char;short;int;long +d #uints=unsigned #ints +d #floats=float;double +d #pixels=#ints;#uints;#floats +d #dims=1;2;3;4 + +i complex +t itk{#itk_objs}.h +t itk{#itk_it}Iterator.h +t itk{#itk_it}ConstIterator.h +t itk{#itk_it_wi}IteratorWithIndex.h +t itk{#itk_it_wi}ConstIteratorWithIndex.h + +* ============== +* = Base types = +* ============== +c itk::ImportImageContainer< unsigned long, #pixels > +c itk::ImportImageContainer< unsigned long, std::complex< #floats > > +c itk::@{ImageRegion;ImageBase}< #dims > +c itk::Image< #pixels, #dims > +c itk::Image< std::complex< #floats >, #dims > + +* =============================== +* = All of filters superclasses = +* =============================== +c itk::ImageSource< itk::Image< #pixels, #dims > > +c itk::ImageSource< itk::Image< std::complex< #floats >, #dims > > + +* =============================== +* = All of base image iterators = +* =============================== +b #define ITK_LEGACY_REMOVE +c itk::{#itk_it}@{Const;{}}Iterator< itk::Image< #pixels, #dims > > +c itk::{#itk_it_wi}@{Const;{}}IteratorWithIndex< itk::Image< #pixels, #dims > > +c itk::{#itk_it}@{Const;{}}Iterator< itk::Image< std::complex< #floats >, #dims > > +c itk::{#itk_it_wi}@{Const;{}}IteratorWithIndex< itk::Image< std::complex< #floats >, #dims > > + +* eof - $RCSfile$ diff --git a/lib/cpPlugins_Instances/ScalarImagesBaseFilters.i b/lib/cpPlugins_Instances/ScalarImagesBaseFilters.i new file mode 100644 index 0000000..4820938 --- /dev/null +++ b/lib/cpPlugins_Instances/ScalarImagesBaseFilters.i @@ -0,0 +1,20 @@ +d #ints=char;short;int;long +d #uints=unsigned #ints +d #floats=float;double +d #pixels=#ints;#uints;#floats +d #inputs=#pixels +d #outputs=#pixels +d #dims=1;2;3;4 +d #itk_filters=ImageToImage;InPlaceImage + +i cpPlugins_Instances/ScalarImages.h +t itk{#itk_filters}Filter.h + +* ===================== +* = Base filter types = +* ===================== +c itk::{#itk_filters}Filter< itk::Image< #inputs, #dims >, itk::Image< #outputs, #dims > > +c itk::{#itk_filters}Filter< itk::Image< #pixels, 3 >, itk::Image< #pixels, 2 > > +c itk::{#itk_filters}Filter< itk::Image< #pixels, 2 >, itk::Image< #pixels, 3 > > + +* eof - $RCSfile$ diff --git a/lib/cpPlugins_Instances/ScalarVectorImagesBaseFilters.i b/lib/cpPlugins_Instances/ScalarVectorImagesBaseFilters.i new file mode 100644 index 0000000..c017bf9 --- /dev/null +++ b/lib/cpPlugins_Instances/ScalarVectorImagesBaseFilters.i @@ -0,0 +1,19 @@ +d #ints=char;short;int;long +d #uints=unsigned #ints +d #floats=float;double +d #pixels=#ints;#uints;#floats +d #inputs=#pixels +d #outputs=#pixels +d #dims=1;2;3;4 +d #itk_filters=ImageToImage;InPlaceImage + +i cpPlugins_Instances/ScalarImages.h +i cpPlugins_Instances/VectorImages.h +t itk{#itk_filters}Filter.h + +* ===================== +* = Base filter types = +* ===================== +c itk::{#itk_filters}Filter< itk::Image< #pixels, #dims >, itk::Image< itk::CovariantVector< #floats, #dims >, #dims > > + +* eof - $RCSfile$ diff --git a/lib/cpPlugins_Instances/ThresholdFilters.i b/lib/cpPlugins_Instances/ThresholdFilters.i index 125d7cc..9d1a884 100644 --- a/lib/cpPlugins_Instances/ThresholdFilters.i +++ b/lib/cpPlugins_Instances/ThresholdFilters.i @@ -1,4 +1,4 @@ -f cpPlugins_Instances/InPlaceImageFiltersBase.h +f cpPlugins_Instances/ScalarImagesBaseFilters.h t itkBinaryThresholdImageFilter.h t itkUnaryFunctorImageFilter.h @@ -8,5 +8,6 @@ d #dims=2;3 d #int=char;short;int;long d #float=float;double d #scalar=#int;unsigned #int;#float +d #output=#int;unsigned #int;#float -c itk::BinaryThresholdImageFilter< itk::Image< @{#scalar}, #dims >, itk::Image< @{#scalar}, #dims > > +c itk::BinaryThresholdImageFilter< itk::Image< #scalar, #dims >, itk::Image< #output, #dims > > diff --git a/lib/cpPlugins_Instances/Transforms.i b/lib/cpPlugins_Instances/Transforms.i index 15ce975..bea6124 100644 --- a/lib/cpPlugins_Instances/Transforms.i +++ b/lib/cpPlugins_Instances/Transforms.i @@ -1,4 +1,4 @@ -f cpPlugins_Instances/Base.h +f cpPlugins_Instances/BaseObjects.h d #dims=2;3 d #float=float;double @@ -10,3 +10,5 @@ t itkDataObjectDecorator.h c itk::OptimizerParameters< #float > c itk::Transform< #float, #dims, #dims > c itk::DataObjectDecorator< itk::Transform< #float, #dims, #dims > > + +* eof - $RCSfile$ diff --git a/lib/cpPlugins_Instances/VectorImages.i b/lib/cpPlugins_Instances/VectorImages.i new file mode 100644 index 0000000..f8fb7ea --- /dev/null +++ b/lib/cpPlugins_Instances/VectorImages.i @@ -0,0 +1,38 @@ +d #itk_pixels=CovariantVector;Point;Vector;SymmetricSecondRankTensor +d #itk_objs=ImportImageContainer;Image;ImageSource +d #itk_it=ImageRegion;ImageScanline +d #itk_it_wi=Image;ImageRegion;ImageLinear +d #floats=float;double +d #dims=1;2;3;4 + +i cpPlugins_Instances/BaseObjects.h +t itk{#itk_objs}.h +t itk{#itk_it}Iterator.h +t itk{#itk_it}ConstIterator.h +t itk{#itk_it_wi}IteratorWithIndex.h +t itk{#itk_it_wi}ConstIteratorWithIndex.h + +* ============== +* = Base types = +* ============== +c itk::ImportImageContainer< unsigned long, itk::{#itk_pixels}< #floats, #dims > > +c itk::ImportImageContainer< unsigned long, itk::DiffusionTensor3D< #floats > > +c itk::Image< itk::{#itk_pixels}< #floats, #dims >, #dims > +c itk::Image< itk::DiffusionTensor3D< #floats >, 3 > + +* =============================== +* = All of filters superclasses = +* =============================== +c itk::ImageSource< itk::Image< itk::{#itk_pixels}< #floats, #dims >, #dims > > +c itk::ImageSource< itk::Image< itk::DiffusionTensor3D< #floats >, 3 > > + +* =============================== +* = All of base image iterators = +* =============================== +b #define ITK_LEGACY_REMOVE +c itk::{#itk_it}@{Const;{}}Iterator< itk::Image< itk::{#itk_pixels}< #floats, #dims >, #dims > > +c itk::{#itk_it_wi}@{Const;{}}IteratorWithIndex< itk::Image< itk::{#itk_pixels}< #floats, #dims >, #dims > > +c itk::{#itk_it}@{Const;{}}Iterator< itk::Image< itk::DiffusionTensor3D< #floats >, 3 > > +c itk::{#itk_it_wi}@{Const;{}}IteratorWithIndex< itk::Image< itk::DiffusionTensor3D< #floats >, 3 > > + +* eof - $RCSfile$ diff --git a/plugins/cpPluginsIO/CMakeLists.txt b/plugins/cpPluginsIO/CMakeLists.txt index 8fe59cd..ef17bd0 100644 --- a/plugins/cpPluginsIO/CMakeLists.txt +++ b/plugins/cpPluginsIO/CMakeLists.txt @@ -37,7 +37,7 @@ SET( SET( target_LIBRARIES - cpPlugins + ${cpPlugins_LIBRARIES} ) ## ===================== diff --git a/plugins/cpPluginsIO/DicomSeriesReader.cxx b/plugins/cpPluginsIO/DicomSeriesReader.cxx index 019a713..1116560 100644 --- a/plugins/cpPluginsIO/DicomSeriesReader.cxx +++ b/plugins/cpPluginsIO/DicomSeriesReader.cxx @@ -16,7 +16,8 @@ #include #include -#include +#include +#include /** */ diff --git a/plugins/cpPluginsIO/ImageReader.cxx b/plugins/cpPluginsIO/ImageReader.cxx index f614a63..e9f3e59 100644 --- a/plugins/cpPluginsIO/ImageReader.cxx +++ b/plugins/cpPluginsIO/ImageReader.cxx @@ -1,6 +1,7 @@ #include #include -#include +#include +#include // ------------------------------------------------------------------------- cpPluginsIO::ImageReader:: diff --git a/plugins/cpPluginsIO/ImageWriter.cxx b/plugins/cpPluginsIO/ImageWriter.cxx index 8038417..dfbd097 100644 --- a/plugins/cpPluginsIO/ImageWriter.cxx +++ b/plugins/cpPluginsIO/ImageWriter.cxx @@ -1,6 +1,6 @@ #include #include -#include +#include // ------------------------------------------------------------------------- cpPluginsIO::ImageWriter:: diff --git a/plugins/cpPluginsImageFilters/CMakeLists.txt b/plugins/cpPluginsImageFilters/CMakeLists.txt index 99fca15..9cabb8d 100644 --- a/plugins/cpPluginsImageFilters/CMakeLists.txt +++ b/plugins/cpPluginsImageFilters/CMakeLists.txt @@ -32,7 +32,7 @@ SET( SET( target_LIBRARIES - cpPlugins + ${cpPlugins_LIBRARIES} ) ## ===================== diff --git a/plugins/cpPluginsImageMeshFilters/CMakeLists.txt b/plugins/cpPluginsImageMeshFilters/CMakeLists.txt index bda2804..2d7a8ef 100644 --- a/plugins/cpPluginsImageMeshFilters/CMakeLists.txt +++ b/plugins/cpPluginsImageMeshFilters/CMakeLists.txt @@ -33,7 +33,7 @@ SET( SET( target_LIBRARIES cpExtensions - cpPlugins + ${cpPlugins_LIBRARIES} ) ## ===================== diff --git a/plugins/cpPluginsMeshFilters/CMakeLists.txt b/plugins/cpPluginsMeshFilters/CMakeLists.txt index 25b63c6..7c87e89 100644 --- a/plugins/cpPluginsMeshFilters/CMakeLists.txt +++ b/plugins/cpPluginsMeshFilters/CMakeLists.txt @@ -33,7 +33,7 @@ SET( SET( target_LIBRARIES cpExtensions - cpPlugins + ${cpPlugins_LIBRARIES} ) ## ===================== diff --git a/plugins/cpPluginsWidgets/CMakeLists.txt b/plugins/cpPluginsWidgets/CMakeLists.txt index a01eca9..8c05b8b 100644 --- a/plugins/cpPluginsWidgets/CMakeLists.txt +++ b/plugins/cpPluginsWidgets/CMakeLists.txt @@ -33,7 +33,7 @@ SET( SET( target_LIBRARIES cpExtensions - cpPlugins + ${cpPlugins_LIBRARIES} ) ## ===================== diff --git a/third_party_installers/cpPlugins_Install_ITK.sh b/third_party_installers/cpPlugins_Install_ITK.sh new file mode 100755 index 0000000..d9ca4ff --- /dev/null +++ b/third_party_installers/cpPlugins_Install_ITK.sh @@ -0,0 +1,92 @@ +#!/bin/bash + +## Some configuration variables +number_of_processes="-j4" + +## Locate cmake executable +cmake_exec="/usr/bin/cmake" +if [ ! -x $cmake_exec ]; then + cmake_exec="/usr/local/bin/cmake" +fi +if [ ! -x $cmake_exec ]; then + cmake_exec="${HOME}/local/bin/cmake" +fi +if [ ! -x $cmake_exec ]; then + echo "$0: modify this script to put the correct location of cmake." + exit 1 +fi + +## Check input parameters and process inputs (if needed) +if [ "$#" -eq 1 ]; then + valid_extensions=("zip" "tar" "tar.gz" "tar.bz2") + actual_ext="" + for ext in ${valid_extensions[@]}; do + if [ `basename $1 $ext` != $1 ]; then + actual_ext=$ext + fi + done + if [ "x$actual_ext" == "x" ]; then + echo "$0: Invalid file type." + exit 1 + fi + canonical_path=`readlink -e $1` + source_dir=`dirname $canonical_path`/`basename $1 .$actual_ext` + build_dir=`dirname $canonical_path`/`basename $1 .$actual_ext`-build + echo -n "Cleaning directories... " + rm -rf $source_dir + rm -rf $build_dir + echo "done." + echo -n "Creating directories... " + mkdir -p $source_dir + mkdir -p $build_dir + echo "done." + echo -n "Extracting sources... " + if [ "$actual_ext" == "zip" ]; then + echo unzip $canonical_path + elif [ "$actual_ext" == "tar" ]; then + tar xf $canonical_path -C $source_dir --strip-components=1 + elif [ "$actual_ext" == "tar.gz" ]; then + tar xzf $canonical_path -C $source_dir --strip-components=1 + elif [ "$actual_ext" == "tar.bz2" ]; then + tar xjf $canonical_path -C $source_dir --strip-components=1 + else + echo "$0: Invalid file type." + exit 1 + fi + echo "done!" +elif [ "$#" -eq 2 ]; then + source_dir=`dirname $1` + build_dir=`dirname $2` +else + echo "Usage: [itk_package] or [itk_source_dir itk_build_dir]" +fi + +echo "Given source dir : \"$source_dir\"" +echo "Given build dir : \"$build_dir\"" + +echo "Configuring sources... " +cd $build_dir +$cmake_exec \ + -DCMAKE_CXX_FLAGS:STRING=-std=c++11 \ + -DBUILD_DOCUMENTATION:BOOL=OFF \ + -DBUILD_EXAMPLES:BOOL=OFF \ + -DBUILD_SHARED_LIBS:BOOL=ON \ + -DBUILD_TESTING:BOOL=OFF \ + -DCMAKE_BUILD_TYPE:STRING=MinSizeRel \ + -DModule_ITKReview:BOOL=ON \ + -DModule_ITKVtkGlue:BOOL=OFF \ + -DCMAKE_INSTALL_PREFIX:PATH=${HOME}/local \ + ${source_dir} +echo "Configuring sources... done." + +echo "Compiling sources..." +cd $build_dir +make $number_of_processes +echo "Compiling sources... done." + +echo "Installing package..." +cd $build_dir +make -j install +echo "Installing package... done." + +## eof - $RCSfile$ diff --git a/third_party_installers/cpPlugins_Install_QT4.sh b/third_party_installers/cpPlugins_Install_QT4.sh new file mode 100755 index 0000000..cb3afc3 --- /dev/null +++ b/third_party_installers/cpPlugins_Install_QT4.sh @@ -0,0 +1,70 @@ +#!/bin/bash + +## Check input parameters and process inputs (if needed) +if [ "$#" -eq 1 ]; then + valid_extensions=("zip" "tar" "tar.gz" "tar.bz2") + actual_ext="" + for ext in ${valid_extensions[@]}; do + if [ `basename $1 $ext` != $1 ]; then + actual_ext=$ext + fi + done + if [ "x$actual_ext" == "x" ]; then + echo "$0: Invalid file type." + exit 1 + fi + canonical_path=`readlink -e $1` + source_dir=`dirname $canonical_path`/`basename $1 .$actual_ext` + build_dir=`dirname $canonical_path`/`basename $1 .$actual_ext`-build + echo -n "Cleaning directories... " + rm -rf $source_dir + rm -rf $build_dir + echo "done." + echo -n "Creating directories... " + mkdir -p $source_dir + mkdir -p $build_dir + echo "done." + echo -n "Extracting sources... " + if [ "$actual_ext" == "zip" ]; then + echo unzip $canonical_path + elif [ "$actual_ext" == "tar" ]; then + tar xf $canonical_path -C $source_dir --strip-components=1 + elif [ "$actual_ext" == "tar.gz" ]; then + tar xzf $canonical_path -C $source_dir --strip-components=1 + elif [ "$actual_ext" == "tar.bz2" ]; then + tar xjf $canonical_path -C $source_dir --strip-components=1 + else + echo "$0: Invalid file type." + exit 1 + fi + echo "done!" +elif [ "$#" -eq 2 ]; then + source_dir=`dirname $1` + build_dir=`dirname $2` +else + echo "Usage: [qt4_package] or [qt4_source_dir qt4_build_dir]" +fi + +echo "Given source dir : \"$source_dir\"" +echo "Given build dir : \"$build_dir\"" + +echo "Configuring sources... " +cd $build_dir +$source_dir/configure \ + -prefix ${HOME}/local \ + -release -opensource -shared -fast -no-webkit \ + -optimized-qmake -no-framework \ + -confirm-license yes +echo "Configuring sources... done." + +echo "Compiling sources..." +cd $build_dir +make +echo "Compiling sources... done." + +echo "Installing package..." +cd $build_dir +make -j install +echo "Installing package... done." + +## eof - $RCSfile$ diff --git a/third_party_installers/cpPlugins_Install_VTK.sh b/third_party_installers/cpPlugins_Install_VTK.sh new file mode 100755 index 0000000..59c3b8a --- /dev/null +++ b/third_party_installers/cpPlugins_Install_VTK.sh @@ -0,0 +1,107 @@ +#!/bin/bash + +## Some configuration variables +number_of_processes="-j4" + +## Locate cmake executable +cmake_exec="/usr/bin/cmake" +if [ ! -x $cmake_exec ]; then + cmake_exec="/usr/local/bin/cmake" +fi +if [ ! -x $cmake_exec ]; then + cmake_exec="${HOME}/local/bin/cmake" +fi +if [ ! -x $cmake_exec ]; then + echo "$0: modify this script to put the correct location of cmake." + exit 1 +fi + +## Locate qmake executable +cmake_exec="/usr/bin/qmake" +if [ ! -x $cmake_exec ]; then + cmake_exec="/usr/local/bin/qmake" +fi +if [ ! -x $cmake_exec ]; then + cmake_exec="${HOME}/local/bin/qmake" +fi +if [ ! -x $cmake_exec ]; then + echo "$0: modify this script to put the correct location of qmake." + exit 1 +fi + +## Check input parameters and process inputs (if needed) +if [ "$#" -eq 1 ]; then + valid_extensions=("zip" "tar" "tar.gz" "tar.bz2") + actual_ext="" + for ext in ${valid_extensions[@]}; do + if [ `basename $1 $ext` != $1 ]; then + actual_ext=$ext + fi + done + if [ "x$actual_ext" == "x" ]; then + echo "$0: Invalid file type." + exit 1 + fi + canonical_path=`readlink -e $1` + source_dir=`dirname $canonical_path`/`basename $1 .$actual_ext` + build_dir=`dirname $canonical_path`/`basename $1 .$actual_ext`-build + echo -n "Cleaning directories... " + rm -rf $source_dir + rm -rf $build_dir + echo "done." + echo -n "Creating directories... " + mkdir -p $source_dir + mkdir -p $build_dir + echo "done." + echo -n "Extracting sources... " + if [ "$actual_ext" == "zip" ]; then + echo unzip $canonical_path + elif [ "$actual_ext" == "tar" ]; then + tar xf $canonical_path -C $source_dir --strip-components=1 + elif [ "$actual_ext" == "tar.gz" ]; then + tar xzf $canonical_path -C $source_dir --strip-components=1 + elif [ "$actual_ext" == "tar.bz2" ]; then + tar xjf $canonical_path -C $source_dir --strip-components=1 + else + echo "$0: Invalid file type." + exit 1 + fi + echo "done!" +elif [ "$#" -eq 2 ]; then + source_dir=`dirname $1` + build_dir=`dirname $2` +else + echo "Usage: [vtk_package] or [vtk_source_dir vtk_build_dir]" +fi + +echo "Given source dir : \"$source_dir\"" +echo "Given build dir : \"$build_dir\"" + +echo "Configuring sources... " +cd $build_dir +$cmake_exec \ + -DCMAKE_CXX_FLAGS:STRING=-std=c++11 \ + -DBUILD_DOCUMENTATION:BOOL=OFF \ + -DBUILD_EXAMPLES:BOOL=OFF \ + -DBUILD_SHARED_LIBS:BOOL=ON \ + -DBUILD_TESTING:BOOL=OFF \ + -DCMAKE_BUILD_TYPE:STRING=MinSizeRel \ + -DModule_vtkGUISupportQt:BOOL=ON \ + -DModule_vtkGUISupportQtOpenGL:BOOL=ON \ + -DModule_vtkGUISupportQtSQL:BOOL=OFF \ + -DModule_vtkGUISupportQtWebkit:BOOL=OFF \ + -DCMAKE_INSTALL_PREFIX:PATH=${HOME}/local \ + ${source_dir} +echo "Configuring sources... done." + +echo "Compiling sources..." +cd $build_dir +make $number_of_processes +echo "Compiling sources... done." + +echo "Installing package..." +cd $build_dir +make -j install +echo "Installing package... done." + +## eof - $RCSfile$