]> Creatis software - cpPlugins.git/commitdiff
Complex graph representation as branches: 1/3. Windows compil: 2/3
authorLeonardo Flórez-Valencia <florez-l@javeriana.edu.co>
Thu, 6 Oct 2016 22:59:57 +0000 (17:59 -0500)
committerLeonardo Flórez-Valencia <florez-l@javeriana.edu.co>
Thu, 6 Oct 2016 22:59:57 +0000 (17:59 -0500)
lib/Instances/CMakeLists.txt
lib/Instances/cpPlugins_Paths.i [new file with mode: 0644]
lib/cpExtensions/DataStructures/PolyLineParametricPath.h
lib/cpExtensions/DataStructures/PolyLineParametricPath.hxx [new file with mode: 0644]
lib/cpExtensions/Visualization/PolyLineParametricPathToPolyData.cxx [new file with mode: 0644]
lib/cpExtensions/Visualization/PolyLineParametricPathToPolyData.h
lib/cpExtensions/Visualization/PolyLineParametricPathToPolyData.hxx [deleted file]
lib/cpPlugins/DataObjects/PolyLineParametricPath.cxx [new file with mode: 0644]
lib/cpPlugins/DataObjects/PolyLineParametricPath.h [new file with mode: 0644]

index 642913512e33705451a0bc2b0ceebaed8af9e14d..a32d683216358fdfc48805cfea27a474645d4733 100644 (file)
@@ -28,5 +28,6 @@ TARGET_LINK_LIBRARIES(${_pfx}Meshes ${_pfx}BoundingBoxes)
 TARGET_LINK_LIBRARIES(${_pfx}ImageIterators ${_pfx}Images)
 TARGET_LINK_LIBRARIES(${_pfx}ImageFilters ${_pfx}Images ${_pfx}ImageIterators)
 TARGET_LINK_LIBRARIES(${_pfx}ImageNeighborhoodIterators ${_pfx}Images)
+TARGET_LINK_LIBRARIES(${_pfx}Paths ${_pfx}Images)
 
 ## eof - $RCSfile$
diff --git a/lib/Instances/cpPlugins_Paths.i b/lib/Instances/cpPlugins_Paths.i
new file mode 100644 (file)
index 0000000..2b8c8a8
--- /dev/null
@@ -0,0 +1,29 @@
+** ======================
+** == Some definitions ==
+** ======================
+
+** ==============
+** == Includes ==
+** ==============
+
+i cpPlugins_Images.h
+t cpExtensions/DataStructures/PolyLineParametricPath
+t itkPath
+t itkParametricPath
+t itkPolyLineParametricPath
+t itkVectorContainer
+
+** ==================
+** == Dependencies ==
+** ==================
+
+** ===============
+** == Instances ==
+** ===============
+
+c itk::Path< double, itk::ContinuousIndex< double, #process_dims# >, #process_dims# >
+c itk::ParametricPath< #process_dims# >
+c itk::PolyLineParametricPath< #process_dims# >
+c cpExtensions::DataStructures::PolyLineParametricPath< #process_dims# >
+
+** eof - $RCSfile$
index b2e1c77808c68c1ce9d384fbd9d667dfd92780fb..e8046eac90e76207393d1dcd66ed2e837d6761d0 100644 (file)
@@ -20,29 +20,48 @@ namespace cpExtensions
       typedef itk::SmartPointer< Self >            Pointer;
       typedef itk::SmartPointer< const Self >      ConstPointer;
 
-      typedef itk::ImageBase< _VDim > TImageBase;
+      typedef itk::ImageBase< _VDim >                  TImageBase;
+      typedef typename TImageBase::SpacingType         TSpacing;
+      typedef typename TImageBase::PointType           TPoint;
+      typedef typename TImageBase::DirectionType       TDirection;
+      typedef typename Superclass::ContinuousIndexType TContinuousIndex;
 
     public:
       itkNewMacro( Self );
       itkTypeMacro( PolyLineParametricPath, itk::PolyLineParametricPath );
 
