## == Functions, packages and options ==
## =====================================
-OPTION(USE_cpPlugins "Build cpPlugins-based code" OFF)
+FIND_PACKAGE(cpPlugins QUIET)
+IF(cpPlugins_DIR)
+ OPTION(USE_cpPlugins "Build cpPlugins-based code" ON)
+ELSE(cpPlugins_DIR)
+ OPTION(USE_cpPlugins "Build cpPlugins-based code" OFF)
+ MARK_AS_ADVANCED(FORCE cpPlugins_DIR)
+ENDIF(cpPlugins_DIR)
IF(USE_cpPlugins)
- FIND_PACKAGE(cpPlugins REQUIRED)
+ FIND_PACKAGE(cpPlugins)
+ MARK_AS_ADVANCED(CLEAR cpPlugins_DIR)
ENDIF(USE_cpPlugins)
INCLUDE(cmake/Restrictions.cmake)
INCLUDE(cmake/KitwareTools.cmake)
## == Build different parts ==
## ===========================
-## SUBDIRS(appli cmake lib plugins)
SUBDIRS(lib plugins)
## eof - $RCSfile$
+++ /dev/null
-## ================================
-## == Find cpPlugins-cmake tools ==
-## ================================
-
-## ====================
-## == Find libraries ==
-## ====================
-
-SET(
- _all_libs
- "@fpa_LIB@"
- "@fpa_Instances@"
- )
-SET(fpa_Instances "@fpa_Instances@")
-
-SET(_l_locations)
-FOREACH(_l ${_all_libs})
- IF(MSVC)
- FIND_LIBRARY(
- ${_l}_LIB NAMES ${_l}
- HINTS
- @PROJECT_BINARY_DIR@/$(ConfigurationName)
- @CMAKE_INSTALL_PREFIX@/bin
- @CMAKE_INSTALL_PREFIX@/lib
- )
- ELSE(MSVC)
- FIND_LIBRARY(
- ${_l}_LIB NAMES ${_l}
- HINTS
- @PROJECT_BINARY_DIR@
- @CMAKE_INSTALL_PREFIX@/bin
- @CMAKE_INSTALL_PREFIX@/lib
- )
- ENDIF(MSVC)
- IF(${_l}_LIB)
- MARK_AS_ADVANCED(FORCE ${_l}_LIB)
- GET_FILENAME_COMPONENT(_dir ${${_l}_LIB} DIRECTORY)
- LIST(APPEND _l_locations ${_dir})
- ENDIF(${_l}_LIB)
-ENDFOREACH(_l)
-IF(_l_locations)
- LIST(REMOVE_DUPLICATES _l_locations)
- LINK_DIRECTORIES(${_l_locations})
-ENDIF(_l_locations)
-
-## =========================
-## == Include directories ==
-## =========================
-
-## TODO: this is not completely correct!!!
-INCLUDE_DIRECTORIES(
- @CMAKE_INSTALL_PREFIX@/include
- @CMAKE_INSTALL_PREFIX@/include/fpa/Instances
- @PROJECT_SOURCE_DIR@/lib
- @PROJECT_BINARY_DIR@/lib
- @PROJECT_SOURCE_DIR@/lib/Instances
- @PROJECT_BINARY_DIR@/lib/Instances
- )
-
-## eof - $RCSfile$
+++ /dev/null
-## ===============================
-## == Some configurable options ==
-## ===============================
-
-
-## eof - $RCSfile$
-## ======================================
-## == Build a library from a directory ==
-## ======================================
-
-CompileLibFromDir(fpa SHARED fpa)
## ===================================
## == Build instances for cpPlugins ==
+++ /dev/null
-// eof - $RCSfile$
#ifndef __fpa__Config__h__
#define __fpa__Config__h__
-#include <fpa_Export.h>
-
-/*
- * =========================================================================
- * Version numbers and strings
- * =========================================================================
- */
-#define fpa_MAJOR_VERSION @prj_MAJ_VER@
-#define fpa_MINOR_VERSION @prj_MIN_VER@
-#define fpa_RELEASE_VERSION @prj_REL_VER@
-#define fpa_VERSION "@prj_VERSION@"
-#define fpa_SHORT_VERSION "@prj_SHORT_VERSION@"
-
/*
* =========================================================================
* Language related macros
## == Compile each instance ==
## ===========================
-SET(
- _definitions
- DataObjects
- Filters
+INCLUDE_DIRECTORIES(
+ ${PROJECT_SOURCE_DIR}/lib
+ ${PROJECT_BINARY_DIR}/lib
)
+SET(_pfx fpaInstaces)
-SET(_all_libs)
-FOREACH(_d ${_definitions})
- FILE(GLOB _files ${CMAKE_CURRENT_SOURCE_DIR}/${_d}.*)
- CreateLib(fpaInstances${_d} SHARED ${_files})
- TARGET_LINK_LIBRARIES(
- fpaInstances${_d}
- ${ITK_LIBRARIES} ${VTK_LIBRARIES}
- ${cpPlugins_AllInstances}
- )
- LIST(APPEND _all_libs fpaInstances${_d})
-ENDFOREACH(_d)
+CreateLib(${_pfx}DataObjects SHARED ${CMAKE_CURRENT_SOURCE_DIR}/DataObjects.i)
+CreateLib(${_pfx}Filters SHARED ${CMAKE_CURRENT_SOURCE_DIR}/Filters.i)
-TARGET_LINK_LIBRARIES(
- fpaInstancesFilters
- fpaInstancesDataObjects
- )
+TARGET_LINK_LIBRARIES(${_pfx}DataObjects ${cpPlugins_AllInstances})
+TARGET_LINK_LIBRARIES(${_pfx}Filters ${_pfx}DataObjects)
SET(
- fpa_AllInstances ${_all_libs}
+ fpa_AllInstances
+ ${_pfx}DataObjects
+ ${_pfx}Filters
CACHE INTERNAL "All valid instances." FORCE
)
tinclude fpa/Image/MinimumSpanningTree:h|hxx
tinclude fpa/Base/MinimumSpanningTree:h|hxx
-instances fpa::Image::Functors::SimpleNeighborhood< itk::ImageBase< #process_dims# > >
-instances fpa::Image::Functors::SimpleDijkstraCost< itk::Image< #scalar_pixels#, #process_dims# >, #reals# >
-instances fpa::Base::MinimumSpanningTree< itk::Index< #process_dims# >, cpExtensions::DataStructures::PolyLineParametricPath< #process_dims# >, itk::Image< itk::Offset< #process_dims# >, #process_dims# > >
-instances fpa::Image::MinimumSpanningTree< #process_dims# >
+cinclude set
+tinclude itkSimpleDataObjectDecorator:h|hxx
+instances itk::SimpleDataObjectDecorator< std::set< itk::Index< #pdims# >, itk::Functor::IndexLexicographicCompare< #pdims# > > >
+
+instances fpa::Image::Functors::SimpleNeighborhood< itk::ImageBase< #pdims# > >
+instances fpa::Image::Functors::SimpleDijkstraCost< itk::Image< #scalar_types#, #pdims# >, #real_types# >
+instances fpa::Base::MinimumSpanningTree< itk::Index< #pdims# >, cpExtensions::DataStructures::PolyLineParametricPath< #pdims# >, itk::Image< itk::Offset< #pdims# >, #pdims# > >
+instances fpa::Image::MinimumSpanningTree< #pdims# >
** eof - $RCSfile$
header #define ITK_MANUAL_INSTANTIATION
-define i_pixels=#scalar_pixels#
-define o_pixels=#scalar_pixels#
+define i_scalars=#scalar_types#
+define o_scalars=#scalar_types#
tinclude fpa/Base/Algorithm:h|hxx
tinclude fpa/Image/Algorithm:h|hxx
-instances fpa::Base::Algorithm< itk::ImageToImageFilter< itk::Image< #i_pixels#, #process_dims# >, itk::Image< #o_pixels#, #process_dims# > >, itk::Index< #process_dims# >, #o_pixels# >
-instances fpa::Image::Algorithm< itk::Image< #i_pixels#, #process_dims# >, itk::Image< #o_pixels#, #process_dims# > >
+instances fpa::Base::Algorithm< itk::ImageToImageFilter< itk::Image< #i_scalars#, #pdims# >, itk::Image< #o_scalars#, #pdims# > >, itk::Index< #pdims# >, #o_scalars# >
+instances fpa::Image::Algorithm< itk::Image< #i_scalars#, #pdims# >, itk::Image< #o_scalars#, #pdims# > >
** eof - $RCSfile$
INCLUDE_DIRECTORIES(
${PROJECT_SOURCE_DIR}/lib
${PROJECT_BINARY_DIR}/lib
+ ${PROJECT_SOURCE_DIR}/plugins
+ ${PROJECT_BINARY_DIR}/plugins
)
- CreatePlugin(fpaPlugins Plugins)
- TARGET_LINK_LIBRARIES(
- fpaPlugins
- cpPlugins
- ${cpPlugins_AllInstances}
- ${fpa_AllInstances}
+
+ SET(
+ _dirs
+ ImageAlgorithms
+ RegionGrowFunctors
+ DijkstraFunctors
)
+ FOREACH(_d ${_dirs})
+ CreatePlugin(
+ fpaPlugins${_d} ${CMAKE_CURRENT_SOURCE_DIR}/${_d}
+ )
+ TARGET_LINK_LIBRARIES(
+ fpaPlugins${_d}
+ cpPlugins cpPluginsDataObjects
+ ${fpa_AllInstances}
+ )
+ ENDFOREACH(_d)
+ TARGET_LINK_LIBRARIES(fpaPluginsImageAlgorithms fpaPluginsDijkstraFunctors)
+
ENDIF(USE_cpPlugins)
## eof - $RCSfile$
\ No newline at end of file
--- /dev/null
+header #define ITK_MANUAL_INSTANTIATION
+
+define i_reals=#real_types#
+define o_reals=#real_types#
+tinclude fpa/Base/Functors/Inverse:h|hxx
+tinclude fpa/Base/Functors/GaussianModel:h|hxx
+
+instances fpa::Base::Functors::Inverse< #i_reals#, #o_reals# >
+instances fpa::Base::Functors::GaussianModel< #i_reals#, #o_reals# >
+
+
+** eof - $RCSfile$
-#include <Plugins/ExtractPathFromMinimumSpanningTree.h>
+#include <DijkstraFunctors/ExtractPathFromMinimumSpanningTree.h>
#include <cpInstances/Image.h>
#include <cpInstances/PolyLineParametricPath.h>
#include <vtkPolyData.h>
#include <fpa/Image/MinimumSpanningTree.h>
// -------------------------------------------------------------------------
-fpaPlugins::ExtractPathFromMinimumSpanningTree::
+fpaPluginsDijkstraFunctors::ExtractPathFromMinimumSpanningTree::
ExtractPathFromMinimumSpanningTree( )
: Superclass( )
{
}
// -------------------------------------------------------------------------
-fpaPlugins::ExtractPathFromMinimumSpanningTree::
+fpaPluginsDijkstraFunctors::ExtractPathFromMinimumSpanningTree::
~ExtractPathFromMinimumSpanningTree( )
{
}
// -------------------------------------------------------------------------
-void fpaPlugins::ExtractPathFromMinimumSpanningTree::
+void fpaPluginsDijkstraFunctors::ExtractPathFromMinimumSpanningTree::
_GenerateData( )
{
typedef fpa::Image::MinimumSpanningTree< 2 > _TMST2;
// -------------------------------------------------------------------------
template< class _TMST >
-void fpaPlugins::ExtractPathFromMinimumSpanningTree::
+void fpaPluginsDijkstraFunctors::ExtractPathFromMinimumSpanningTree::
_GD0( _TMST* mst )
{
typedef typename _TMST::IndexType _TIndex;
--- /dev/null
+#ifndef __fpaPluginsDijkstraFunctors__ExtractPathFromMinimumSpanningTree__h__
+#define __fpaPluginsDijkstraFunctors__ExtractPathFromMinimumSpanningTree__h__
+
+#include <fpaPluginsDijkstraFunctors_Export.h>
+#include <cpPlugins/BaseObjects/ProcessObject.h>
+
+namespace fpaPluginsDijkstraFunctors
+{
+ /**
+ */
+ class fpaPluginsDijkstraFunctors_EXPORT ExtractPathFromMinimumSpanningTree
+ : public cpPlugins::BaseObjects::ProcessObject
+ {
+ cpPluginsObject(
+ ExtractPathFromMinimumSpanningTree,
+ cpPlugins::BaseObjects::ProcessObject,
+ fpaDijkstraFunctors
+ );
+
+ protected:
+ template< class _TMST >
+ inline void _GD0( _TMST* mst );
+ };
+
+} // ecapseman
+
+#endif // __fpaPluginsDijkstraFunctors__ExtractPathFromMinimumSpanningTree__h__
+
+// eof - $RCSfile$
-#include <Plugins/GaussianModelCost.h>
+#include <DijkstraFunctors/GaussianModelCost.h>
#include <cpInstances/Image.h>
#include <fpa/Base/Functors/GaussianModel.h>
// -------------------------------------------------------------------------
-fpaPlugins::GaussianModelCost::
+fpaPluginsDijkstraFunctors::GaussianModelCost::
GaussianModelCost( )
: Superclass( )
{
}
// -------------------------------------------------------------------------
-fpaPlugins::GaussianModelCost::
+fpaPluginsDijkstraFunctors::GaussianModelCost::
~GaussianModelCost( )
{
}
// -------------------------------------------------------------------------
-void fpaPlugins::GaussianModelCost::
+void fpaPluginsDijkstraFunctors::GaussianModelCost::
_GenerateData( )
{
auto rtype = this->m_Parameters.GetSelectedChoice( "ResultType" );
// -------------------------------------------------------------------------
template< class _TOutput >
-void fpaPlugins::GaussianModelCost::
+void fpaPluginsDijkstraFunctors::GaussianModelCost::
_GD0( )
{
typedef fpa::Base::Functors::GaussianModel< _TOutput, _TOutput > _TFunctor;
#ifndef __fpa__Plugins__GaussianModelCost__h__
#define __fpa__Plugins__GaussianModelCost__h__
-#include <fpaPlugins_Export.h>
+#include <fpaPluginsDijkstraFunctors_Export.h>
#include <cpPlugins/BaseObjects/ProcessObject.h>
-namespace fpaPlugins
+namespace fpaPluginsDijkstraFunctors
{
/**
*/
- class fpaPlugins_EXPORT GaussianModelCost
+ class fpaPluginsDijkstraFunctors_EXPORT GaussianModelCost
: public cpPlugins::BaseObjects::ProcessObject
{
cpPluginsObject(
GaussianModelCost,
cpPlugins::BaseObjects::ProcessObject,
- fpaFunctors
+ fpaDijkstraFunctors
);
protected:
-#include <Plugins/InvertCost.h>
+#include <DijkstraFunctors/InvertCost.h>
#include <cpInstances/Image.h>
#include <fpa/Base/Functors/Inverse.h>
// -------------------------------------------------------------------------
-fpaPlugins::InvertCost::
+fpaPluginsDijkstraFunctors::InvertCost::
InvertCost( )
: Superclass( )
{
}
// -------------------------------------------------------------------------
-fpaPlugins::InvertCost::
+fpaPluginsDijkstraFunctors::InvertCost::
~InvertCost( )
{
}
// -------------------------------------------------------------------------
-void fpaPlugins::InvertCost::
+void fpaPluginsDijkstraFunctors::InvertCost::
_GenerateData( )
{
auto rtype = this->m_Parameters.GetSelectedChoice( "ResultType" );
// -------------------------------------------------------------------------
template< class _TOutput >
-void fpaPlugins::InvertCost::
+void fpaPluginsDijkstraFunctors::InvertCost::
_GD0( )
{
typedef fpa::Base::Functors::Inverse< _TOutput, _TOutput > _TFunctor;
#ifndef __fpa__Plugins__InvertCost__h__
#define __fpa__Plugins__InvertCost__h__
-#include <fpaPlugins_Export.h>
+#include <fpaPluginsDijkstraFunctors_Export.h>
#include <cpPlugins/BaseObjects/ProcessObject.h>
-namespace fpaPlugins
+namespace fpaPluginsDijkstraFunctors
{
/**
*/
- class fpaPlugins_EXPORT InvertCost
+ class fpaPluginsDijkstraFunctors_EXPORT InvertCost
: public cpPlugins::BaseObjects::ProcessObject
{
cpPluginsObject(
InvertCost,
cpPlugins::BaseObjects::ProcessObject,
- fpaFunctors
+ fpaDijkstraFunctors
);
protected:
-#include <Plugins/SimpleImageDijkstraCost.h>
+#include <DijkstraFunctors/SimpleImageDijkstraCost.h>
#include <cpInstances/Image.h>
-#include <cpInstances/Image_Demanglers.h>
#include <itkImage.h>
#include <fpa/Image/Functors/SimpleDijkstraCost.h>
// -------------------------------------------------------------------------
-fpaPlugins::SimpleImageDijkstraCost::
+fpaPluginsDijkstraFunctors::SimpleImageDijkstraCost::
SimpleImageDijkstraCost( )
: Superclass( )
{
}
// -------------------------------------------------------------------------
-fpaPlugins::SimpleImageDijkstraCost::
+fpaPluginsDijkstraFunctors::SimpleImageDijkstraCost::
~SimpleImageDijkstraCost( )
{
}
// -------------------------------------------------------------------------
-void fpaPlugins::SimpleImageDijkstraCost::
+void fpaPluginsDijkstraFunctors::SimpleImageDijkstraCost::
_GenerateData( )
{
auto o = this->GetInputData( "Input" );
// -------------------------------------------------------------------------
template< class _TImage >
-void fpaPlugins::SimpleImageDijkstraCost::
+void fpaPluginsDijkstraFunctors::SimpleImageDijkstraCost::
_GD0( _TImage* image )
{
auto rtype = this->m_Parameters.GetSelectedChoice( "ResultType" );
// -------------------------------------------------------------------------
template< class _TImage, class _TOutput >
-void fpaPlugins::SimpleImageDijkstraCost::
+void fpaPluginsDijkstraFunctors::SimpleImageDijkstraCost::
_GD1( _TImage* image )
{
typedef
#ifndef __fpa__Plugins__SimpleImageDijkstraCost__h__
#define __fpa__Plugins__SimpleImageDijkstraCost__h__
-#include <fpaPlugins_Export.h>
+#include <fpaPluginsDijkstraFunctors_Export.h>
#include <cpPlugins/BaseObjects/ProcessObject.h>
-namespace fpaPlugins
+namespace fpaPluginsDijkstraFunctors
{
/**
*/
- class fpaPlugins_EXPORT SimpleImageDijkstraCost
+ class fpaPluginsDijkstraFunctors_EXPORT SimpleImageDijkstraCost
: public cpPlugins::BaseObjects::ProcessObject
{
cpPluginsObject(
SimpleImageDijkstraCost,
cpPlugins::BaseObjects::ProcessObject,
- fpaFunctors
+ fpaDijkstraFunctors
);
protected:
-#include <Plugins/BaseImageFilter.h>
+#include <ImageAlgorithms/BaseFilter.h>
#include <cpInstances/Image.h>
// -------------------------------------------------------------------------
-fpaPlugins::BaseImageFilter::
-BaseImageFilter( )
+fpaPluginsImageAlgorithms::BaseFilter::
+BaseFilter( )
: Superclass( )
{
typedef cpPlugins::BaseObjects::DataObject _TData;
this->_ConfigureInput< _TData >( "Neighborhood", false, false );
this->_ConfigureOutput< _TImage >( "Output" );
+ this->m_Parameters.ConfigureAsUint( "NeighborhoodOrder", 1 );
this->m_Parameters.ConfigureAsBool( "VisualDebug", false );
this->m_Parameters.ConfigureAsBool( "StopAtOneFront", false );
}
// -------------------------------------------------------------------------
-fpaPlugins::BaseImageFilter::
-~BaseImageFilter( )
+fpaPluginsImageAlgorithms::BaseFilter::
+~BaseFilter( )
{
}
--- /dev/null
+#ifndef __fpaPluginsImageAlgorithms__BaseFilter__h__
+#define __fpaPluginsImageAlgorithms__BaseFilter__h__
+
+#include <fpaPluginsImageAlgorithms_Export.h>
+#include <cpPlugins/BaseObjects/ProcessObject.h>
+#include <vtkPolyData.h>
+#include <fpa/Image/Functors/SimpleNeighborhood.h>
+
+namespace fpaPluginsImageAlgorithms
+{
+ /**
+ */
+ class fpaPluginsImageAlgorithms_EXPORT BaseFilter
+ : public cpPlugins::BaseObjects::ProcessObject
+ {
+ public:
+ typedef BaseFilter Self;
+ typedef cpPlugins::BaseObjects::ProcessObject Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
+
+ public:
+ itkTypeMacro( BaseFilter, cpPlugins::BaseObjects::ProcessObject );
+ cpPlugins_Id_Macro( BaseFilter, fpaImageAlgorithm );
+
+ protected:
+ BaseFilter( );
+ virtual ~BaseFilter( );
+
+ template< class _TFilter, class _TImage >
+ inline void _ConfigureFilter( _TFilter* filter, _TImage* image );
+
+ /* TODO
+
+ template< class _TFilter >
+ inline void _ExecuteFilter( _TFilter* filter );
+
+ template< class _TFilter >
+ inline void _ConfigureDebugger( _TFilter* filter );
+
+ template< class _TFilter >
+ inline void _DeconfigureDebugger( _TFilter* filter );
+ */
+
+ private:
+ // Purposely not implemented.
+ BaseFilter( const Self& other );
+ Self& operator=( const Self& other );
+ };
+
+} // ecapseman
+
+// -------------------------------------------------------------------------
+ template< class _TFilter, class _TImage >
+void fpaPluginsImageAlgorithms::BaseFilter::
+_ConfigureFilter( _TFilter* filter, _TImage* image )
+{
+ typedef typename _TFilter::TNeighborhoodFunction _TNeighborhood;
+ typedef fpa::Image::Functors::SimpleNeighborhood< _TImage > _TSimpleNeigh;
+
+ // Simple configuration
+ filter->SetInput( image );
+ filter->SetStopAtOneFront( this->m_Parameters.GetBool( "StopAtOneFront" ) );
+
+ // Neighborhood function
+ auto neig = this->GetInputData< _TNeighborhood >( "Neighborhood" );
+ if( neig == NULL )
+ {
+ typename _TSimpleNeigh::Pointer sfunc = _TSimpleNeigh::New( );
+ sfunc->SetOrder( this->m_Parameters.GetUint( "NeighborhoodOrder" ) );
+ filter->SetNeighborhoodFunction( sfunc );
+ }
+ else
+ filter->SetNeighborhoodFunction( neig );
+
+ // Assign seeds
+ auto seeds = this->GetInputData< vtkPolyData >( "Seeds" );
+ if( seeds != NULL )
+ {
+ typename _TImage::PointType pnt;
+ typename _TImage::IndexType idx;
+ unsigned int dim =
+ ( _TImage::ImageDimension < 3 )? _TImage::ImageDimension: 3;
+
+ for( int i = 0; i < seeds->GetNumberOfPoints( ); ++i )
+ {
+ double buf[ 3 ];
+ seeds->GetPoint( i, buf );
+ pnt.Fill( 0 );
+ for( unsigned int d = 0; d < dim; ++d )
+ pnt[ d ] = buf[ d ];
+
+ if( image->TransformPhysicalPointToIndex( pnt, idx ) )
+ filter->AddSeed( idx, 0 );
+
+ } // rof
+
+ } // fi
+}
+
+#endif // __fpaPluginsImageAlgorithms__BaseFilter__h__
+
+// eof - $RCSfile$
-#include <Plugins/ImageDijkstra.h>
+#include <ImageAlgorithms/Dijkstra.h>
#include <cpInstances/Image.h>
-#include <cpInstances/Image_Demanglers.h>
#include <fpa/Image/Dijkstra.h>
-#include <vtkPolyData.h>
// -------------------------------------------------------------------------
-fpaPlugins::ImageDijkstra::
-ImageDijkstra( )
+fpaPluginsImageAlgorithms::Dijkstra::
+Dijkstra( )
: Superclass( )
{
typedef cpPlugins::BaseObjects::DataObject _TData;
- typedef cpInstances::Image _TMST;
+ typedef cpInstances::Image _TMST;
this->_ConfigureInput< _TData >( "Cost", false, false );
this->_ConfigureInput< _TData >( "CostConversion", false, false );
}
// -------------------------------------------------------------------------
-fpaPlugins::ImageDijkstra::
-~ImageDijkstra( )
+fpaPluginsImageAlgorithms::Dijkstra::
+~Dijkstra( )
{
}
// -------------------------------------------------------------------------
-void fpaPlugins::ImageDijkstra::
+void fpaPluginsImageAlgorithms::Dijkstra::
_GenerateData( )
{
auto o = this->GetInputData( "Input" );
// -------------------------------------------------------------------------
template< class _TImage >
-void fpaPlugins::ImageDijkstra::
+void fpaPluginsImageAlgorithms::Dijkstra::
_GD0( _TImage* image )
{
typedef itk::Image< float, _TImage::ImageDimension > _TFloat;
// -------------------------------------------------------------------------
template< class _TInputImage, class _TOutputImage >
-void fpaPlugins::ImageDijkstra::
+void fpaPluginsImageAlgorithms::Dijkstra::
_GD1( _TInputImage* image )
{
typedef fpa::Image::Dijkstra< _TInputImage, _TOutputImage > _TFilter;
typedef typename _TFilter::TCostConversionFunction _TCostConversion;
typedef typename _TFilter::TCostFunction _TCost;
- typedef typename _TFilter::TNeighborhoodFunction _TNeighborhood;
- // Get functors
- auto neig = this->GetInputData< _TNeighborhood >( "Neighborhood" );
+ auto filter = this->_CreateITK< _TFilter >( );
+ this->_ConfigureFilter( filter, image );
auto cost = this->GetInputData< _TCost >( "Cost" );
auto conv = this->GetInputData< _TCostConversion >( "CostConversion" );
-
- // Configure filter
- auto filter = this->_CreateITK< _TFilter >( );
- filter->SetInput( image );
- if( neig != NULL )
- filter->SetNeighborhoodFunction( neig );
if( cost != NULL )
filter->SetCostFunction( cost );
if( conv != NULL )
filter->SetCostConversionFunction( conv );
- filter->SetStopAtOneFront( this->m_Parameters.GetBool( "StopAtOneFront" ) );
-
- // Assign seeds
- auto seeds = this->GetInputData< vtkPolyData >( "Seeds" );
- if( seeds != NULL )
- {
- typename _TInputImage::PointType pnt;
- typename _TInputImage::IndexType idx;
- unsigned int dim =
- ( _TInputImage::ImageDimension < 3 )? _TInputImage::ImageDimension: 3;
-
- for( int i = 0; i < seeds->GetNumberOfPoints( ); ++i )
- {
- double buf[ 3 ];
- seeds->GetPoint( i, buf );
- pnt.Fill( 0 );
- for( unsigned int d = 0; d < dim; ++d )
- pnt[ d ] = buf[ d ];
-
- if( image->TransformPhysicalPointToIndex( pnt, idx ) )
- filter->AddSeed( idx, 0 );
-
- } // rof
-
- } // fi
-
- // Assign outputs
filter->Update( );
this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
this->GetOutput( "MST" )->SetITK( filter->GetMinimumSpanningTree( ) );
--- /dev/null
+#ifndef __fpaPluginsImageAlgorithms__Dijkstra__h__
+#define __fpaPluginsImageAlgorithms__Dijkstra__h__
+
+#include <ImageAlgorithms/BaseFilter.h>
+
+namespace fpaPluginsImageAlgorithms
+{
+ /**
+ */
+ class fpaPluginsImageAlgorithms_EXPORT Dijkstra
+ : public BaseFilter
+ {
+ cpPluginsObject( Dijkstra, BaseFilter, fpaImageAlgorithms );
+
+ protected:
+ template< class _TImage >
+ inline void _GD0( _TImage* image );
+
+ template< class _TInputImage, class _TOutputPixel >
+ inline void _GD1( _TInputImage* image );
+ };
+
+} // ecapseman
+
+#endif // __fpaPluginsImageAlgorithms__Dijkstra__h__
+
+// eof - $RCSfile$
--- /dev/null
+header #define ITK_MANUAL_INSTANTIATION
+
+tinclude fpa/Image/Functors/SimpleNeighborhood:h|hxx
+instances fpa::Image::Functors::SimpleNeighborhood< itk::Image< #scalar_types#, #pdims# > >
+
+cinclude fpa/Base/RegionGrow.hxx
+define all_int_types=#int_types#;#uint_types#
+tinclude fpa/Image/RegionGrow:h|hxx
+instances fpa::Image::RegionGrow< itk::Image< #scalar_types#, #pdims# >, itk::Image< #all_int_types#, #pdims# > >
+
+cinclude fpa/Base/Dijkstra.hxx
+tinclude fpa/Image/Dijkstra:h|hxx
+instances fpa::Image::Dijkstra< itk::Image< #scalar_types#, #pdims# >, itk::Image< #real_types#, #pdims# > >
+
+tinclude fpa/Image/SkeletonFilter:h|hxx
+instances fpa::Image::SkeletonFilter< itk::Image< #real_types#, #pdims# > >
+
+
+
+*define i_real=#real_types#
+*define o_real=#real_types#
+
+*tinclude fpa/Image/Functors/SimpleDijkstraCost:h|hxx
+*tinclude fpa/Base/Functors/Inverse:h|hxx
+*tinclude fpa/Base/Functors/GaussianModel:h|hxx
+*tinclude fpa/Image/Dijkstra:h|hxx
+*tinclude fpa/Image/SkeletonFilter:h|hxx
+*tinclude fpa/Image/Functors/RegionGrowBinaryThreshold:h|hxx
+
+*cinclude itkImage.h
+*cinclude itkSimpleDataObjectDecorator.hxx
+*cinclude fpa/Base/Dijkstra.hxx
+
+*instances fpa::Image::Functors::SimpleNeighborhood< itk::Image< #scalar_pixels#, #process_dims# > >
+*instances fpa::Image::Functors::SimpleDijkstraCost< itk::Image< #scalar_pixels#, #process_dims# >, #real_types# >
+*instances fpa::Image::Functors::RegionGrowBinaryThreshold< itk::Image< #scalar_pixels#, #process_dims# > >
+
+*instances fpa::Base::Functors::Inverse< #i_real#, #o_real# >
+*instances fpa::Base::Functors::GaussianModel< #i_real#, #o_real# >
+
+*instances fpa::Image::Dijkstra< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #real_types#, #process_dims# > >
+*instances fpa::Image::RegionGrow< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #int_types#, #process_dims# > >
+*instances fpa::Image::RegionGrow< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #uint_types#, #process_dims# > >
+*instances fpa::Image::SkeletonFilter< itk::Image< #real_types#, #process_dims# > >
+
+** eof - $RCSfile$
-#include <Plugins/ImageRegionGrow.h>
+#include <ImageAlgorithms/RegionGrow.h>
#include <cpInstances/Image.h>
-#include <cpInstances/Image_Demanglers.h>
#include <fpa/Image/RegionGrow.h>
-#include <vtkPolyData.h>
// -------------------------------------------------------------------------
-fpaPlugins::ImageRegionGrow::
-ImageRegionGrow( )
+fpaPluginsImageAlgorithms::RegionGrow::
+RegionGrow( )
: Superclass( )
{
typedef cpPlugins::BaseObjects::DataObject _TData;
- typedef cpInstances::Image _TMST;
this->_ConfigureInput< _TData >( "GrowFunction", true, false );
-
this->m_Parameters.ConfigureAsInt( "InsideValue", 1 );
this->m_Parameters.ConfigureAsInt( "OutsideValue", 0 );
this->m_Parameters.ConfigureAsIntTypesChoices( "ResultType" );
}
// -------------------------------------------------------------------------
-fpaPlugins::ImageRegionGrow::
-~ImageRegionGrow( )
+fpaPluginsImageAlgorithms::RegionGrow::
+~RegionGrow( )
{
}
// -------------------------------------------------------------------------
-void fpaPlugins::ImageRegionGrow::
+void fpaPluginsImageAlgorithms::RegionGrow::
_GenerateData( )
{
auto o = this->GetInputData( "Input" );
// -------------------------------------------------------------------------
template< class _TImage >
-void fpaPlugins::ImageRegionGrow::
+void fpaPluginsImageAlgorithms::RegionGrow::
_GD0( _TImage* image )
{
auto rtype = this->m_Parameters.GetSelectedChoice( "ResultType" );
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_char
if( rtype == "char" ) this->_GD1< _TImage, char >( image );
if( rtype == "uchar" ) this->_GD1< _TImage, unsigned char >( image );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_char
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_short
if( rtype == "short" ) this->_GD1< _TImage, short >( image );
if( rtype == "ushort" ) this->_GD1< _TImage, unsigned short >( image );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_short
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_int
if( rtype == "int" ) this->_GD1< _TImage, int >( image );
if( rtype == "uint" ) this->_GD1< _TImage, unsigned int >( image );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_int
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_long
if( rtype == "long" ) this->_GD1< _TImage, long >( image );
if( rtype == "ulong" ) this->_GD1< _TImage, unsigned long >( image );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_long
}
// -------------------------------------------------------------------------
template< class _TInputImage, class _TOutputPixel >
-void fpaPlugins::ImageRegionGrow::
+void fpaPluginsImageAlgorithms::RegionGrow::
_GD1( _TInputImage* image )
{
- std::cout << "--------------> again <-----------------" << std::endl;
-
typedef
itk::Image< _TOutputPixel, _TInputImage::ImageDimension >
_TOutputImage;
typedef fpa::Image::RegionGrow< _TInputImage, _TOutputImage > _TFilter;
- typedef typename _TFilter::TGrowFunction _TGrow;
- typedef typename _TFilter::TNeighborhoodFunction _TNeighborhood;
-
- // Get functors
- auto neig = this->GetInputData< _TNeighborhood >( "Neighborhood" );
- auto grow = this->GetInputData< _TGrow >( "GrowFunction" );
+ typedef typename _TFilter::TGrowFunction _TGrow;
- // Configure filter
auto filter = this->_CreateITK< _TFilter >( );
- filter->SetInput( image );
- filter->SetGrowFunction( grow );
+ this->_ConfigureFilter( filter, image );
+ filter->SetGrowFunction( this->GetInputData< _TGrow >( "GrowFunction" ) );
filter->SetInsideValue( this->m_Parameters.GetInt( "InsideValue" ) );
filter->SetOutsideValue( this->m_Parameters.GetInt( "OutsideValue" ) );
- filter->SetStopAtOneFront( this->m_Parameters.GetBool( "StopAtOneFront" ) );
-
- // Assign seeds
- auto seeds = this->GetInputData< vtkPolyData >( "Seeds" );
- if( seeds != NULL )
- {
- typename _TInputImage::PointType pnt;
- typename _TInputImage::IndexType idx;
- unsigned int dim =
- ( _TInputImage::ImageDimension < 3 )? _TInputImage::ImageDimension: 3;
-
- for( int i = 0; i < seeds->GetNumberOfPoints( ); ++i )
- {
- double buf[ 3 ];
- seeds->GetPoint( i, buf );
- pnt.Fill( 0 );
- for( unsigned int d = 0; d < dim; ++d )
- pnt[ d ] = buf[ d ];
-
- if( image->TransformPhysicalPointToIndex( pnt, idx ) )
- filter->AddSeed( idx, 0 );
-
- } // rof
-
- } // fi
-
- // Assign outputs
filter->Update( );
this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
}
--- /dev/null
+#ifndef __fpaPluginsImageAlgorithms__RegionGrow__h__
+#define __fpaPluginsImageAlgorithms__RegionGrow__h__
+
+#include <ImageAlgorithms/BaseFilter.h>
+
+namespace fpaPluginsImageAlgorithms
+{
+ /**
+ */
+ class fpaPluginsImageAlgorithms_EXPORT RegionGrow
+ : public BaseFilter
+ {
+ cpPluginsObject( RegionGrow, BaseFilter, fpaImageAlgorithms );
+
+ protected:
+ template< class _TImage >
+ inline void _GD0( _TImage* image );
+
+ template< class _TInputImage, class _TOutputPixel >
+ inline void _GD1( _TInputImage* image );
+ };
+
+} // ecapseman
+
+#endif // __fpaPluginsImageAlgorithms__RegionGrow__h__
+
+// eof - $RCSfile$
-#include <Plugins/SkeletonFilter.h>
+#include <ImageAlgorithms/SkeletonFilter.h>
#include <cpInstances/Image.h>
-#include <cpInstances/Image_Demanglers.h>
#include <cpInstances/Skeleton.h>
#include <fpa/Image/SkeletonFilter.h>
#include <vtkPolyData.h>
// -------------------------------------------------------------------------
-fpaPlugins::SkeletonFilter::
+fpaPluginsImageAlgorithms::SkeletonFilter::
SkeletonFilter( )
: Superclass( )
{
}
// -------------------------------------------------------------------------
-fpaPlugins::SkeletonFilter::
+fpaPluginsImageAlgorithms::SkeletonFilter::
~SkeletonFilter( )
{
}
// -------------------------------------------------------------------------
-void fpaPlugins::SkeletonFilter::
+void fpaPluginsImageAlgorithms::SkeletonFilter::
_GenerateData( )
{
auto o = this->GetInputData( "Input" );
// -------------------------------------------------------------------------
template< class _TImage >
-void fpaPlugins::SkeletonFilter::
+void fpaPluginsImageAlgorithms::SkeletonFilter::
_GD0( _TImage* image )
{
typedef fpa::Image::SkeletonFilter< _TImage > _TFilter;
-#ifndef __fpa__Plugins__SkeletonFilter__h__
-#define __fpa__Plugins__SkeletonFilter__h__
+#ifndef __fpaPluginsImageAlgorithms__SkeletonFilter__h__
+#define __fpaPluginsImageAlgorithms__SkeletonFilter__h__
-#include <fpaPlugins_Export.h>
+#include <fpaPluginsImageAlgorithms_Export.h>
#include <cpPlugins/BaseObjects/ProcessObject.h>
-namespace fpaPlugins
+namespace fpaPluginsImageAlgorithms
{
/**
*/
- class fpaPlugins_EXPORT SkeletonFilter
+ class fpaPluginsImageAlgorithms_EXPORT SkeletonFilter
: public cpPlugins::BaseObjects::ProcessObject
{
cpPluginsObject(
SkeletonFilter,
cpPlugins::BaseObjects::ProcessObject,
- fpa
+ fpaImageAlgorithms
);
protected:
} // ecapseman
-#endif // __fpa__Plugins__SkeletonFilter__h__
+#endif // __fpaPluginsImageAlgorithms__SkeletonFilter__h__
// eof - $RCSfile$
+++ /dev/null
-#ifndef __fpa__Plugins__BaseImageFilter__h__
-#define __fpa__Plugins__BaseImageFilter__h__
-
-#include <fpaPlugins_Export.h>
-#include <cpPlugins/BaseObjects/ProcessObject.h>
-
-namespace fpaPlugins
-{
- /**
- */
- class fpaPlugins_EXPORT BaseImageFilter
- : public cpPlugins::BaseObjects::ProcessObject
- {
- public:
- typedef BaseImageFilter Self;
- typedef cpPlugins::BaseObjects::ProcessObject Superclass;
- typedef itk::SmartPointer< Self > Pointer;
- typedef itk::SmartPointer< const Self > ConstPointer;
-
- public:
- itkTypeMacro( BaseImageFilter, cpPlugins::BaseObjects::ProcessObject );
- cpPlugins_Id_Macro( BaseImageFilter, fpaImageAlgorithm );
-
- protected:
- BaseImageFilter( );
- virtual ~BaseImageFilter( );
-
- /* TODO
- template< class _TFilter >
- inline _TFilter* _ConfigureFilter( );
-
- template< class _TFilter >
- inline void _ExecuteFilter( _TFilter* filter );
-
- template< class _TFilter >
- inline void _ConfigureDebugger( _TFilter* filter );
-
- template< class _TFilter >
- inline void _DeconfigureDebugger( _TFilter* filter );
- */
-
- private:
- // Purposely not implemented.
- BaseImageFilter( const Self& other );
- Self& operator=( const Self& other );
- };
-
-} // ecapseman
-
-#endif // __fpa__Plugins__BaseImageFilter__h__
-
-// eof - $RCSfile$
+++ /dev/null
-#ifndef __fpa__Plugins__ExtractPathFromMinimumSpanningTree__h__
-#define __fpa__Plugins__ExtractPathFromMinimumSpanningTree__h__
-
-#include <fpaPlugins_Export.h>
-#include <cpPlugins/BaseObjects/ProcessObject.h>
-
-namespace fpaPlugins
-{
- /**
- */
- class fpaPlugins_EXPORT ExtractPathFromMinimumSpanningTree
- : public cpPlugins::BaseObjects::ProcessObject
- {
- cpPluginsObject(
- ExtractPathFromMinimumSpanningTree,
- cpPlugins::BaseObjects::ProcessObject,
- fpa
- );
-
- protected:
- template< class _TMST >
- inline void _GD0( _TMST* mst );
- };
-
-} // ecapseman
-
-#endif // __fpa__Plugins__ExtractPathFromMinimumSpanningTree__h__
-
-// eof - $RCSfile$
+++ /dev/null
-#ifndef __fpa__Plugins__ImageDijkstra__h__
-#define __fpa__Plugins__ImageDijkstra__h__
-
-#include <Plugins/BaseImageFilter.h>
-
-namespace fpaPlugins
-{
- /**
- */
- class fpaPlugins_EXPORT ImageDijkstra
- : public BaseImageFilter
- {
- cpPluginsObject( ImageDijkstra, BaseImageFilter, fpa );
-
- protected:
- template< class _TImage >
- inline void _GD0( _TImage* image );
-
- template< class _TInputImage, class _TOutputImage >
- inline void _GD1( _TInputImage* image );
- };
-
-} // ecapseman
-
-#endif // __fpa__Plugins__ImageDijkstra__h__
-
-// eof - $RCSfile$
+++ /dev/null
-#ifndef __fpa__Plugins__ImageRegionGrow__h__
-#define __fpa__Plugins__ImageRegionGrow__h__
-
-#include <Plugins/BaseImageFilter.h>
-
-namespace fpaPlugins
-{
- /**
- */
- class fpaPlugins_EXPORT ImageRegionGrow
- : public BaseImageFilter
- {
- cpPluginsObject( ImageRegionGrow, BaseImageFilter, fpa );
-
- protected:
- template< class _TImage >
- inline void _GD0( _TImage* image );
-
- template< class _TInputImage, class _TOutputPixel >
- inline void _GD1( _TInputImage* image );
- };
-
-} // ecapseman
-
-#endif // __fpa__Plugins__ImageRegionGrow__h__
-
-// eof - $RCSfile$
+++ /dev/null
-#include <Plugins/RegionGrowBinaryThreshold.h>
-#include <cpInstances/Image.h>
-#include <cpInstances/Image_Demanglers.h>
-
-#include <itkImage.h>
-#include <fpa/Image/Functors/RegionGrowBinaryThreshold.h>
-
-// -------------------------------------------------------------------------
-fpaPlugins::RegionGrowBinaryThreshold::
-RegionGrowBinaryThreshold( )
- : Superclass( )
-{
- typedef cpPlugins::BaseObjects::DataObject _TData;
- typedef cpInstances::Image _TImage;
-
- this->_ConfigureInput< _TImage >( "Input", true, false );
- this->_ConfigureOutput< _TData >( "Output" );
-
- this->m_Parameters.ConfigureAsReal( "LowerThreshold", 0 );
- this->m_Parameters.ConfigureAsReal( "UpperThreshold", 0 );
-}
-
-// -------------------------------------------------------------------------
-fpaPlugins::RegionGrowBinaryThreshold::
-~RegionGrowBinaryThreshold( )
-{
-}
-
-// -------------------------------------------------------------------------
-void fpaPlugins::RegionGrowBinaryThreshold::
-_GenerateData( )
-{
- auto o = this->GetInputData( "Input" );
- cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( o, _GD0 )
- this->_Error( "Invalid input image." );
-}
-
-// -------------------------------------------------------------------------
-template< class _TImage >
-void fpaPlugins::RegionGrowBinaryThreshold::
-_GD0( _TImage* image )
-{
- typedef
- fpa::Image::Functors::RegionGrowBinaryThreshold< _TImage >
- _TFunctor;
- auto out = this->GetOutput( "Output" );
- auto f = out->GetITK< _TFunctor >( );
- if( f == NULL )
- {
- typename _TFunctor::Pointer ptr_f = _TFunctor::New( );
- f = ptr_f.GetPointer( );
- out->SetITK( f );
-
- } // fi
- f->SetLowerThreshold( this->m_Parameters.GetReal( "LowerThreshold" ) );
- f->SetUpperThreshold( this->m_Parameters.GetReal( "UpperThreshold" ) );
-}
-
-// eof - $RCSfile$
+++ /dev/null
-#ifndef __fpa__Plugins__RegionGrowBinaryThreshold__h__
-#define __fpa__Plugins__RegionGrowBinaryThreshold__h__
-
-#include <fpaPlugins_Export.h>
-#include <cpPlugins/BaseObjects/ProcessObject.h>
-
-namespace fpaPlugins
-{
- /**
- */
- class fpaPlugins_EXPORT RegionGrowBinaryThreshold
- : public cpPlugins::BaseObjects::ProcessObject
- {
- cpPluginsObject(
- RegionGrowBinaryThreshold,
- cpPlugins::BaseObjects::ProcessObject,
- fpaFunctors
- );
-
- protected:
- template< class _TImage >
- inline void _GD0( _TImage* image );
- };
-
-} // ecapseman
-
-#endif // __fpa__Plugins__RegionGrowBinaryThreshold__h__
-
-// eof - $RCSfile$
+++ /dev/null
-#ifndef __fpa__Plugins__RegionGrowBinaryThresholdWithSeeds__h__
-#define __fpa__Plugins__RegionGrowBinaryThresholdWithSeeds__h__
-
-#include <fpaPlugins_Export.h>
-#include <cpPlugins/BaseObjects/ProcessObject.h>
-
-namespace fpaPlugins
-{
- /**
- */
- class fpaPlugins_EXPORT RegionGrowBinaryThresholdWithSeeds
- : public cpPlugins::BaseObjects::ProcessObject
- {
- cpPluginsObject(
- RegionGrowBinaryThresholdWithSeeds,
- cpPlugins::BaseObjects::ProcessObject,
- fpaFunctors
- );
-
- protected:
- template< class _TImage >
- inline void _GD0( _TImage* image );
- };
-
-} // ecapseman
-
-#endif // __fpa__Plugins__RegionGrowBinaryThresholdWithSeeds__h__
-
-// eof - $RCSfile$
+++ /dev/null
-#include <Plugins/SimpleImageNeighborhood.h>
-#include <cpInstances/Image.h>
-#include <cpInstances/Image_Demanglers.h>
-
-#include <itkImage.h>
-#include <fpa/Image/Functors/SimpleNeighborhood.h>
-
-// -------------------------------------------------------------------------
-fpaPlugins::SimpleImageNeighborhood::
-SimpleImageNeighborhood( )
- : Superclass( )
-{
- typedef cpPlugins::BaseObjects::DataObject _TData;
- typedef cpInstances::Image _TImage;
-
- this->_ConfigureInput< _TImage >( "Input", true, false );
- this->_ConfigureOutput< _TData >( "Output" );
-
- this->m_Parameters.ConfigureAsUint( "Order", 1 );
-}
-
-// -------------------------------------------------------------------------
-fpaPlugins::SimpleImageNeighborhood::
-~SimpleImageNeighborhood( )
-{
-}
-
-// -------------------------------------------------------------------------
-void fpaPlugins::SimpleImageNeighborhood::
-_GenerateData( )
-{
- auto o = this->GetInputData( "Input" );
- cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( o, _GD0 )
- this->_Error( "Invalid input image." );
-}
-
-// -------------------------------------------------------------------------
-template< class _TImage >
-void fpaPlugins::SimpleImageNeighborhood::
-_GD0( _TImage* image )
-{
- typedef fpa::Image::Functors::SimpleNeighborhood< _TImage > _TFunctor;
- auto out = this->GetOutput( "Output" );
- auto f = out->GetITK< _TFunctor >( );
- if( f == NULL )
- {
- typename _TFunctor::Pointer ptr_f = _TFunctor::New( );
- f = ptr_f.GetPointer( );
- out->SetITK( f );
-
- } // fi
- f->SetOrder( this->m_Parameters.GetUint( "Order" ) );
-}
-
-// eof - $RCSfile$
+++ /dev/null
-#ifndef __fpa__Plugins__SimpleImageNeighborhood__h__
-#define __fpa__Plugins__SimpleImageNeighborhood__h__
-
-#include <fpaPlugins_Export.h>
-#include <cpPlugins/BaseObjects/ProcessObject.h>
-
-namespace fpaPlugins
-{
- /**
- */
- class fpaPlugins_EXPORT SimpleImageNeighborhood
- : public cpPlugins::BaseObjects::ProcessObject
- {
- cpPluginsObject(
- SimpleImageNeighborhood,
- cpPlugins::BaseObjects::ProcessObject,
- fpaFunctors
- );
-
- protected:
- template< class _TImage >
- inline void _GD0( _TImage* image );
- };
-
-} // ecapseman
-
-#endif // __fpa__Plugins__SimpleImageNeighborhood__h__
-
-// eof - $RCSfile$
+++ /dev/null
-header #define ITK_MANUAL_INSTANTIATION
-
-define i_real=#real_types#
-define o_real=#real_types#
-
-tinclude fpa/Image/Functors/SimpleNeighborhood:h|hxx
-tinclude fpa/Image/Functors/SimpleDijkstraCost:h|hxx
-tinclude fpa/Base/Functors/Inverse:h|hxx
-tinclude fpa/Base/Functors/GaussianModel:h|hxx
-tinclude fpa/Image/RegionGrow:h|hxx
-tinclude fpa/Image/Dijkstra:h|hxx
-tinclude fpa/Image/SkeletonFilter:h|hxx
-tinclude fpa/Image/Functors/RegionGrowBinaryThreshold:h|hxx
-
-cinclude itkImage.h
-cinclude itkSimpleDataObjectDecorator.hxx
-cinclude fpa/Base/RegionGrow.hxx
-cinclude fpa/Base/Dijkstra.hxx
-
-instances fpa::Image::Functors::SimpleNeighborhood< itk::Image< #scalar_pixels#, #process_dims# > >
-instances fpa::Image::Functors::SimpleDijkstraCost< itk::Image< #scalar_pixels#, #process_dims# >, #real_types# >
-instances fpa::Image::Functors::RegionGrowBinaryThreshold< itk::Image< #scalar_pixels#, #process_dims# > >
-
-instances fpa::Base::Functors::Inverse< #i_real#, #o_real# >
-instances fpa::Base::Functors::GaussianModel< #i_real#, #o_real# >
-
-instances fpa::Image::Dijkstra< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #real_types#, #process_dims# > >
-instances fpa::Image::RegionGrow< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #int_types#, #process_dims# > >
-instances fpa::Image::RegionGrow< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #uint_types#, #process_dims# > >
-instances fpa::Image::SkeletonFilter< itk::Image< #real_types#, #process_dims# > >
-
-** eof - $RCSfile$
-#include <Plugins/RegionGrowBinaryThresholdWithSeeds.h>
+#include <RegionGrowFunctors/BinaryThreshold.h>
#include <cpInstances/Image.h>
-#include <cpInstances/Image_Demanglers.h>
#include <fpa/Image/Functors/RegionGrowBinaryThreshold.h>
#include <itkConstNeighborhoodIterator.h>
#include <vtkPolyData.h>
// -------------------------------------------------------------------------
-fpaPlugins::RegionGrowBinaryThresholdWithSeeds::
-RegionGrowBinaryThresholdWithSeeds( )
+fpaPluginsRegionGrowFunctors::BinaryThreshold::
+BinaryThreshold( )
: Superclass( )
{
typedef cpPlugins::BaseObjects::DataObject _TData;
typedef cpInstances::Image _TImage;
this->_ConfigureInput< _TImage >( "Input", true, false );
- this->_ConfigureInput< _TData >( "Seeds", true, false );
+ this->_ConfigureInput< _TData >( "Seeds", false, false );
this->_ConfigureOutput< _TData >( "Output" );
this->m_Parameters.ConfigureAsUint( "Radius", 1 );
+ this->m_Parameters.ConfigureAsReal( "LowerThreshold", 0 );
+ this->m_Parameters.ConfigureAsReal( "UpperThreshold", 0 );
}
// -------------------------------------------------------------------------
-fpaPlugins::RegionGrowBinaryThresholdWithSeeds::
-~RegionGrowBinaryThresholdWithSeeds( )
+fpaPluginsRegionGrowFunctors::BinaryThreshold::
+~BinaryThreshold( )
{
}
// -------------------------------------------------------------------------
-void fpaPlugins::RegionGrowBinaryThresholdWithSeeds::
+void fpaPluginsRegionGrowFunctors::BinaryThreshold::
_GenerateData( )
{
auto o = this->GetInputData( "Input" );
// -------------------------------------------------------------------------
template< class _TImage >
-void fpaPlugins::RegionGrowBinaryThresholdWithSeeds::
+void fpaPluginsRegionGrowFunctors::BinaryThreshold::
_GD0( _TImage* image )
{
typedef itk::ConstNeighborhoodIterator< _TImage > _TInIt;
// Compute thresholds from seeds
auto seeds = this->GetInputData< vtkPolyData >( "Seeds" );
- std::vector< typename _TImage::IndexType > indices;
if( seeds != NULL )
{
+ std::vector< typename _TImage::IndexType > indices;
typename _TImage::PointType pnt;
typename _TImage::IndexType idx;
unsigned int dim =
} // rof
- } // fi
-
- typename _TImage::SizeType r;
- r.Fill( this->m_Parameters.GetUint( "Radius" ) );
- _TInIt iIt( r, image, image->GetRequestedRegion( ) );
- double v_s1 = double( 0 );
- double v_s2 = double( 0 );
- double v_n = double( 0 );
- double v_min = std::numeric_limits< double >::max( );
- double v_max = -v_min;
- for( auto idxIt = indices.begin( ); idxIt != indices.end( ); ++idxIt )
- {
- iIt.SetLocation( *idxIt );
- for( unsigned int i = 0; i < iIt.Size( ); ++i )
+ typename _TImage::SizeType r;
+ r.Fill( this->m_Parameters.GetUint( "Radius" ) );
+ _TInIt iIt( r, image, image->GetRequestedRegion( ) );
+ double v_s1 = double( 0 );
+ double v_s2 = double( 0 );
+ double v_n = double( 0 );
+ double v_min = std::numeric_limits< double >::max( );
+ double v_max = -v_min;
+ for( auto idxIt = indices.begin( ); idxIt != indices.end( ); ++idxIt )
{
- double v = double( iIt.GetPixel( i ) );
- v_s1 += v;
- v_s2 += v * v;
- v_n += double( 1 );
- v_min = ( v < v_min )? v: v_min;
- v_max = ( v_max < v )? v: v_max;
+ iIt.SetLocation( *idxIt );
+ for( unsigned int i = 0; i < iIt.Size( ); ++i )
+ {
+ double v = double( iIt.GetPixel( i ) );
+ v_s1 += v;
+ v_s2 += v * v;
+ v_n += double( 1 );
+ v_min = ( v < v_min )? v: v_min;
+ v_max = ( v_max < v )? v: v_max;
+
+ } // rof
} // rof
+ double s = ( v_s2 - ( ( v_s1 * v_s1 ) / v_n ) ) / ( v_n - double( 1 ) );
+ s = std::sqrt( s ) / double( 2 );
+ f->SetLowerThreshold( v_min );
+ f->SetUpperThreshold( v_max );
+ }
+ else
+ {
+ f->SetLowerThreshold( this->m_Parameters.GetReal( "LowerThreshold" ) );
+ f->SetUpperThreshold( this->m_Parameters.GetReal( "UpperThreshold" ) );
- } // rof
- double s = ( v_s2 - ( ( v_s1 * v_s1 ) / v_n ) ) / ( v_n - double( 1 ) );
- s = std::sqrt( s ) / double( 2 );
-
- f->SetLowerThreshold( v_min );
- f->SetUpperThreshold( v_max );
+ } // fi
}
// eof - $RCSfile$
--- /dev/null
+#ifndef __fpaPluginsRegionGrowFunctors__BinaryThreshold__h__
+#define __fpaPluginsRegionGrowFunctors__BinaryThreshold__h__
+
+#include <fpaPluginsRegionGrowFunctors_Export.h>
+#include <cpPlugins/BaseObjects/ProcessObject.h>
+
+namespace fpaPluginsRegionGrowFunctors
+{
+ /**
+ */
+ class fpaPluginsRegionGrowFunctors_EXPORT BinaryThreshold
+ : public cpPlugins::BaseObjects::ProcessObject
+ {
+ cpPluginsObject(
+ BinaryThreshold,
+ cpPlugins::BaseObjects::ProcessObject,
+ fpaRegionGrowFunctors
+ );
+
+ protected:
+ template< class _TImage >
+ inline void _GD0( _TImage* image );
+ };
+
+} // ecapseman
+
+#endif // __fpaPluginsRegionGrowFunctors__BinaryThreshold__h__
+
+// eof - $RCSfile$
--- /dev/null
+header #define ITK_MANUAL_INSTANTIATION
+
+cinclude itkImage.h
+tinclude fpa/Image/Functors/RegionGrowBinaryThreshold:h|hxx
+instances fpa::Image::Functors::RegionGrowBinaryThreshold< itk::Image< #scalar_types#, #pdims# > >
+
+** eof - $RCSfile$