CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
INCLUDE(cmake/cpPlugins_Policies.cmake)
-## ================
-## = Project name =
-## ================
+## ==================
+## == Project name ==
+## ==================
PROJECT(cpPlugins)
SET(prj_MAJ_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}
${PROJECT_BINARY_DIR}/lib/ItkVtkGlue
)
-## ===========================
-## = Subdirs containing code =
-## ===========================
+## =============================
+## == Subdirs containing code ==
+## =============================
SUBDIRS(
cmake
-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$
-#include <fstream>
-#include <iostream>
-
-#include <algorithm>
-#include <cstring>
+#include <cpPlugins_Config.h>
#include <map>
#include <vector>
#include <sstream>
-#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
} // 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++;
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 )
{
<< "#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 "
<< "# 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;
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 );
}
// -------------------------------------------------------------------------
-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( ) )
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,
+## ============================
+## == 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
)
## ========================
-## -- 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$
# ===================================
-# -- Some configurations variables --
+# == Some configurations variables ==
# ===================================
SET(USE_QT4 "@QT4_FOUND@")
# =======================
-# -- Find dependencies --
+# == Find dependencies ==
# =======================
# Find ITK and VTK
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)
# =========================
-# -- Include directories --
+# == Include directories ==
# =========================
INCLUDE_DIRECTORIES(
)
# =========================
-# -- Library directories --
+# == Library directories ==
# =========================
IF(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
SET(
target_LIBRARIES
- ${cpPlugins_ALL_INSTANCES}
+ ${cpPlugins_LIBRARIES}
cpPlugins_tinyxml2
)
IF(NOT WIN32)
#ifndef __CPPLUGINS_CONFIG__H__
#define __CPPLUGINS_CONFIG__H__
+/*
+ * =========================================================================
+ * ITK related macros
+ * =========================================================================
+ */
#include <itkMacro.h>
-
#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 <windows.h>
+# include <tchar.h>
+#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 <cstring>
+#include <fstream>
+#include <iostream>
+#include <string>
+
+#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$
+++ /dev/null
-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 > >
--- /dev/null
+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$
--- /dev/null
+#include <cpPlugins_Instances_BaseObjects_Export.h>
+#include <cpPlugins_Instances/BaseObjects.h>
+
+/*
+ #include <itkImageRegion.h>
+ #include <itkFixedArray.h>
+ #include <itkPoint.h>
+ #include <itkVariableLengthVector.h>
+ #include <itkVector.h>
+
+ #include <itkImageRegion.hxx>
+ #include <itkFixedArray.hxx>
+ #include <itkPoint.hxx>
+ #include <itkVariableLengthVector.hxx>
+ #include <itkVector.hxx>
+*/
+
+// -------------------------------------------------------------------------
+/* 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$
+++ /dev/null
-#include <cpPlugins_Base_Export.h>
-#include <cpPlugins_Config.h>
-
-#include <itkImageRegion.h>
-#include <itkFixedArray.h>
-#include <itkPoint.h>
-#include <itkVariableLengthVector.h>
-#include <itkVector.h>
-
-#include <itkImageRegion.hxx>
-#include <itkFixedArray.hxx>
-#include <itkPoint.hxx>
-#include <itkVariableLengthVector.hxx>
-#include <itkVector.hxx>
-
-// -------------------------------------------------------------------------
-#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$
+## ============================
+## == 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$
--- /dev/null
+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$
--- /dev/null
+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$
--- /dev/null
+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
-f cpPlugins_Instances/InPlaceImageFiltersBase.h
+f cpPlugins_Instances/ScalarImagesBaseFilters.h
i itkProgressReporter.h
t itkBinaryContourImageFilter.h
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 > >
-f cpPlugins_Instances/ImageFiltersBase.h
+f cpPlugins_Instances/ScalarImagesBaseFilters.h
+f cpPlugins_Instances/VectorImages.h
t cpExtensions/Algorithms/MultiScaleGaussianImageFilter.h
t itkGradientRecursiveGaussianImageFilter.h
+++ /dev/null
-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 >
+++ /dev/null
-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 > >
+++ /dev/null
-b #include <ITKIOImageBaseExport.h>
-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 > >
-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
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$
+++ /dev/null
-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 > > >
-f cpPlugins_Instances/Image.h
+f cpPlugins_Instances/ScalarImages.h
f cpPlugins_Instances/Mesh.h
t itkTriangleMeshToBinaryImageFilter.h
--- /dev/null
+b #include <ITKIOImageBaseExport.h>
+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$
+++ /dev/null
-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 > >
-f cpPlugins_Instances/Base.h
+f cpPlugins_Instances/BaseObjects.h
d #dims=2;3
d #float=float;double
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$
--- /dev/null
+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 > > >
-f cpPlugins_Instances/Base.h
+f cpPlugins_Instances/BaseObjects.h
i cpExtensions/DataStructures/PolyLineParametricPath.h
i cpExtensions/DataStructures/ImageIndexesContainer.h
c cpExtensions::Visualization::PolyLineParametricPathToPolyData< cpExtensions::DataStructures::PolyLineParametricPath< #dims > >
c cpExtensions::Visualization::ImageIndexesContainerToPolyData< cpExtensions::DataStructures::ImageIndexesContainer< #dims > >
+* eof - $RCSfile$
-f cpPlugins_Instances/ImageFiltersBase.h
+f cpPlugins_Instances/ScalarImagesBaseFilters.h
f cpPlugins_Instances/Transforms.h
t itkResampleImageFilter.h
--- /dev/null
+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$
--- /dev/null
+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$
--- /dev/null
+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$
-f cpPlugins_Instances/InPlaceImageFiltersBase.h
+f cpPlugins_Instances/ScalarImagesBaseFilters.h
t itkBinaryThresholdImageFilter.h
t itkUnaryFunctorImageFilter.h
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 > >
-f cpPlugins_Instances/Base.h
+f cpPlugins_Instances/BaseObjects.h
d #dims=2;3
d #float=float;double
c itk::OptimizerParameters< #float >
c itk::Transform< #float, #dims, #dims >
c itk::DataObjectDecorator< itk::Transform< #float, #dims, #dims > >
+
+* eof - $RCSfile$
--- /dev/null
+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$
SET(
target_LIBRARIES
- cpPlugins
+ ${cpPlugins_LIBRARIES}
)
## =====================
#include <QVBoxLayout>
#include <cpPlugins/ParametersQtDialog.h>
-#include <cpPlugins_Instances/ImageIO.h>
+#include <cpPlugins_Instances/ImagesIO.h>
+#include <itkGDCMSeriesFileNames.h>
/**
*/
#include <cpPluginsIO/ImageReader.h>
#include <cpPlugins/Image.h>
-#include <cpPlugins_Instances/ImageIO.h>
+#include <cpPlugins_Instances/ImagesIO.h>
+#include <itkImageIOFactory.h>
// -------------------------------------------------------------------------
cpPluginsIO::ImageReader::
#include <cpPluginsIO/ImageWriter.h>
#include <cpPlugins/Image.h>
-#include <cpPlugins_Instances/ImageIO.h>
+#include <cpPlugins_Instances/ImagesIO.h>
// -------------------------------------------------------------------------
cpPluginsIO::ImageWriter::
SET(
target_LIBRARIES
- cpPlugins
+ ${cpPlugins_LIBRARIES}
)
## =====================
SET(
target_LIBRARIES
cpExtensions
- cpPlugins
+ ${cpPlugins_LIBRARIES}
)
## =====================
SET(
target_LIBRARIES
cpExtensions
- cpPlugins
+ ${cpPlugins_LIBRARIES}
)
## =====================
SET(
target_LIBRARIES
cpExtensions
- cpPlugins
+ ${cpPlugins_LIBRARIES}
)
## =====================
--- /dev/null
+#!/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$
--- /dev/null
+#!/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$
--- /dev/null
+#!/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$