]> Creatis software - cpPlugins.git/commitdiff
Raster filter added. Compilation issues on macos solved.
authorLeonardo Florez <leonardo@iMac-de-Andrea.local>
Fri, 8 Apr 2016 13:35:22 +0000 (08:35 -0500)
committerLeonardo Florez <leonardo@iMac-de-Andrea.local>
Fri, 8 Apr 2016 13:35:22 +0000 (08:35 -0500)
16 files changed:
appli/bash/cpPlugins_CreateInstances.cxx
lib/cpExtensions/Algorithms/KalmanConstantFilter.h
lib/cpExtensions/Algorithms/KalmanVelocityFilter.h
lib/cpPlugins_Instances/Base.i
lib/cpPlugins_Instances/Base_extra.cxx
lib/cpPlugins_Instances/CMakeLists.txt
lib/cpPlugins_Instances/ImageIterators.i
lib/cpPlugins_Instances/ImageMeshFilters.i [new file with mode: 0644]
lib/cpPlugins_Instances/Mesh.i
plugins/CMakeLists.txt
plugins/cpPluginsImageMeshFilters/TriangleMeshToBinaryImageFilter.cxx
plugins/cpPluginsVisualization/CMakeLists.txt [deleted file]
plugins/cpPluginsVisualization/IndexesToPolyData.cxx [deleted file]
plugins/cpPluginsVisualization/IndexesToPolyData.h [deleted file]
plugins/cpPluginsVisualization/PolyLineParametricPathToPolyData.cxx [deleted file]
plugins/cpPluginsVisualization/PolyLineParametricPathToPolyData.h [deleted file]

index b83bdce5601ff343a390f3e4e2ef88519c2f2dec..edb8e61e627d873152580f96eee1f9834fd76953 100644 (file)
@@ -292,7 +292,7 @@ void ExpandVariables( TLines& res, const TLines& lines, const TVariables& vars )
     auto b_pos = lIt->find( "#" );
     if( b_pos != std::string::npos )
     {
-      auto tokens = Tokenize( lIt->substr( b_pos ), " ,;:{}[]()\"$&<>" );
+      auto tokens = Tokenize( lIt->substr( b_pos ), " ,;:{}[]()\"$&<>*" );
       std::string cmd = tokens[ 0 ];
       auto vIt = vars.find( cmd );
       if( vIt != vars.end( ) )
index 860a8f3f1cf3b3ec788689a14bf410f865b3d22e..ce038e1c7a7cfde0fea14b63dad5e127301ee461 100644 (file)
@@ -35,7 +35,7 @@ namespace cpExtensions
       void Configure( unsigned int m );
 
       // Iteration methods
-      virtual void Initialize( );
+      virtual void Initialize( ) ITK_OVERRIDE;
 
     protected:
       KalmanConstantFilter( );
index 2e3af98c6409dda6c1aa2a838b749b00a900881d..781e9117d19137368213b225c25fc5794c9d35ad 100644 (file)
@@ -41,7 +41,7 @@ namespace cpExtensions
       void SetTimeOffset( TScalar t );
 
       /// Iteration methods
-      virtual void Initialize( );
+      virtual void Initialize( ) ITK_OVERRIDE;
 
     protected:
         KalmanVelocityFilter( );
index 8a7e94643ac9e16c65bf7443da5414bfa3ae24eb..544c58c934b714eac8dc6aa42c23dadef36fe5f9 100644 (file)
@@ -2,6 +2,7 @@ f cpPlugins_Config.h
 
 t itkArray.h
 t itkArray2D.h
+t itkBoundingBox.h
 t itkCovariantVector.h
 t itkDiffusionTensor3D.h
 t itkFixedArray.h
@@ -22,12 +23,14 @@ 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}< #float >
+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 > >
\ No newline at end of file
+c itk::VectorContainer< unsigned long, itk::Point< #float, #dims > >
+c itk::BoundingBox< unsigned long, #dims, #float, itk::VectorContainer< unsigned long, itk::Point< #float, #dims > > >
index e0b72342595304457c755427327bb3ba9e74d63b..b3b33f5ab3acdea54203cbb30cad9854cc048728 100644 (file)
@@ -59,5 +59,7 @@ cpPlugins_Base_extra_Array_AllScalars_AllDims( itk::Vector );
 
 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$
