#define __fpa__Image__ExtractAxisFilter__h__
#include <itkProcessObject.h>
-#include <itkSignedMaurerDistanceMapImageFilter.h>
+#include <itkImageToImageFilter.h>
#include <fpa/Image/Dijkstra.h>
#include <fpa/Image/PolyLineParametricPath.h>
{
/**
*/
- template< class _TInputImage, class _TScalar, class _TCenterness = itk::SignedMaurerDistanceMapImageFilter< _TInputImage, itk::Image< _TScalar, _TInputImage::ImageDimension > > >
+ template< class _TInputImage, class _TScalar >
class ExtractAxisFilter
: public itk::ProcessObject
{
typedef _TInputImage TInputImage;
typedef _TScalar TScalar;
- typedef _TCenterness TCenterness;
+ typedef typename TInputImage::IndexType TIndex;
+ typedef typename TInputImage::PointType TPoint;
+
itkStaticConstMacro(
Dimension,
unsigned int,
TInputImage::ImageDimension
);
- typedef typename TCenterness::OutputImageType TOutputImage;
- typedef typename TInputImage::IndexType TIndex;
- typedef typename TInputImage::PointType TPoint;
+ typedef itk::Image< TScalar, Self::Dimension > TScalarImage;
+ typedef itk::ImageToImageFilter< TInputImage, TScalarImage > TCenterness;
typedef fpa::Image::PolyLineParametricPath< Self::Dimension > TPath;
- typedef fpa::Image::Dijkstra< TOutputImage, TOutputImage > TDijkstra;
+ typedef fpa::Image::Dijkstra< TScalarImage, TScalarImage > TDijkstra;
public:
itkNewMacro( Self );
itkGetConstObjectMacro( Centerness, TCenterness );
itkGetObjectMacro( Centerness, TCenterness );
+ itkSetObjectMacro( Centerness, TCenterness );
itkGetConstMacro( StartIndex, TIndex );
- itkGetConstMacro( EndIndex, TIndex );
-
itkSetMacro( StartIndex, TIndex );
+
+ itkGetConstMacro( EndIndex, TIndex );
itkSetMacro( EndIndex, TIndex );
public:
protected:
typename TCenterness::Pointer m_Centerness;
- typename TDijkstra::Pointer m_Dijkstra;
+ typename TDijkstra::Pointer m_Dijkstra;
TIndex m_StartIndex;
TIndex m_EndIndex;
#ifndef __fpa__Image__ExtractAxisFilter__hxx__
#define __fpa__Image__ExtractAxisFilter__hxx__
+#include <itkSignedMaurerDistanceMapImageFilter.h>
#include <fpa/Image/Functors/Dijkstra/Invert.h>
// -------------------------------------------------------------------------
-template< class _TInputImage, class _TScalar, class _TCenterness >
-itk::ModifiedTimeType
-fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar, _TCenterness >::
+template< class _TInputImage, class _TScalar >
+itk::ModifiedTimeType
+fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar >::
GetMTime( ) const
{
itk::ModifiedTimeType a = this->Superclass::GetMTime( );
}
// -------------------------------------------------------------------------
-template< class _TInputImage, class _TScalar, class _TCenterness >
-void fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar, _TCenterness >::
+template< class _TInputImage, class _TScalar >
+void fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar >::
AddSeed( const TIndex& seed )
{
this->m_Dijkstra->AddSeed( seed );
}
// -------------------------------------------------------------------------
-template< class _TInputImage, class _TScalar, class _TCenterness >
-void fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar, _TCenterness >::
+template< class _TInputImage, class _TScalar >
+void fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar >::
AddSeed( const TPoint& seed )
{
this->m_Dijkstra->AddSeed( seed );
}
// -------------------------------------------------------------------------
-template< class _TInputImage, class _TScalar, class _TCenterness >
-void fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar, _TCenterness >::
+template< class _TInputImage, class _TScalar >
+void fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar >::
ClearSeeds( )
{
this->m_Dijkstra->ClearSeeds( );
}
// -------------------------------------------------------------------------
-template< class _TInputImage, class _TScalar, class _TCenterness >
-void fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar, _TCenterness >::
+template< class _TInputImage, class _TScalar >
+void fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar >::
SetInput( TInputImage* input )
{
this->Superclass::SetNthInput( 0, input );
}
// -------------------------------------------------------------------------
-template< class _TInputImage, class _TScalar, class _TCenterness >
-typename
-fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar, _TCenterness >::
-TInputImage*
-fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar, _TCenterness >::
+template< class _TInputImage, class _TScalar >
+typename fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar >::
+TInputImage* fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar >::
GetInput( )
{
return( dynamic_cast< TInputImage* >( this->Superclass::GetInput( 0 ) ) );
}
// -------------------------------------------------------------------------
-template< class _TInputImage, class _TScalar, class _TCenterness >
-const typename
-fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar, _TCenterness >::
-TInputImage*
-fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar, _TCenterness >::
+template< class _TInputImage, class _TScalar >
+const typename fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar >::
+TInputImage* fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar >::
GetInput( ) const
{
return(
}
// -------------------------------------------------------------------------
-template< class _TInputImage, class _TScalar, class _TCenterness >
-typename
-fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar, _TCenterness >::
-TPath*
-fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar, _TCenterness >::
+template< class _TInputImage, class _TScalar >
+typename fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar >::
+TPath* fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar >::
GetOutput( )
{
return( dynamic_cast< TPath* >( this->Superclass::GetOutput( 0 ) ) );
}
// -------------------------------------------------------------------------
-template< class _TInputImage, class _TScalar, class _TCenterness >
-const typename
-fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar, _TCenterness >::
-TPath*
-fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar, _TCenterness >::
+template< class _TInputImage, class _TScalar >
+const typename fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar >::
+TPath* fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar >::
GetOutput( ) const
{
return( dynamic_cast< const TPath* >( this->Superclass::GetOutput( 0 ) ) );
}
// -------------------------------------------------------------------------
-template< class _TInputImage, class _TScalar, class _TCenterness >
-fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar, _TCenterness >::
+template< class _TInputImage, class _TScalar >
+fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar >::
ExtractAxisFilter( )
: Superclass( )
{
weight->SetBeta( 1 );
// Filters
- this->m_Centerness = TCenterness::New( );
+ typedef itk::SignedMaurerDistanceMapImageFilter< TInputImage, TScalarImage > _TDefaultCenterness;
+ this->m_Centerness = _TDefaultCenterness::New( );
+ this->m_Centerness->InsideIsPositiveOn( );
+ this->m_Centerness->SquaredDistanceOn( );
+ this->m_Centerness->UseImageSpacingOn( );
+
+ // Axis extractor
this->m_Dijkstra = TDijkstra::New( );
this->m_Dijkstra->SetWeightFunction( weight );
this->m_Dijkstra->StopAtOneFront( );
}
// -------------------------------------------------------------------------
-template< class _TInputImage, class _TScalar, class _TCenterness >
-fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar, _TCenterness >::
+template< class _TInputImage, class _TScalar >
+fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar >::
~ExtractAxisFilter( )
{
}
// -------------------------------------------------------------------------
-template< class _TInputImage, class _TScalar, class _TCenterness >
-void fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar, _TCenterness >::
+template< class _TInputImage, class _TScalar >
+void fpa::Image::ExtractAxisFilter< _TInputImage, _TScalar >::
GenerateData( )
{
// Execute minipipeline
// Extract axis
typename TPath::Pointer out = this->GetOutput( );
this->m_Dijkstra->GetMinimumSpanningTree( )->GetPolyLineParametricPath(
- out,
- this->m_StartIndex,
- this->m_EndIndex
+ out, this->m_StartIndex, this->m_EndIndex
);
}