+#include <cpExtensions/SkeletonToImageFilter.h>
+#include <cpInstances/Image.h>
+#include <cpInstances/Skeleton.h>
+
+#include <cpExtensions/DataStructures/Skeleton.h>
+#include <cpExtensions/Algorithms/SkeletonToImageFilter.h>
+
+// -------------------------------------------------------------------------
+cpPluginscpExtensions::SkeletonToImageFilter::
+SkeletonToImageFilter( )
+ : Superclass( )
+{
+ this->_ConfigureInput< cpInstances::Skeleton >( "Skeleton", true, false );
+ this->_ConfigureInput< cpInstances::Image >( "TemplateImage", true, false );
+ this->_ConfigureOutput< cpInstances::Image >( "Output" );
+ this->m_Parameters.ConfigureAsUint( "InsideValue", 1 );
+ this->m_Parameters.ConfigureAsUint( "OutsideValue", 0 );
+}
+
+// -------------------------------------------------------------------------
+cpPluginscpExtensions::SkeletonToImageFilter::
+~SkeletonToImageFilter( )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpPluginscpExtensions::SkeletonToImageFilter::
+_GenerateData( )
+{
+ auto o = this->GetInputData( "Skeleton" );
+ cpPlugins_Demangle_Skeleton_All_1( o, _GD0 )
+ this->_Error( "Invalid input skeleton." );
+}
+
+// -------------------------------------------------------------------------
+template< class _TSkeleton >
+void cpPluginscpExtensions::SkeletonToImageFilter::
+_GD0( _TSkeleton* skeleton )
+{
+ typedef itk::ImageBase< _TSkeleton::Dimension > _TImageBase;
+ typedef itk::Image< unsigned char, _TSkeleton::Dimension > _TImage;
+ typedef cpExtensions::Algorithms::SkeletonToImageFilter< _TSkeleton, _TImage > _TFilter;
+
+ auto image = this->GetInputData< _TImageBase >( "TemplateImage" );
+ auto filter = this->_CreateITK< _TFilter >( );
+ filter->SetTemplateImage( image );
+ filter->SetSkeleton( skeleton );
+ filter->SetInsideValue( this->m_Parameters.GetUint( "InsideValue" ) );
+ filter->SetOutsideValue( this->m_Parameters.GetUint( "OutsideValue" ) );
+ filter->Update( );
+ this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
+}
+
+// eof - $RCSfile$