index f040a22975d3f7e4d962b1e2a5a6e2b6e00902b0..175ee4051297b5d73484672e20adcd00caaafcd6 100644 (file)
@@ -46,19 +46,19 @@ SET(
 ## Target links
 TARGET_LINK_LIBRARIES(cpPlugins_Base ${ITK_LIBRARIES})
 TARGET_LINK_LIBRARIES(cpPlugins_Transforms ${ITK_LIBRARIES} cpPlugins_Base)
-TARGET_LINK_LIBRARIES(cpPlugins_Paths cpPlugins_Base ${VTK_LIBRARIES})
 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)
+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
index 29f4bc8b6872c0ca7fbccfdb6fe14c177e7c15a2..f815b214ee215d3aa7098e2dd85f71c682b01072 100644 (file)
@@ -33,6 +33,7 @@ d #iterators=itk::ImageRegionConstIterator;itk::ImageRegionIterator;itk::ImageCo
 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 > >
diff --git a/lib/cpPlugins_Instances/ImageMeshFilters.i b/lib/cpPlugins_Instances/ImageMeshFilters.i
new file mode 100644 (file)
index 0000000..f15e51b
--- /dev/null
@@ -0,0 +1,12 @@
+f cpPlugins_Instances/Image.h
+f cpPlugins_Instances/Mesh.h
+
+t itkTriangleMeshToBinaryImageFilter.h
+
+d #dims=3
+d #int=char;short;int;long
+d #uint=unsigned #int
+d #pixels=#int;#uint
+d #float=float;double
+
+c itk::TriangleMeshToBinaryImageFilter< itk::Mesh< #float, #dims >, itk::Image< #pixels, #dims > >
index bd0b0c403206d501e8e8cbb0615165346a485794..86da8ea36bbfa99dfbe6f60f2dfc3785c05ab901 100644 (file)
@@ -3,12 +3,15 @@ f cpPlugins_Instances/Base.h
 d #dims=2;3
 d #float=float;double
 
+i set
+t itkCellInterface.h
 t itkMesh.h
 t itkPointSet.h
 t itkBoundingBox.h
 t itkMapContainer.h
 t itkVectorContainer.h
 
+c 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::VectorContainer< unsigned long, 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 >
 
index 0d25544bafb270abc3d8d07d334e72eecea75ef5..a62392d765b27ce86fe583735ae5e05d6f9d3207 100644 (file)
@@ -1,6 +1,8 @@
 SUBDIRS(
   cpPluginsIO
   cpPluginsImageFilters
+  cpPluginsMeshFilters
+  cpPluginsImageMeshFilters
   cpPluginsWidgets
   )
 
index 7e223a9cd83f390837a5111d459167d90f7617ed..11bb178f137ff6fd93985d5adebb4a6bff0734a9 100644 (file)
@@ -2,8 +2,7 @@
 #include <cpPlugins/Image.h>
 #include <cpPlugins/Mesh.h>
 
-#include <itkTriangleMeshToBinaryImageFilter.h>
-#include <itkTriangleMeshToBinaryImageFilter.hxx>
+#include <cpPlugins_Instances/ImageMeshFilters.h>
 
 // -------------------------------------------------------------------------
 cpPluginsImageMeshFilters::TriangleMeshToBinaryImageFilter::
