typedef typename TIndex::LexicographicCompare TIndexCompare;
typedef typename TPath::Pointer TPathPointer;
+ itkStaticConstMacro( Dimension, unsigned int, _VDim );
+
typedef Graph< TIndex, TPathPointer, TIndex, TIndexCompare > Superclass;
typedef Skeleton Self;
typedef itk::SmartPointer< Self > Pointer;
${CMAKE_CURRENT_SOURCE_DIR}/Skeleton.cxx
${CMAKE_CURRENT_SOURCE_DIR}/Skeleton.h
${CMAKE_CURRENT_SOURCE_DIR}/Skeleton.d
+ ${CMAKE_CURRENT_SOURCE_DIR}/Simple3DCurve.cxx
+ ${CMAKE_CURRENT_SOURCE_DIR}/Simple3DCurve.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/Simple3DCurve.d
)
TARGET_LINK_LIBRARIES(
ITKSeparableFilters
ITKMorphology
ITKParaMorphology
- #ITKSliceFilters
- #ITKGenericFilters
- #ImageParaMorphologyFilters
- #ImageThresholdFilters
- #ImageGradientFilters
- #Extensions
+ cpExtensions
)
## ===============================
+++ /dev/null
-#ifndef __cpPluginsExtensions__PolyLineParametricPathToSimple3DCurve__h__
-#define __cpPluginsExtensions__PolyLineParametricPathToSimple3DCurve__h__
-
-#include <cpPluginsExtensions_Export.h>
-#include <cpPlugins/BaseObjects/ProcessObject.h>
-
-namespace cpPluginsExtensions
-{
- /**
- */
- class cpPluginsExtensions_EXPORT PolyLineParametricPathToSimple3DCurve
- : public cpPlugins::BaseObjects::ProcessObject
- {
- cpPluginsObject(
- PolyLineParametricPathToSimple3DCurve,
- cpPlugins::BaseObjects::ProcessObject,
- Extensions
- );
- };
-
-} // ecapseman
-
-#endif // __cpPluginsExtensions__PolyLineParametricPathToSimple3DCurve__h__
-
-
-// eof - $RCSfile$
{
// Get filenames
auto fnames = this->m_Parameters.GetOpenFileNameList( "FileNames" );
+ std::string fname = "";
if( fnames.size( ) > 1 )
{
std::stringstream fname_str;
fname_str << fnames[ 0 ] << cpPlugins_PATH_SEPARATOR << fnames[ 1 ];
- std::string fname = fname_str.str( );
+ fname = fname_str.str( );
+ }
+ else if( fnames.size( ) == 1 )
+ fname = fnames[ 0 ];
+ if( fname != "" )
+ {
// Guess image properties
itk::ImageIOBase::Pointer io =
itk::ImageIOFactory::CreateImageIO(
// Get filenames
auto fnames = this->m_Parameters.GetOpenFileNameList( "FileNames" );
- if( fnames.size( ) == 2 )
+ if( fnames.size( ) == 1 || fnames.size( ) == 2 )
{
std::stringstream fname_str;
- fname_str << fnames[ 0 ] << cpPlugins_PATH_SEPARATOR << fnames[ 1 ];
+ if( fnames.size( ) == 1 )
+ fname_str << fnames[ 0 ];
+ else
+ fname_str << fnames[ 0 ] << cpPlugins_PATH_SEPARATOR << fnames[ 1 ];
auto f = this->_CreateITK< itk::ImageFileReader< _TImage > >( );
f->SetFileName( fname_str.str( ) );
this->m_Parameters.ConfigureAsReal( "LowerThreshold", 0 );
this->m_Parameters.ConfigureAsReal( "UpperThreshold", 1 );
+ this->m_Parameters.ConfigureAsUint( "PAD", 0 );
}
// -------------------------------------------------------------------------
filter->SetImage( image );
filter->SetLowerThreshold( this->m_Parameters.GetReal( "LowerThreshold" ) );
filter->SetUpperThreshold( this->m_Parameters.GetReal( "UpperThreshold" ) );
+ filter->SetPAD( this->m_Parameters.GetUint( "PAD" ) );
filter->Compute( );
// Create output
-#include <Extensions/PolyLineParametricPathToSimple3DCurve.h>
+#include <cpExtensions/PolyLineParametricPathToSimple3DCurve.h>
#include <cpInstances/PolyLineParametricPath.h>
#include <cpInstances/Simple3DCurve.h>
#include <cpExtensions/Algorithms/PolyLineParametricPathToSimple3DCurve.h>
// -------------------------------------------------------------------------
-cpPluginsExtensions::PolyLineParametricPathToSimple3DCurve::
+cpPluginscpExtensions::PolyLineParametricPathToSimple3DCurve::
PolyLineParametricPathToSimple3DCurve( )
: Superclass( )
{
}
// -------------------------------------------------------------------------
-cpPluginsExtensions::PolyLineParametricPathToSimple3DCurve::
+cpPluginscpExtensions::PolyLineParametricPathToSimple3DCurve::
~PolyLineParametricPathToSimple3DCurve( )
{
}
// -------------------------------------------------------------------------
-void cpPluginsExtensions::PolyLineParametricPathToSimple3DCurve::
+void cpPluginscpExtensions::PolyLineParametricPathToSimple3DCurve::
_GenerateData( )
{
typedef cpExtensions::DataStructures::PolyLineParametricPath< 3 > _TPath;
filter->SetNumberOfSamples( this->m_Parameters.GetUint( "NumberOfSamples" ) );
filter->Update( );
this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
-
}
// eof - $RCSfile$
--- /dev/null
+#ifndef __cpPluginscpExtensions__PolyLineParametricPathToSimple3DCurve__h__
+#define __cpPluginscpExtensions__PolyLineParametricPathToSimple3DCurve__h__
+
+#include <cpPluginscpExtensions_Export.h>
+#include <cpPlugins/BaseObjects/ProcessObject.h>
+
+namespace cpPluginscpExtensions
+{
+ /**
+ */
+ class cpPluginscpExtensions_EXPORT PolyLineParametricPathToSimple3DCurve
+ : public cpPlugins::BaseObjects::ProcessObject
+ {
+ cpPluginsObject(
+ PolyLineParametricPathToSimple3DCurve,
+ cpPlugins::BaseObjects::ProcessObject,
+ cpExtensions
+ );
+ };
+
+} // ecapseman
+
+#endif // __cpPluginscpExtensions__PolyLineParametricPathToSimple3DCurve__h__
+
+
+// eof - $RCSfile$
--- /dev/null
+#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$
--- /dev/null
+#ifndef __cpPluginscpExtensions__SkeletonToImageFilter__h__
+#define __cpPluginscpExtensions__SkeletonToImageFilter__h__
+
+#include <cpPluginscpExtensions_Export.h>
+#include <cpPlugins/BaseObjects/ProcessObject.h>
+
+namespace cpPluginscpExtensions
+{
+ /**
+ */
+ class cpPluginscpExtensions_EXPORT SkeletonToImageFilter
+ : public cpPlugins::BaseObjects::ProcessObject
+ {
+ cpPluginsObject(
+ SkeletonToImageFilter,
+ cpPlugins::BaseObjects::ProcessObject,
+ cpExtensions
+ );
+
+ protected:
+ template< class _TSkeleton >
+ inline void _GD0( _TSkeleton* skeleton );
+ };
+
+} // ecapseman
+
+#endif // __cpPluginscpExtensions__SkeletonToImageFilter__h__
+
+
+// eof - $RCSfile$
--- /dev/null
+header #define ITK_MANUAL_INSTANTIATION
+
+tinclude cpExtensions/Algorithms/SkeletonToImageFilter:h|hxx
+cinclude cpExtensions/DataStructures/Skeleton.h
+
+instances cpExtensions::Algorithms::SkeletonToImageFilter< cpExtensions::DataStructures::Skeleton< #pdims# > , itk::Image< unsigned char, #pdims# > >
+
+** eof - $RCSfile$