+      itkGetConstReferenceMacro( Spacing, TSpacing );
+      itkGetConstReferenceMacro( Origin, TPoint );
+      itkGetConstReferenceMacro( Direction, TDirection );
+      itkGetConstReferenceMacro( InverseDirection, TDirection );
+
+      itkSetMacro( Origin, TPoint );
+
     public:
-      TImageBase* GetReferenceImage( )
-        { return( this->m_ReferenceImage ); }
-      const TImageBase* GetReferenceImage( ) const
-        { return( this->m_ReferenceImage ); }
-      void SetReferenceImage( const TImageBase* image )
+      unsigned long GetSize( ) const;
+      TContinuousIndex GetVertex( unsigned long i ) const;
+      TPoint GetPoint( unsigned long i ) const;
+
+      virtual void SetSpacing( const TSpacing& spac );
+      virtual void SetSpacing( const double spac[ _VDim ] );
+      virtual void SetSpacing( const float spac[ _VDim ] );
+      virtual void SetOrigin( const double ori[ _VDim ] );
+      virtual void SetOrigin( const float ori[ _VDim ] );
+      virtual void SetDirection( const TDirection& dir );
+
+      template< class _TRefImage >
+      inline void SetReferenceImage( const _TRefImage* image )
         {
-          this->m_ReferenceImage = TImageBase::New( );
-          this->m_ReferenceImage->SetDirection( image->GetDirection( ) );
-          this->m_ReferenceImage->SetOrigin( image->GetOrigin( ) );
-          this->m_ReferenceImage->SetSpacing( image->GetSpacing( ) );
-          this->Modified( );
+          this->SetSpacing( image->GetSpacing( ) );
+          this->SetOrigin( image->GetOrigin( ) );
+          this->SetDirection( image->GetDirection( ) );
         }
 
     protected:
-      PolyLineParametricPath( )          { }
-      virtual ~PolyLineParametricPath( ) { }
+      PolyLineParametricPath( );
+      virtual ~PolyLineParametricPath( );
+
+      virtual void _ComputeIndexToPhysicalPointMatrices( );
 
     private:
       // Purposely not implemented
@@ -50,14 +69,22 @@ namespace cpExtensions
       Self& operator=( const Self& other );
 
     protected:
-      typename TImageBase::Pointer m_ReferenceImage;
+      TSpacing   m_Spacing;
+      TPoint     m_Origin;
+      TDirection m_Direction;
+      TDirection m_InverseDirection;
+      TDirection m_IndexToPhysicalPoint;
+      TDirection m_PhysicalPointToIndex;
     };
 
   } // ecapseman
 
 } // ecapseman
 
-#endif // __cpExtensions__DataStructures__PolyLineParametricPath__h__
+#ifndef ITK_MANUAL_INSTANTIATION
+#  include <cpExtensions/DataStructures/PolyLineParametricPath.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
 
+#endif // __cpExtensions__DataStructures__PolyLineParametricPath__h__
 
 // eof - $RCSfile$