diff --git a/plugins/cpPluginsVisualization/CMakeLists.txt b/plugins/cpPluginsVisualization/CMakeLists.txt
deleted file mode 100644 (file)
index 14ab446..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-SET(lib_NAME cpPluginsVisualization)
-SET(lib_DIR  cpPluginsVisualization)
-
-## ===============
-## = Source code =
-## ===============
-
-FILE(GLOB lib_HEADERS_H   "*.h")
-FILE(GLOB lib_HEADERS_HPP "*.hpp")
-FILE(GLOB lib_HEADERS_HXX "*.hxx")
-FILE(GLOB lib_SOURCES_C   "*.c")
-FILE(GLOB lib_SOURCES_CPP "*.cpp")
-FILE(GLOB lib_SOURCES_CXX "*.cxx")
-
-# ===================================
-# = Integrate all source file names =
-# ===================================
-
-SET(
-  lib_HEADERS
-  ${lib_HEADERS_H}
-  ${lib_HEADERS_HPP}
-  ${lib_HEADERS_HXX}
-  )
-
-SET(
-  lib_SOURCES
-  ${lib_SOURCES_C}
-  ${lib_SOURCES_CPP}
-  ${lib_SOURCES_CXX}
-  )
-
-SET(
-  target_LIBRARIES
-  cpExtensions
-  cpPlugins
-  )
-
-## =====================
-## = Compilation rules =
-## =====================
-
-ADD_CUSTOM_COMMAND(
-  OUTPUT ${lib_NAME}_Host.cxx
-  DEPENDS cpPlugins_HostCreator ${LIB_HEADERS_H}
-  COMMAND cpPlugins_HostCreator ${lib_NAME}_Host.cxx ${lib_HEADERS_H}
-  )
-ADD_LIBRARY(${lib_NAME} SHARED ${lib_NAME}_Host.cxx ${lib_SOURCES})
-SET_TARGET_PROPERTIES(
-  ${lib_NAME} PROPERTIES
-  VERSION "${prj_VER}"
-  SOVERSION "${prj_sVER}"
-  )
-GENERATE_EXPORT_HEADER(
-  ${lib_NAME}
-  BASE_NAME ${lib_NAME}
-  EXPORT_MACRO_NAME ${lib_NAME}_EXPORT
-  EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/plugins/${lib_DIR}/${lib_NAME}_Export.h
-  STATIC_DEFINE ${lib_NAME}_BUILT_AS_STATIC
-  )
-TARGET_LINK_LIBRARIES(${lib_NAME} ${target_LIBRARIES})
-
-## ========================
-## -- Installation rules --
-## ========================
-
-INSTALL(
-  TARGETS ${lib_NAME}
-  RUNTIME DESTINATION bin
-  LIBRARY DESTINATION lib
-  ARCHIVE DESTINATION lib/static
-  )
-
-## eof - $RCSfile$
diff --git a/plugins/cpPluginsVisualization/IndexesToPolyData.cxx b/plugins/cpPluginsVisualization/IndexesToPolyData.cxx
deleted file mode 100644 (file)
index 9e4b65c..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#include <cpPluginsVisualization/IndexesToPolyData.h>
-#include <cpPlugins/Image.h>
-#include <cpPlugins/Mesh.h>
-
-#include <cpExtensions/Visualization/IndexesToPolyData.h>
-#include <cpExtensions/Visualization/IndexesToPolyData.hxx>
-
-// -------------------------------------------------------------------------
-cpPluginsVisualization::IndexesToPolyData::
-IndexesToPolyData( )
-  : Superclass( )
-{
-  this->_AddInput( "Input" );
-  this->_AddInput( "ReferenceImage", false );
-  this->_AddOutput< cpPlugins::Mesh >( "Output" );
-}
-
-// -------------------------------------------------------------------------
-cpPluginsVisualization::IndexesToPolyData::
-~IndexesToPolyData( )
-{
-}
-
-// -------------------------------------------------------------------------
-std::string cpPluginsVisualization::IndexesToPolyData::
-_GenerateData( )
-{
-  typedef itk::SimpleDataObjectDecorator< std::vector< itk::Index< 2 > > > _2D;
-  typedef itk::SimpleDataObjectDecorator< std::vector< itk::Index< 3 > > > _3D;
-
-  auto indexes = this->GetInputData( "Input" )->GetITK< itk::DataObject >( );
-  auto indexes2D = dynamic_cast< _2D* >( indexes );
-  auto indexes3D = dynamic_cast< _3D* >( indexes );
-  if( indexes2D != NULL )
-    return( this->_GD0( indexes2D ) );
-  else if( indexes3D != NULL )
-    return( this->_GD0( indexes3D ) );
-  else
-    return( "cpPluginsVisualization::IndexesToPolyData: no valid input." );
-}
-
-// -------------------------------------------------------------------------
-template< class _TIndexes >
-std::string cpPluginsVisualization::IndexesToPolyData::
-_GD0( _TIndexes* indexes )
-{
-  typedef
-    cpExtensions::Visualization::IndexesToPolyData< _TIndexes >
-    _TFilter;
-  typedef typename _TFilter::TImage _TImage;
-
-  // Configure filter
-  _TFilter* filter = this->_CreateVTK< _TFilter >( );
-  filter->SetInput( indexes );
-  filter->SetReferenceImage(
-    this->GetInputData( "Input" )->GetITK< _TImage >( )
-    );
-  filter->Update( );
-
-  // Connect output
-  this->GetOutputData( "Output" )->SetVTK( filter->GetOutput( ) );
-  return( "" );
-}
-
-// eof - $RCSfile$
diff --git a/plugins/cpPluginsVisualization/IndexesToPolyData.h b/plugins/cpPluginsVisualization/IndexesToPolyData.h
deleted file mode 100644 (file)
index ff4bb7d..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef __CPPLUGINSVISUALIZATION__INDEXESTOPOLYDATA__H__
-#define __CPPLUGINSVISUALIZATION__INDEXESTOPOLYDATA__H__
-
-#include <plugins/cpPluginsVisualization/cpPluginsVisualization_Export.h>
-#include <cpPlugins/ProcessObject.h>
-
-namespace cpPluginsVisualization
-{
-  /**
-   */
-  class cpPluginsVisualization_EXPORT IndexesToPolyData
-    : public cpPlugins::ProcessObject
-  {
-  public:
-    typedef IndexesToPolyData               Self;
-    typedef cpPlugins::ProcessObject        Superclass;
-    typedef itk::SmartPointer< Self >       Pointer;
-    typedef itk::SmartPointer< const Self > ConstPointer;
-
-  public:
-    itkNewMacro( Self );
-    itkTypeMacro( IndexesToPolyData, cpPlugins::ProcessObject );
-    cpPlugins_Id_Macro( IndexesToPolyData, Visualization );
-
-  protected:
-    IndexesToPolyData( );
-    virtual ~IndexesToPolyData( );
-
-    virtual std::string _GenerateData( ) ITK_OVERRIDE;
-
-    template< class _TIndexes >
-      inline std::string _GD0( _TIndexes* path );
-
-  private:
-    // Purposely not implemented
-    IndexesToPolyData( const Self& );
-    Self& operator=( const Self& );
-  };
-
-} // ecapseman
-
-#endif // __CPPLUGINSVISUALIZATION__INDEXESTOPOLYDATA__H__
-
-// eof - $RCSfile$
diff --git a/plugins/cpPluginsVisualization/PolyLineParametricPathToPolyData.cxx b/plugins/cpPluginsVisualization/PolyLineParametricPathToPolyData.cxx
deleted file mode 100644 (file)
index f41839b..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#include <cpPluginsVisualization/PolyLineParametricPathToPolyData.h>
-#include <cpPlugins/Mesh.h>
-
-#include <cpExtensions/Visualization/PolyLineParametricPathToPolyData.h>
-#include <cpExtensions/Visualization/PolyLineParametricPathToPolyData.hxx>
-#include <itkPolyLineParametricPath.h>
-
-// -------------------------------------------------------------------------
-cpPluginsVisualization::PolyLineParametricPathToPolyData::
-PolyLineParametricPathToPolyData( )
-  : Superclass( )
-{
-  this->_AddInput( "Input" );
-  this->_AddInput( "ReferenceImage", false );
-  this->_AddOutput< cpPlugins::Mesh >( "Output" );
-}
-
-// -------------------------------------------------------------------------
-cpPluginsVisualization::PolyLineParametricPathToPolyData::
-~PolyLineParametricPathToPolyData( )
-{
-}
-
-// -------------------------------------------------------------------------
-std::string cpPluginsVisualization::PolyLineParametricPathToPolyData::
-_GenerateData( )
-{
-  typedef itk::PolyLineParametricPath< 2 > _2DPath;
-  typedef itk::PolyLineParametricPath< 3 > _3DPath;
-
-  auto path = this->GetInputData( "Input" )->GetITK< itk::DataObject >( );
-  auto path2D = dynamic_cast< _2DPath* >( path );
-  auto path3D = dynamic_cast< _3DPath* >( path );
-  if( path2D != NULL )
-    return( this->_GD0( path2D ) );
-  else if( path3D != NULL )
-    return( this->_GD0( path3D ) );
-  else
-    return( "cpPluginsVisualization::PolyLineParametricPathToPolyData: no valid input." );
-}
-
-// -------------------------------------------------------------------------
-template< class _TPath >
-std::string cpPluginsVisualization::PolyLineParametricPathToPolyData::
-_GD0( _TPath* path )
-{
-  typedef
-    cpExtensions::Visualization::PolyLineParametricPathToPolyData< _TPath >
-    _TFilter;
-  typedef typename _TFilter::TImage _TImage;
-
-  // Configure filter
-  _TFilter* filter = this->_CreateVTK< _TFilter >( );
-  filter->SetInput( path );
-  filter->SetReferenceImage(
-    this->GetInputData( "Input" )->GetITK< _TImage >( )
-    );
-  filter->Update( );
-
-  // Connect output
-  this->GetOutputData( "Output" )->SetVTK( filter->GetOutput( ) );
-  return( "" );
-}
-
-// eof - $RCSfile$
diff --git a/plugins/cpPluginsVisualization/PolyLineParametricPathToPolyData.h b/plugins/cpPluginsVisualization/PolyLineParametricPathToPolyData.h
deleted file mode 100644 (file)
index bf549c8..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#ifndef __CPPLUGINSVISUALIZATION__POLYLINEPARAMETRICPATHTOPOLYDATA__H__
-#define __CPPLUGINSVISUALIZATION__POLYLINEPARAMETRICPATHTOPOLYDATA__H__
-
-#include <plugins/cpPluginsVisualization/cpPluginsVisualization_Export.h>
-#include <cpPlugins/ProcessObject.h>
-
-namespace cpPluginsVisualization
-{
-  /**
-   */
-  class cpPluginsVisualization_EXPORT PolyLineParametricPathToPolyData
-    : public cpPlugins::ProcessObject
-  {
-  public:
-    typedef PolyLineParametricPathToPolyData      Self;
-    typedef cpPlugins::ProcessObject        Superclass;
-    typedef itk::SmartPointer< Self >       Pointer;
-    typedef itk::SmartPointer< const Self > ConstPointer;
-
-  public:
-    itkNewMacro( Self );
-    itkTypeMacro( PolyLineParametricPathToPolyData, cpPlugins::ProcessObject );
-    cpPlugins_Id_Macro( PolyLineParametricPathToPolyData, Visualization );
-
-  protected:
-    PolyLineParametricPathToPolyData( );
-    virtual ~PolyLineParametricPathToPolyData( );
-
-    virtual std::string _GenerateData( ) ITK_OVERRIDE;
-
-    template< class _TPath >
-      inline std::string _GD0( _TPath* path );
-
-    /* TODO
-       template< class _TImage, class _TBinaryPixel >
-       inline std::string _GD1( _TImage* image );
-    */
-
-  private:
-    // Purposely not implemented
-    PolyLineParametricPathToPolyData( const Self& );
-    Self& operator=( const Self& );
-  };
-
-} // ecapseman
-
-#endif // __CPPLUGINSVISUALIZATION__POLYLINEPARAMETRICPATHTOPOLYDATA__H__
-
-// eof - $RCSfile$