${PROJECT_BINARY_DIR}
${PROJECT_SOURCE_DIR}/lib
${PROJECT_BINARY_DIR}/lib
+ ${PROJECT_SOURCE_DIR}/lib/fpa_Instances
+ ${PROJECT_BINARY_DIR}/lib/fpa_Instances
${PROJECT_SOURCE_DIR}/plugins
${PROJECT_BINARY_DIR}/plugins
)
DESTINATION include/fpa
)
+SUBDIRS(
+ fpa_Instances
+ )
+
## eof - $RCSfile$
#include <vector>
#include <itkProcessObject.h>
-#include <itkSimpleDataObjectDecorator.h>
+#include <cpExtensions/DataStructures/ImageIndexesContainer.h>
namespace fpa
{
typedef _TMST TMinimumSpanningTree;
typedef typename _TMST::TVertex TVertex;
- typedef itk::SimpleDataObjectDecorator< std::vector< TVertex > > TVertices;
+ typedef
+ cpExtensions::DataStructures::ImageIndexesContainer< TVertex::Dimension >
+ TVertices;
public:
itkTypeMacro(
// 2.4.2. A collision has been reached
last_collision = *pIt;
collisions->Get( ).push_back( *pIt );
- std::cout << *pIt << std::endl;
inCollision = true;
}
else
} // elihw
} // rof
+
+ endpoints->SetReferenceImage( mst );
+ bifurcations->SetReferenceImage( mst );
+ collisions->SetReferenceImage( mst );
}
#endif // __FPA__BASE__EXTRACTENDPOINTSANDBIFURCATIONSFROMMINIMUMSPANNINGTREE__HXX__
#include <set>
#include <itkProcessObject.h>
-#include <itkPolyLineParametricPath.h>
+#include <cpExtensions/DataStructures/PolyLineParametricPath.h>
namespace fpa
{
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
- typedef T TMinimumSpanningTree;
- typedef typename T::TVertex TVertex;
- typedef itk::PolyLineParametricPath< TVertex::Dimension > TPath;
+ typedef T TMinimumSpanningTree;
+ typedef typename T::TVertex TVertex;
+ typedef
+ cpExtensions::DataStructures::PolyLineParametricPath< TVertex::Dimension >
+ TPath;
public:
itkNewMacro( Self );
path->Initialize( );
for( auto i = lst.begin( ); i != lst.end( ); ++i )
path->AddVertex( *i );
+ path->SetReferenceImage( tree );
}
#endif // __FPA__BASE__EXTRACTPATHFROMMINIMUMSPANNINGTREE__HXX__
#include <fpa/Base/ExtractEndPointsAndBifurcationsFromMinimumSpanningTree.h>
-#include <itkImageFileWriter.h>
-#include <itkImageFileWriter.hxx>
-#include <itkImageAlgorithm.hxx>
-
namespace fpa
{
namespace Image
virtual void _Tmp( ) override
{
- /* TODO
- static unsigned int i = 0;
- std::stringstream s;
- s << "marks_" << i << ".mhd";
- i++;
- typename itk::ImageFileWriter< TMarkImage >::Pointer w =
- itk::ImageFileWriter< TMarkImage >::New( );
- w->SetInput( this->m_MarkImage );
- w->SetFileName( s.str( ) );
- w->Update( );
- */
}
private:
const unsigned long& l
)
{
+ double rr = r * double( 1.5 );
+
// Get marking region
auto rreg = this->m_MarkImage->GetRequestedRegion( );
auto spac = this->m_MarkImage->GetSpacing( );
bool all = false;
for( unsigned int d = 0; d < _TImage::ImageDimension; ++d )
{
- unsigned long s = std::ceil( r / double( spac[ d ] ) );
+ unsigned long s = std::ceil( rr / double( spac[ d ] ) );
if( s < 3 )
{
s = 3;
{
typename _TImage::PointType pnt;
this->m_MarkImage->TransformIndexToPhysicalPoint( spIt.GetIndex( ), pnt );
- // TODO: if( double( pnt.EuclideanDistanceTo( c ) ) <= r || all )
- // TODO: if( spIt.Get( ) == 0 )
- spIt.Set( l );
+ if( double( pnt.EuclideanDistanceTo( c ) ) <= rr || all )
+ if( spIt.Get( ) == 0 )
+ spIt.Set( l );
} // rof
}
--- /dev/null
+FILE(
+ GLOB libs_DEFS RELATIVE
+ "${CMAKE_CURRENT_SOURCE_DIR}"
+ "${CMAKE_CURRENT_SOURCE_DIR}/*.i"
+ )
+
+SET(aux_ALL_INSTANCES)
+FOREACH(i ${libs_DEFS})
+ GET_FILENAME_COMPONENT(l_DEF ${i} NAME_WE)
+ SET(i_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${l_DEF}.i")
+ SET(h_FILE "${CMAKE_CURRENT_BINARY_DIR}/${l_DEF}.h")
+ SET(s_FILE "${CMAKE_CURRENT_BINARY_DIR}/${l_DEF}.cxx")
+ SET(o_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${l_DEF}_extra.cxx")
+ SET(l_NAME "fpa_${l_DEF}")
+ SET(aux_ALL_INSTANCES ${aux_ALL_INSTANCES} ${l_NAME})
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${h_FILE} ${s_FILE}
+ DEPENDS ${cpPlugins_CreateInstances} ${i_FILE}
+ COMMAND ${cpPlugins_CreateInstances} ${i_FILE} ${l_NAME} ${h_FILE} ${s_FILE}
+ )
+ IF(EXISTS ${o_FILE})
+ ADD_LIBRARY(${l_NAME} SHARED ${s_FILE} ${o_FILE})
+ ELSE(EXISTS ${o_FILE})
+ ADD_LIBRARY(${l_NAME} SHARED ${s_FILE})
+ ENDIF(EXISTS ${o_FILE})
+ SET_TARGET_PROPERTIES(
+ ${l_NAME} PROPERTIES
+ VERSION "${prj_VER}"
+ SOVERSION "${prj_sVER}"
+ )
+ GENERATE_EXPORT_HEADER(
+ ${l_NAME}
+ BASE_NAME ${l_NAME}
+ EXPORT_MACRO_NAME ${l_NAME}_EXPORT
+ EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/${l_NAME}_Export.h
+ STATIC_DEFINE ${l_NAME}_BUILT_AS_STATIC
+ )
+ENDFOREACH(i)
+
+SET(
+ fpa_ALL_INSTANCES
+ ${aux_ALL_INSTANCES}
+ CACHE STRING "All instances libraries."
+ )
+
+## Target links
+TARGET_LINK_LIBRARIES(fpa_Instances ${cpPlugins_LIBRARY} ${cpPlugins_ALL_INSTANCES_LIBRARIES})
+TARGET_LINK_LIBRARIES(fpa_Filters fpa_Instances)
+TARGET_LINK_LIBRARIES(fpa_Observers fpa_Filters)
+
+# TARGET_LINK_LIBRARIES(fpa_Transforms ${ITK_LIBRARIES} fpa_Base)
+# TARGET_LINK_LIBRARIES(fpa_Paths fpa_Base)
+# TARGET_LINK_LIBRARIES(fpa_Mesh fpa_Base)
+# TARGET_LINK_LIBRARIES(fpa_Image fpa_Base)
+# TARGET_LINK_LIBRARIES(fpa_ImageIterators ${ITK_LIBRARIES} fpa_Image)
+# TARGET_LINK_LIBRARIES(fpa_ImageFiltersBase fpa_Image)
+# TARGET_LINK_LIBRARIES(fpa_InPlaceImageFiltersBase fpa_ImageFiltersBase)
+# TARGET_LINK_LIBRARIES(fpa_ImageITK2VTK fpa_ImageFiltersBase ${VTK_LIBRARIES})
+# TARGET_LINK_LIBRARIES(fpa_ThresholdFilters fpa_InPlaceImageFiltersBase fpa_ImageIterators)
+# TARGET_LINK_LIBRARIES(fpa_DistanceMapFilters fpa_ThresholdFilters)
+# TARGET_LINK_LIBRARIES(fpa_ResamplingFilters fpa_ImageFiltersBase fpa_ImageIterators fpa_Transforms)
+# TARGET_LINK_LIBRARIES(fpa_GaussianImageFilters fpa_ImageFiltersBase fpa_ImageIterators)
+# TARGET_LINK_LIBRARIES(fpa_ImageIO fpa_ImageFiltersBase fpa_ImageIterators)
+
+# INSTALL(
+# TARGETS ${l_NAME}
+# RUNTIME DESTINATION bin
+# LIBRARY DESTINATION lib
+# ARCHIVE DESTINATION lib/static
+# )
+# INSTALL(
+# FILES
+# ${lib_HEADERS}
+# DESTINATION include/${lib_DIR}
+# )
+
+## eof - $RCSfile$
--- /dev/null
+f fpa_Instances/Instances.h
+
+t fpa/Image/RegionGrow.h
+t fpa/Image/Dijkstra.h
+t fpa/Image/Algorithm.h
+
+d #dims=2;3
+d #int=char;short;int;long
+d #uint=unsigned #int
+d #float=float;double
+d #pixels=#int;#uint;#float
+
+c fpa::Image::RegionGrow< itk::Image< #pixels, #dims >, itk::Image< #uint, #dims > >
+c fpa::Image::Dijkstra< itk::Image< #pixels, #dims >, itk::Image< #float, #dims > >
--- /dev/null
+f cpPlugins_Instances/ImageFiltersBase.h
+
+t fpa/Image/MinimumSpanningTree.h
+t fpa/Base/MinimumSpanningTree.h
+t fpa/Base/RegionGrow.h
+t fpa/Base/Dijkstra.h
+t fpa/Base/Algorithm.h
+t itkImportImageContainer.h
+t itkImage.h
+
+d #dims=2;3
+d #int=char;short;int;long
+d #uint=unsigned #int
+d #float=float;double
+d #pixels=#int;#uint;#float
+
+c itk::ImportImageContainer< unsigned long, fpa::Image::MinimumSpanningTreeData< #dims > >
+c itk::Image< fpa::Image::MinimumSpanningTreeData< #dims >, #dims >
+c fpa::Base::MinimumSpanningTree< itk::Image< fpa::Image::MinimumSpanningTreeData< #dims >, #dims >, itk::Index< #dims > >
+c fpa::Image::MinimumSpanningTree< #dims >
+c fpa::Base::Algorithm< itk::Index< #dims >, #pixels, #pixels, itk::Image< #pixels, #dims >, itk::Functor::IndexLexicographicCompare< #dims >, itk::ImageToImageFilter< itk::Image< #pixels, #dims >, itk::Image< #pixels, #dims > > >
+c fpa::Base::Dijkstra< itk::Index< #dims >, #pixels, #float, itk::Image< #pixels, #dims >, itk::Functor::IndexLexicographicCompare< #dims >, fpa::Image::MinimumSpanningTree< #dims >, itk::ImageToImageFilter< itk::Image< #pixels, #dims >, itk::Image< #float, #dims> > >
+c fpa::Base::RegionGrow< itk::Index< #dims >, #pixels, #uint, itk::Image< #pixels, #dims >, itk::Functor::IndexLexicographicCompare< #dims >, itk::ImageToImageFilter< itk::Image< #pixels, #dims >, itk::Image< #uint, #dims > > >
--- /dev/null
+f fpa_Instances/Filters.h
+
+i vtkRenderWindow.h
+
+t fpa/VTK/Image2DObserver.h
+t fpa/VTK/Image3DObserver.h
+
+d #dims=2;3
+d #int=char;short;int;long
+d #uint=unsigned #int
+d #float=float;double
+d #pixels=#int;#uint;#float
+
+c @{fpa::VTK::Image2DObserver;fpa::VTK::Image3DObserver}< fpa::Image::RegionGrow< itk::Image< #pixels, #dims >, itk::Image< #uint, #dims > >, vtkRenderWindow >
+c @{fpa::VTK::Image2DObserver;fpa::VTK::Image3DObserver}< fpa::Image::Dijkstra< itk::Image< #pixels, #dims >, itk::Image< #float, #dims > >, vtkRenderWindow >
#include "BaseImageFilter.h"
-#include <itkSimpleDataObjectDecorator.hxx>
+#include <cpPlugins/Image.h>
+//#include <itkSimpleDataObjectDecorator.hxx>
// -------------------------------------------------------------------------
bool fpaPlugins::BaseImageFilter::
protected:
TMPRWidget* m_MPRViewer;
vtkRenderWindowInteractor* m_SingleInteractor;
- std::set< unsigned long > m_Observers;
+ std::set< unsigned long > m_Observers;
};
} // ecapseman
#ifndef __FPAPLUGINS__BASEIMAGEFILTER__HXX__
#define __FPAPLUGINS__BASEIMAGEFILTER__HXX__
-#include <cpPlugins/Image.h>
-#include <fpa/VTK/Image2DObserver.h>
-#include <fpa/VTK/Image3DObserver.h>
-#include <vtkRenderWindowInteractor.h>
-
-#include <fpa/VTK/Image2DObserver.hxx>
-#include <fpa/VTK/Image3DObserver.hxx>
+#include <fpa_Instances/Observers.h>
#include <itkSimpleDataObjectDecorator.h>
+/* TODO
+ #include <cpPlugins/Image.h>
+ #include <fpa/VTK/Image2DObserver.h>
+ #include <fpa/VTK/Image3DObserver.h>
+ #include <vtkRenderWindowInteractor.h>
+
+ #include <fpa/VTK/Image2DObserver.hxx>
+ #include <fpa/VTK/Image3DObserver.hxx>
+*/
// -------------------------------------------------------------------------
template< class _TFilter >
SET(
filters_HEADERS_H
- ${CMAKE_CURRENT_SOURCE_DIR}/MinimumSpanningTreeReader.h
- ${CMAKE_CURRENT_SOURCE_DIR}/MinimumSpanningTreeWriter.h
+ #${CMAKE_CURRENT_SOURCE_DIR}/MinimumSpanningTreeReader.h
+ #${CMAKE_CURRENT_SOURCE_DIR}/MinimumSpanningTreeWriter.h
${CMAKE_CURRENT_SOURCE_DIR}/ImageRegionGrow.h
${CMAKE_CURRENT_SOURCE_DIR}/ImageDijkstra.h
${CMAKE_CURRENT_SOURCE_DIR}/ExtractPathFromMinimumSpanningTree.h
${CMAKE_CURRENT_SOURCE_DIR}/ExtractEndPointsAndBifurcationsFromMinimumSpanningTree.h
- ${CMAKE_CURRENT_SOURCE_DIR}/RegionGrowThresholdFunction.h
+ #${CMAKE_CURRENT_SOURCE_DIR}/RegionGrowThresholdFunction.h
${CMAKE_CURRENT_SOURCE_DIR}/InvertCostFunction.h
- ${CMAKE_CURRENT_SOURCE_DIR}/GradientBaseImageFunctionSource.h
+ #${CMAKE_CURRENT_SOURCE_DIR}/GradientBaseImageFunctionSource.h
)
SET(
SET(
filters_SOURCES_CXX
- ${CMAKE_CURRENT_SOURCE_DIR}/MinimumSpanningTreeReader.cxx
- ${CMAKE_CURRENT_SOURCE_DIR}/MinimumSpanningTreeWriter.cxx
+ #${CMAKE_CURRENT_SOURCE_DIR}/MinimumSpanningTreeReader.cxx
+ #${CMAKE_CURRENT_SOURCE_DIR}/MinimumSpanningTreeWriter.cxx
${CMAKE_CURRENT_SOURCE_DIR}/ImageRegionGrow.cxx
${CMAKE_CURRENT_SOURCE_DIR}/ImageDijkstra.cxx
${CMAKE_CURRENT_SOURCE_DIR}/ExtractPathFromMinimumSpanningTree.cxx
${CMAKE_CURRENT_SOURCE_DIR}/ExtractEndPointsAndBifurcationsFromMinimumSpanningTree.cxx
- ${CMAKE_CURRENT_SOURCE_DIR}/RegionGrowThresholdFunction.cxx
+ #${CMAKE_CURRENT_SOURCE_DIR}/RegionGrowThresholdFunction.cxx
${CMAKE_CURRENT_SOURCE_DIR}/InvertCostFunction.cxx
- ${CMAKE_CURRENT_SOURCE_DIR}/GradientBaseImageFunctionSource.cxx
+ #${CMAKE_CURRENT_SOURCE_DIR}/GradientBaseImageFunctionSource.cxx
)
SET(
target_LIBRARIES
+ ${fpa_ALL_INSTANCES}
${cpExtensions_LIBRARY}
- ${cpPlugins_LIBRARY}
- cpPlugins_ImageIterators
- cpPlugins_Paths
- ${ITK_LIBRARIES}
)
## =====================
ADD_CUSTOM_COMMAND(
OUTPUT ${lib_NAME}_Host.cxx
- DEPENDS ${cpPlugins_HostCreator_APP} ${filters_HEADERS_H}
- COMMAND ${cpPlugins_HostCreator_APP} ${lib_NAME}_Host.cxx ${filters_HEADERS_H}
+ DEPENDS ${cpPlugins_HostCreator} ${filters_HEADERS_H}
+ COMMAND ${cpPlugins_HostCreator} ${lib_NAME}_Host.cxx ${filters_HEADERS_H}
)
ADD_LIBRARY(
${lib_NAME}
#include "ExtractEndPointsAndBifurcationsFromMinimumSpanningTree.h"
-#include "MinimumSpanningTree.h"
#include <cpPlugins/Image.h>
+#include <cpPlugins/ImageIndexesContainer.h>
+#include <fpa_Instances/Instances.h>
#include <itkSimpleDataObjectDecorator.hxx>
#include <fpa/Image/ExtractEndPointsAndBifurcationsFromMinimumSpanningTree.h>
#include <fpa/Base/ExtractEndPointsAndBifurcationsFromMinimumSpanningTree.hxx>
this->_AddInput( "CostsImage" );
this->_AddInput( "DistanceMap" );
this->_AddInput( "MST" );
- this->_AddOutput< cpPlugins::DataObject >( "EndPoints" );
- this->_AddOutput< cpPlugins::DataObject >( "Bifurcations" );
- this->_AddOutput< cpPlugins::DataObject >( "Collisions" );
+ this->_AddOutput< cpPlugins::ImageIndexesContainer >( "EndPoints" );
+ this->_AddOutput< cpPlugins::ImageIndexesContainer >( "Bifurcations" );
+ this->_AddOutput< cpPlugins::ImageIndexesContainer >( "Collisions" );
this->m_Parameters.ConfigureAsBool( "SquaredDistanceMap" );
this->m_Parameters.SetBool( "SquaredDistanceMap", false );
#include "ExtractPathFromMinimumSpanningTree.h"
-#include "MinimumSpanningTree.h"
+#include <fpa_Instances/Instances.h>
#include <itkDataObject.h>
#include <itkIndex.h>
#include <itkSimpleDataObjectDecorator.hxx>
#include <cpPlugins_Instances/Paths.h>
-#include <cpPlugins/DataObject.h>
+#include <cpPlugins/Path.h>
#include <fpa/Base/ExtractPathFromMinimumSpanningTree.h>
#include <fpa/Base/ExtractPathFromMinimumSpanningTree.hxx>
{
this->_AddInput( "MST" );
this->_AddInput( "Seeds" );
- this->_AddOutput< cpPlugins::DataObject >( "Output" );
+ this->_AddOutput< cpPlugins::Path >( "Output" );
this->m_Parameters.ConfigureAsUint( "Vertex0" );
this->m_Parameters.ConfigureAsUint( "Vertex1" );
#include "MinimumSpanningTree.h"
#include <cpPlugins/Image.h>
-#include <fpa/Image/Dijkstra.h>
-#include <fpa/Base/Dijkstra.hxx>
-#include <fpa/Image/Dijkstra.hxx>
+#include <fpa_Instances/Filters.h>
+#include <fpa/Image/Functors/RegionGrowAllBelongsFunction.h>
+
#include <fpa/Base/Algorithm.hxx>
+#include <fpa/Base/Dijkstra.hxx>
#include <fpa/Image/Algorithm.hxx>
-#include <fpa/Base/Functors/InvertCostFunction.h>
-#include <itkSimpleDataObjectDecorator.hxx>
+#include <fpa/Image/Dijkstra.hxx>
+#include <fpa/VTK/Image2DObserver.hxx>
+#include <fpa/VTK/Image3DObserver.hxx>
// -------------------------------------------------------------------------
fpaPlugins::ImageDijkstra::
#include "ImageRegionGrow.h"
#include <cpPlugins/Image.h>
-#include <fpa/Image/RegionGrow.h>
-#include <fpa/Base/RegionGrow.hxx>
-#include <fpa/Image/RegionGrow.hxx>
+#include <fpa_Instances/Filters.h>
+#include <fpa/Image/Functors/RegionGrowAllBelongsFunction.h>
+
#include <fpa/Base/Algorithm.hxx>
+#include <fpa/Base/RegionGrow.hxx>
#include <fpa/Image/Algorithm.hxx>
-#include <fpa/Image/Functors/RegionGrowAllBelongsFunction.h>
+#include <fpa/Image/RegionGrow.hxx>
+#include <fpa/VTK/Image2DObserver.hxx>
+#include <fpa/VTK/Image3DObserver.hxx>
// -------------------------------------------------------------------------
fpaPlugins::ImageRegionGrow::
#include <plugins/fpa/MinimumSpanningTree.h>
+#include <fpa_Instances/Instances.h>
// -------------------------------------------------------------------------
void fpaPlugins::MinimumSpanningTree::
} // fi
}
-// -------------------------------------------------------------------------
-// Explicit instances
-// -------------------------------------------------------------------------
-
-#include <fpa/Base/MinimumSpanningTree.hxx>
-#include <fpa/Image/MinimumSpanningTree.hxx>
-#include <itkImage.hxx>
-#include <itkImportImageContainer.hxx>
-#include <itkImageConstIteratorWithIndex.hxx>
-#include <itkImageRegionConstIteratorWithIndex.hxx>
-
-#define fpa_Explicit_MST( D ) \
- template class fpaPlugins_EXPORT fpa::Base::MinimumSpanningTree< itk::Image< fpa::Image::MinimumSpanningTreeData< D >, D >, itk::Index< D > >; \
- template class fpaPlugins_EXPORT fpa::Image::MinimumSpanningTree< D >; \
- template class fpaPlugins_EXPORT itk::ImageConstIteratorWithIndex< fpa::Image::MinimumSpanningTree< D > >; \
- template class fpaPlugins_EXPORT itk::ImageRegionConstIteratorWithIndex< fpa::Image::MinimumSpanningTree< D > >
-
-fpa_Explicit_MST( 2 );
-fpa_Explicit_MST( 3 );
-
// eof - $RCSfile$
#include <fpa/fpaPlugins_Export.h>
#include <cpPlugins/DataObject.h>
-#include <fpa/Image/MinimumSpanningTree.h>
// -------------------------------------------------------------------------
namespace fpaPlugins