diff --git a/lib/cpExtensions/DataStructures/PolyLineParametricPath.hxx b/lib/cpExtensions/DataStructures/PolyLineParametricPath.hxx
new file mode 100644 (file)
index 0000000..306ab79
--- /dev/null
@@ -0,0 +1,176 @@
+#ifndef __cpExtensions__DataStructures__PolyLineParametricPath__hxx__
+#define __cpExtensions__DataStructures__PolyLineParametricPath__hxx__
+
+#include <itkMath.h>
+#include <itkNumericTraits.h>
+
+// -------------------------------------------------------------------------
+template< unsigned int _VDim >
+unsigned long cpExtensions::DataStructures::PolyLineParametricPath< _VDim >::
+GetSize( ) const
+{
+  return( this->GetVertexList( )->Size( ) );
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int _VDim >
+typename cpExtensions::DataStructures::PolyLineParametricPath< _VDim >::
+TContinuousIndex
+cpExtensions::DataStructures::PolyLineParametricPath< _VDim >::
+GetVertex( unsigned long i ) const
+{
+  return( this->GetVertexList( )->GetElement( i ) );
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int _VDim >
+typename cpExtensions::DataStructures::PolyLineParametricPath< _VDim >::
+TPoint cpExtensions::DataStructures::PolyLineParametricPath< _VDim >::
+GetPoint( unsigned long i ) const
+{
+  typedef typename TPoint::CoordRepType _TCoordRep;
+  TPoint pnt;
+  TContinuousIndex idx = this->GetVertex( i );
+  for( unsigned int r = 0; r < _VDim; ++r )
+  {
+    _TCoordRep sum = itk::NumericTraits< _TCoordRep >::ZeroValue( );
+    for( unsigned int c = 0; c < _VDim; ++c )
+      sum += this->m_IndexToPhysicalPoint( r, c ) * idx[ c ];
+    pnt[ r ] = sum + this->m_Origin[ r ];
+
+  } // rof
+  return( pnt );
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int _VDim >
+void cpExtensions::DataStructures::PolyLineParametricPath< _VDim >::
+SetSpacing( const TSpacing& spac )
+{
+  if( this->m_Spacing != spac )
+  {
+    this->m_Spacing = spac;
+    this->_ComputeIndexToPhysicalPointMatrices( );
+    this->Modified( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int _VDim >
+void cpExtensions::DataStructures::PolyLineParametricPath< _VDim >::
+SetSpacing( const double spac[ _VDim ] )
+{
+  this->SetSpacing( TSpacing( spac ) );
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int _VDim >
+void cpExtensions::DataStructures::PolyLineParametricPath< _VDim >::
+SetSpacing( const float spac[ _VDim ] )
+{
+  TSpacing s;
+  for( unsigned int d = 0; d < _VDim; ++d )
+    s[ d ] = spac[ d ];
+  this->SetSpacing( s );
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int _VDim >
+void cpExtensions::DataStructures::PolyLineParametricPath< _VDim >::
+SetOrigin( const double ori[ _VDim ] )
+{
+  this->SetOrigin( TPoint( ori ) );
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int _VDim >
+void cpExtensions::DataStructures::PolyLineParametricPath< _VDim >::
+SetOrigin( const float ori[ _VDim ] )
+{
+  this->SetOrigin( TPoint( ori ) );
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int _VDim >
+void cpExtensions::DataStructures::PolyLineParametricPath< _VDim >::
+SetDirection( const TDirection& dir )
+{
+  bool modified = false;
+  for( unsigned int r = 0; r < _VDim; r++ )
+  {
+    for( unsigned int c = 0; c < _VDim; c++ )
+    {
+      if(
+        itk::Math::NotExactlyEquals(
+          this->m_Direction[ r ][ c ], dir[ r ][ c ]
+          )
+        )
+      {
+        this->m_Direction[ r ][ c ] = dir[ r ][ c ];
+        modified = true;
+      } // fi
+
+    } // rof
+
+  } // rof
+  if( modified )
+  {
+    this->_ComputeIndexToPhysicalPointMatrices( );
+    this->m_InverseDirection = this->m_Direction.GetInverse( );
+    this->Modified( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int _VDim >
+cpExtensions::DataStructures::PolyLineParametricPath< _VDim >::
+PolyLineParametricPath( )
+  : Superclass( )
+{
+  this->m_Spacing.Fill( 1.0 );
+  this->m_Origin.Fill( 0.0 );
+  this->m_Direction.SetIdentity( );
+  this->m_InverseDirection.SetIdentity( );
+  this->m_IndexToPhysicalPoint.SetIdentity( );
+  this->m_PhysicalPointToIndex.SetIdentity( );
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int _VDim >
+cpExtensions::DataStructures::PolyLineParametricPath< _VDim >::
+~PolyLineParametricPath( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int _VDim >
+void cpExtensions::DataStructures::PolyLineParametricPath< _VDim >::
+_ComputeIndexToPhysicalPointMatrices( )
+{
+  TDirection scale;
+  scale.Fill( 0.0 );
+  for( unsigned int i = 0; i < _VDim; i++ )
+  {
+    if( this->m_Spacing[ i ] == 0.0 )
+      itkExceptionMacro(
+        "A spacing of 0 is not allowed: Spacing is " << this->m_Spacing
+        );
+    scale[ i ][ i ] = this->m_Spacing[ i ];
+
+  } // rof
+
+  if( vnl_determinant( this->m_Direction.GetVnlMatrix( ) ) == 0.0 )
+    itkExceptionMacro(
+      << "Bad direction, determinant is 0. Direction is "
+      << this->m_Direction
+      );
+  this->m_IndexToPhysicalPoint = this->m_Direction * scale;
+  this->m_PhysicalPointToIndex = this->m_IndexToPhysicalPoint.GetInverse( );
+  this->Modified( );
+}
+
+#endif // __cpExtensions__DataStructures__PolyLineParametricPath__hxx__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Visualization/PolyLineParametricPathToPolyData.cxx b/lib/cpExtensions/Visualization/PolyLineParametricPathToPolyData.cxx
new file mode 100644 (file)
index 0000000..c97fac7
--- /dev/null
@@ -0,0 +1,131 @@
+#include <cpExtensions/Visualization/PolyLineParametricPathToPolyData.h>
+
+#include <vtkCellArray.h>
+#include <vtkInformation.h>
+#include <vtkInformationVector.h>
+#include <vtkSmartPointer.h>
+
+// -------------------------------------------------------------------------
+template< class _TPolyLine >
+typename
+cpExtensions::Visualization::PolyLineParametricPathToPolyData< _TPolyLine >::
+Self*
+cpExtensions::Visualization::PolyLineParametricPathToPolyData< _TPolyLine >::
+New( )
+{
+  return( new Self( ) );
+}
+
+// -------------------------------------------------------------------------
+template< class _TPolyLine >
+const typename
+cpExtensions::Visualization::PolyLineParametricPathToPolyData< _TPolyLine >::
+TPolyLine*
+cpExtensions::Visualization::PolyLineParametricPathToPolyData< _TPolyLine >::
+GetInput( ) const
+{
+  return( this->m_PolyLine );
+}
+
+// -------------------------------------------------------------------------
+template< class _TPolyLine >
+void
+cpExtensions::Visualization::PolyLineParametricPathToPolyData< _TPolyLine >::
+SetInput( const TPolyLine* pl )
+{
+  if( this->m_PolyLine != pl )
+  {
+    this->m_PolyLine = pl;
+    this->Modified( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+template< class _TPolyLine >
+cpExtensions::Visualization::PolyLineParametricPathToPolyData< _TPolyLine >::
+PolyLineParametricPathToPolyData( )
+  : vtkPolyDataAlgorithm( ),
+    m_PolyLine( NULL )
+{
+  this->SetNumberOfInputPorts( 0 );
+}
+
+// -------------------------------------------------------------------------
+template< class _TPolyLine >
+cpExtensions::Visualization::PolyLineParametricPathToPolyData< _TPolyLine >::
+~PolyLineParametricPathToPolyData( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class _TPolyLine >
+int
+cpExtensions::Visualization::PolyLineParametricPathToPolyData< _TPolyLine >::
+RequestData(
+  vtkInformation* information,
+  vtkInformationVector** input,
+  vtkInformationVector* output
+  )
+{
+  static const unsigned int dim = _TPolyLine::PathDimension;
+
+  if( this->m_PolyLine == NULL )
+    return( 0 );
+
+  // Get output
+  vtkInformation* info = output->GetInformationObject( 0 );
+  vtkPolyData* out = vtkPolyData::SafeDownCast(
+    info->Get( vtkDataObject::DATA_OBJECT( ) )
+    );
+
+  // Prepare data
+  out->SetPoints( vtkSmartPointer< vtkPoints >::New( ) );
+  out->SetVerts( vtkSmartPointer< vtkCellArray >::New( ) );
+  out->SetLines( vtkSmartPointer< vtkCellArray >::New( ) );
+  out->SetPolys( vtkSmartPointer< vtkCellArray >::New( ) );
+  out->SetStrips( vtkSmartPointer< vtkCellArray >::New( ) );
+  vtkPoints* points = out->GetPoints( );
+  vtkCellArray* lines = out->GetLines( );
+
+  // Get data
+  for( unsigned long i = 0; i < this->m_PolyLine->GetSize( ); ++i )
+  {
+    typename _TPolyLine::TPoint pnt = this->m_PolyLine->GetPoint( i );
+    if( dim == 1 )      points->InsertNextPoint( pnt[ 0 ], 0, 0 );
+    else if( dim == 2 ) points->InsertNextPoint( pnt[ 0 ], pnt[ 1 ], 0 );
+    else                points->InsertNextPoint( pnt[ 0 ], pnt[ 1 ], pnt[ 2 ] );
+    if( i > 0 )
+    {
+      lines->InsertNextCell( 2 );
+      lines->InsertCellPoint( i - 1 );
+      lines->InsertCellPoint( i );
+
+    } // fi
+
+  } // rof
+  return( 1 );
+}
+
+// -------------------------------------------------------------------------
+template< class _TPolyLine >
+int
+cpExtensions::Visualization::PolyLineParametricPathToPolyData< _TPolyLine >::
+RequestInformation(
+  vtkInformation* information,
+  vtkInformationVector** input,
+  vtkInformationVector* output
+  )
+{
+  return( 1 );
+}
+
+// -------------------------------------------------------------------------
+#include <cpExtensions/DataStructures/PolyLineParametricPath.h>
+
+template class cpExtensions::Visualization::PolyLineParametricPathToPolyData< cpExtensions::DataStructures::PolyLineParametricPath< 1 > >;
+template class cpExtensions::Visualization::PolyLineParametricPathToPolyData< cpExtensions::DataStructures::PolyLineParametricPath< 2 > >;
+template class cpExtensions::Visualization::PolyLineParametricPathToPolyData< cpExtensions::DataStructures::PolyLineParametricPath< 3 > >;
+template class cpExtensions::Visualization::PolyLineParametricPathToPolyData< cpExtensions::DataStructures::PolyLineParametricPath< 4 > >;
+
+// eof - $RCSfile$
index cfc481eb278267aea9e623088fa02d454dea4daa..8e731086bcbf4fdee74b0a52c266deddd30825ba 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __CPEXTENSIONS__VISUALIZATION__POLYLINEPARAMETRICPATHTOPOLYDATA__H__
-#define __CPEXTENSIONS__VISUALIZATION__POLYLINEPARAMETRICPATHTOPOLYDATA__H__
+#ifndef __cpExtensions__Visualization__PolyLineParametricPathToPolyData__h__
+#define __cpExtensions__Visualization__PolyLineParametricPathToPolyData__h__
 
+#include <cpExtensions/Config.h>
 #include <vtkPolyDataAlgorithm.h>
-#include <itkImageBase.h>
 
 namespace cpExtensions
 {
@@ -11,14 +11,12 @@ namespace cpExtensions
     /**
      */
     template< class _TPolyLine >
-    class PolyLineParametricPathToPolyData
+    class cpExtensions_EXPORT PolyLineParametricPathToPolyData
       : public vtkPolyDataAlgorithm
     {
     public:
       typedef PolyLineParametricPathToPolyData Self;
-
       typedef _TPolyLine TPolyLine;
-      typedef itk::ImageBase< TPolyLine::PathDimension > TImage;
 
     public:
       vtkTypeMacro( PolyLineParametricPathToPolyData, vtkPolyDataAlgorithm );
@@ -27,9 +25,7 @@ namespace cpExtensions
       static Self* New( );
 
       const TPolyLine* GetInput( ) const;
-      const TImage* GetReferenceImage( ) const;
       void SetInput( const TPolyLine* pl );
-      void SetReferenceImage( const TImage* i );
 
     protected:
       PolyLineParametricPathToPolyData( );
@@ -53,17 +49,12 @@ namespace cpExtensions
 
     protected:
       const TPolyLine* m_PolyLine;
-      const TImage* m_ReferenceImage;
     };
 
   } // ecapseman
 
 } // ecapseman
 
-#ifndef ITK_MANUAL_INSTANTIATION
-#include <cpExtensions/Visualization/PolyLineParametricPathToPolyData.hxx>
-#endif // ITK_MANUAL_INSTANTIATION
-
-#endif //  __CPEXTENSIONS__VISUALIZATION__POLYLINEPARAMETRICPATHTOPOLYDATA__H__
+#endif //  __cpExtensions__Visualization__PolyLineParametricPathToPolyData__h__
 
 // eof - $RCSfile$
diff --git a/lib/cpExtensions/Visualization/PolyLineParametricPathToPolyData.hxx b/lib/cpExtensions/Visualization/PolyLineParametricPathToPolyData.hxx
deleted file mode 100644 (file)
index e3d23c7..0000000
+++ /dev/null
@@ -1,213 +0,0 @@
-#ifndef __CPEXTENSIONS__VISUALIZATION__POLYLINEPARAMETRICPATHTOPOLYDATA__HXX__
-#define __CPEXTENSIONS__VISUALIZATION__POLYLINEPARAMETRICPATHTOPOLYDATA__HXX__
-
-#include <vtkCellArray.h>
-#include <vtkInformation.h>
-#include <vtkInformationVector.h>
-#include <vtkSmartPointer.h>
-
-// -------------------------------------------------------------------------
-template< class _TPolyLine >
-typename
-cpExtensions::Visualization::PolyLineParametricPathToPolyData< _TPolyLine >::
-Self*
-cpExtensions::Visualization::PolyLineParametricPathToPolyData< _TPolyLine >::
-New( )
-{
-  return( new Self( ) );
-}
-
-// -------------------------------------------------------------------------
-template< class _TPolyLine >
-const typename
-cpExtensions::Visualization::PolyLineParametricPathToPolyData< _TPolyLine >::
-TPolyLine*
-cpExtensions::Visualization::PolyLineParametricPathToPolyData< _TPolyLine >::
-GetInput( ) const
-{
-  return( this->m_PolyLine );
-}
-
-// -------------------------------------------------------------------------
-template< class _TPolyLine >
-const typename
-cpExtensions::Visualization::PolyLineParametricPathToPolyData< _TPolyLine >::
-TImage*
-cpExtensions::Visualization::PolyLineParametricPathToPolyData< _TPolyLine >::
-GetReferenceImage( ) const
-{
-  return( this->m_ReferenceImage );
-}
-
-// -------------------------------------------------------------------------
-template< class _TPolyLine >
-void
-cpExtensions::Visualization::PolyLineParametricPathToPolyData< _TPolyLine >::
-SetInput( const TPolyLine* pl )
-{
-  if( this->m_PolyLine != pl )
-  {
-    this->m_PolyLine = pl;
-    this->Modified( );
-
-  } // fi
-}
-
-// -------------------------------------------------------------------------
-template< class _TPolyLine >
-void
-cpExtensions::Visualization::PolyLineParametricPathToPolyData< _TPolyLine >::
-SetReferenceImage( const TImage* i )
-{
-  if( this->m_ReferenceImage != i )
-  {
-    this->m_ReferenceImage = i;
-    this->Modified( );
-
-  } // fi
-}
-
-// -------------------------------------------------------------------------
-template< class _TPolyLine >
-cpExtensions::Visualization::PolyLineParametricPathToPolyData< _TPolyLine >::
-PolyLineParametricPathToPolyData( )
-  : vtkPolyDataAlgorithm( ),
-    m_PolyLine( NULL ),
-    m_ReferenceImage( NULL )
-{
-  this->SetNumberOfInputPorts( 0 );
-}
-
-// -------------------------------------------------------------------------
-template< class _TPolyLine >
-cpExtensions::Visualization::PolyLineParametricPathToPolyData< _TPolyLine >::
-~PolyLineParametricPathToPolyData( )
-{
-}
-
-// -------------------------------------------------------------------------
-template< class _TPolyLine >
-int
-cpExtensions::Visualization::PolyLineParametricPathToPolyData< _TPolyLine >::
-RequestData(
-  vtkInformation* information,
-  vtkInformationVector** input,
-  vtkInformationVector* output
-  )
-{
-  static const unsigned int dim = _TPolyLine::PathDimension;
-
-  if( this->m_PolyLine == NULL )
-    return( 0 );
-
-  // Get output
-  vtkInformation* info = output->GetInformationObject( 0 );
-  vtkPolyData* out = vtkPolyData::SafeDownCast(
-    info->Get( vtkDataObject::DATA_OBJECT( ) )
-    );
-
-  // Get input data
-  auto lst = this->m_PolyLine->GetVertexList( );
-
-  // Prepare points
-  vtkPoints* points = out->GetPoints( );
-  if( points == NULL )
-  {
-    points = vtkPoints::New( );
-    out->SetPoints( points );
-    points->Delete( );
-
-  } // fi
-  points->SetNumberOfPoints( lst->Size( ) );
-
-  // Prepare cells
-  /* TODO
-     vtkSmartPointer< vtkCellArray > verts =
-     vtkSmartPointer< vtkCellArray >::New( );
-  */
-  vtkSmartPointer< vtkCellArray > lines =
-    vtkSmartPointer< vtkCellArray >::New( );
-
-  for( unsigned int i = 0; i < lst->Size( ); ++i )
-  {
-    auto idx = lst->GetElement( i );
-    if( this->m_ReferenceImage != NULL )
-    {
-      typename TImage::PointType pnt;
-      this->m_ReferenceImage->TransformContinuousIndexToPhysicalPoint( idx, pnt );
-      if( dim == 1 )
-        points->SetPoint( i, pnt[ 0 ], 0, 0 );
-      else if( dim == 2 )
-        points->SetPoint( i, pnt[ 0 ], pnt[ 1 ], 0 );
-      else
-        points->SetPoint( i, pnt[ 0 ], pnt[ 1 ], pnt[ 2 ] );
-    }
-    else
-    {
-      if( dim == 1 )
-        points->SetPoint( i, idx[ 0 ], 0, 0 );
-      else if( dim == 2 )
-        points->SetPoint( i, idx[ 0 ], idx[ 1 ], 0 );
-      else
-        points->SetPoint( i, idx[ 0 ], idx[ 1 ], idx[ 2 ] );
-
-    } // fi
-    /* TODO
-       verts->InsertNextCell( 1 );
-       verts->InsertCellPoint( i );
-    */
-    if( i > 0 )
-    {
-      lines->InsertNextCell( 2 );
-      lines->InsertCellPoint( i - 1 );
-      lines->InsertCellPoint( i );
-
-    } // fi
-
-  } // rof
-  out->SetPoints( points );
-  // TODO: out->SetVerts( verts );
-  out->SetLines( lines );
-  return( 1 );
-}
-
-// -------------------------------------------------------------------------
-template< class _TPolyLine >
-int
-cpExtensions::Visualization::PolyLineParametricPathToPolyData< _TPolyLine >::
-RequestInformation(
-  vtkInformation* information,
-  vtkInformationVector** input,
-  vtkInformationVector* output
-  )
-{
-  vtkInformation* info = output->GetInformationObject( 0 );
-  /* TODO
-     info->Set(
-     vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES( ), -1
-     );
-  */
-
-  if( this->m_PolyLine != NULL && this->m_ReferenceImage != NULL )
-  {
-    /* TODO
-       typename C::TScalar len = this->m_RGC->GetTotalLength( );
-       typename C::TScalar s0 = this->m_RGC->Gets0( );
-       typename C::TPoint p0 = this->m_RGC->Axis( s0 );
-       typename C::TPoint p1 = this->m_RGC->Axis( s0 + len );
-
-       info->Set(
-       vtkStreamingDemandDrivenPipeline::WHOLE_BOUNDING_BOX( ),
-       double( p0[ 0 ] ), double( p1[ 0 ] ),
-       double( p0[ 1 ] ), double( p1[ 1 ] ),
-       double( p0[ 2 ] ), double( p1[ 2 ] )
-       );
-    */
-
-  } // fi
-  return( 1 );
-}
-
-#endif //  __CPEXTENSIONS__VISUALIZATION__POLYLINEPARAMETRICPATHTOPOLYDATA__HXX__
-
-// eof - $RCSfile$
diff --git a/lib/cpPlugins/DataObjects/PolyLineParametricPath.cxx b/lib/cpPlugins/DataObjects/PolyLineParametricPath.cxx
new file mode 100644 (file)
index 0000000..36d11f3
--- /dev/null
@@ -0,0 +1,58 @@
+#include <cpPlugins/DataObjects/PolyLineParametricPath.h>
+#include <cpExtensions/Visualization/PolyLineParametricPathToPolyData.h>
+
+// -------------------------------------------------------------------------
+void cpPlugins::DataObjects::PolyLineParametricPath::
+SetITK( itk::LightObject* o )
+{
+  this->Superclass::SetITK( o );
+  auto l1 = dynamic_cast< itk::PolyLineParametricPath< 1 >* >( o );
+  auto l2 = dynamic_cast< itk::PolyLineParametricPath< 2 >* >( o );
+  auto l3 = dynamic_cast< itk::PolyLineParametricPath< 3 >* >( o );
+  auto l4 = dynamic_cast< itk::PolyLineParametricPath< 4 >* >( o );
+  if     ( l1 != NULL ) this->_ITK_2_VTK( l1 );
+  else if( l2 != NULL ) this->_ITK_2_VTK( l2 );
+  else if( l3 != NULL ) this->_ITK_2_VTK( l3 );
+  else if( l4 != NULL ) this->_ITK_2_VTK( l4 );
+  else
+  {
+    this->m_VTK = NULL;
+    this->m_ITKvVTK = NULL;
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::DataObjects::PolyLineParametricPath::
+SetVTK( vtkObjectBase* o )
+{
+  // Do nothing
+  this->m_ITK = NULL;
+  this->m_VTK = NULL;
+  this->m_ITKvVTK = NULL;
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::DataObjects::PolyLineParametricPath::
+PolyLineParametricPath( )
+  : Superclass( )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::DataObjects::PolyLineParametricPath::
+~PolyLineParametricPath( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class _TPolyLine >
+void cpPlugins::DataObjects::PolyLineParametricPath::
+_ITK_2_VTK( _TPolyLine* pl )
+{
+  typedef
+    cpExtensions::Visualization::PolyLineParametricPathToPolyData< _TPolyLine >
+    _TFilter;
+}
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/DataObjects/PolyLineParametricPath.h b/lib/cpPlugins/DataObjects/PolyLineParametricPath.h
new file mode 100644 (file)
index 0000000..1a0147b
--- /dev/null
@@ -0,0 +1,61 @@
+#ifndef __cpPlugins__DataObjects__PolyLineParametricPath__h__
+#define __cpPlugins__DataObjects__PolyLineParametricPath__h__
+
+#include <cpPlugins/BaseObjects/DataObject.h>
+#include <cpPlugins_Paths.h>
+#include <vtkSmartPointer.h>
+
+// -------------------------------------------------------------------------
+class vtkPolyDataAlgorithm;
+
+// -------------------------------------------------------------------------
+namespace cpPlugins
+{
+  namespace DataObjects
+  {
+    /**
+     */
+    class cpPlugins_EXPORT PolyLineParametricPath
+      : public cpPlugins::BaseObjects::DataObject
+    {
+    public:
+      typedef PolyLineParametricPath             Self;
+      typedef cpPlugins::BaseObjects::DataObject Superclass;
+      typedef itk::SmartPointer< Self >          Pointer;
+      typedef itk::SmartPointer< const Self >    ConstPointer;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro(
+        PolyLineParametricPath, cpPlugins::BaseObjects::DataObject
+        );
+      cpPlugins_Id_Macro( PolyLineParametricPath, Object );
+      cpPlugins_Compatibility_Macro;
+
+    public:
+      virtual void SetITK( itk::LightObject* o ) cpPlugins_OVERRIDE;
+      virtual void SetVTK( vtkObjectBase* o ) cpPlugins_OVERRIDE;
+
+    protected:
+      PolyLineParametricPath( );
+      virtual ~PolyLineParametricPath( );
+
+      template< class _TPolyLine >
+      inline void _ITK_2_VTK( _TPolyLine* pl );
+
+    private:
+      // Purposely not implemented
+      PolyLineParametricPath( const Self& );
+      Self& operator=( const Self& );
+
+    protected:
+      vtkSmartPointer< vtkPolyDataAlgorithm > m_ITKvVTK;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#endif // __cpPlugins__DataObjects__PolyLineParametricPath__h__
+
+// eof - $RCSfile$