]> Creatis software - cpPlugins.git/commitdiff
itk-based LevelSet filters wrapped
authorLeonardo Flórez-Valencia <florez-l@javeriana.edu.co>
Tue, 22 Nov 2016 23:03:26 +0000 (18:03 -0500)
committerLeonardo Flórez-Valencia <florez-l@javeriana.edu.co>
Tue, 22 Nov 2016 23:03:26 +0000 (18:03 -0500)
18 files changed:
lib/CMakeLists.txt
lib/cpInstances/CMakeLists.txt
lib/cpInstances/ComplexImageFilters.i
lib/cpInstances/ExtractImageFilters.i
lib/cpInstances/ITKAnisotropicSmoothing.i [new file with mode: 0644]
lib/cpInstances/ITKDifferenceImageFilters.i [new file with mode: 0644]
lib/cpInstances/ITKImageFeatureFilters.i [new file with mode: 0644]
lib/cpInstances/ITKLevelSetFilters.i [new file with mode: 0644]
lib/cpInstances/ImageInterpolators.i
lib/cpInstances/ImageIterators.i
lib/cpInstances/NeighborhoodImageIterators.i
lib/cpInstances/ScalarImages.i
lib/cpInstances/VectorImages.i
lib/cpPlugins/Interface/Workspace.cxx
lib/cpPlugins/Interface/Workspace.h
plugins/CMakeLists.txt
plugins/ITKLevelSetFilters/ThresholdSegmentationLevelSetImageFilter.cxx [new file with mode: 0644]
plugins/ITKLevelSetFilters/ThresholdSegmentationLevelSetImageFilter.h [new file with mode: 0644]

index ca17af7b0df516653a9f23d27089cd7350db3cb3..bf5213eaed81aa4501e01df94f8bdbee9f43b951 100644 (file)
@@ -42,7 +42,10 @@ SUBDIRS(cpInstances)
 
 IF(USE_QT4)
   CompileLibFromDir(cpBaseQtApplication SHARED cpBaseQtApplication)
-  TARGET_LINK_LIBRARIES(cpBaseQtApplication ${QT_LIBRARIES} cpPlugins)
+  TARGET_LINK_LIBRARIES(
+    cpBaseQtApplication
+    ${QT_LIBRARIES} cpExtensions cpPlugins
+    )
 ENDIF(USE_QT4)
 
 ## eof - $RCSfile$
index eac073aa8eb411da12cb07163f9920cd1b0f6653..4b0e9adcce1baa3aa741684be2637868c38ea126 100644 (file)
@@ -23,6 +23,10 @@ SET(
   ImageSliceFilters
   ImageSeparableFilters
   ExtractImageFilters
+  ITKDifferenceImageFilters
+  ITKAnisotropicSmoothing
+  ITKLevelSetFilters
+  ITKImageFeatureFilters
   PolyLineParametricPath
   Simple3DCurve
   Skeleton
@@ -69,7 +73,11 @@ TARGET_LINK_LIBRARIES(${_pfx}ImageIterators ${_pfx}Image)
 TARGET_LINK_LIBRARIES(${_pfx}ImageInterpolators ${_pfx}Image)
 TARGET_LINK_LIBRARIES(${_pfx}NeighborhoodImageIterators ${_pfx}Image)
 TARGET_LINK_LIBRARIES(${_pfx}BaseImageFilters ${_pfx}ImageIterators)
-TARGET_LINK_LIBRARIES(${_pfx}ComplexImageFilters ${_pfx}ImageIterators)
+TARGET_LINK_LIBRARIES(
+  ${_pfx}ComplexImageFilters
+  ${_pfx}ImageIterators
+  ${_pfx}NeighborhoodImageIterators
+  )
 TARGET_LINK_LIBRARIES(
   ${_pfx}ImagesIO
   ${_pfx}ScalarImages
@@ -137,6 +145,34 @@ TARGET_LINK_LIBRARIES(
   ${_pfx}BaseImageFilters
   ${_pfx}ComplexImageFilters
   )
+TARGET_LINK_LIBRARIES(
+  ${_pfx}ITKImageFeatureFilters
+  ${_pfx}Image
+  ${_pfx}BaseImageFilters
+  ${_pfx}ComplexImageFilters
+  ${_pfx}NeighborhoodImageIterators
+  )
+TARGET_LINK_LIBRARIES(
+  ${_pfx}ITKDifferenceImageFilters
+  ${_pfx}Image
+  ${_pfx}BaseImageFilters
+  ${_pfx}ComplexImageFilters
+  )
+TARGET_LINK_LIBRARIES(
+  ${_pfx}ITKAnisotropicSmoothing
+  ${_pfx}ITKDifferenceImageFilters
+  )
+TARGET_LINK_LIBRARIES(
+  ${_pfx}ITKLevelSetFilters
+  ${_pfx}ITKAnisotropicSmoothing
+  ${_pfx}Image
+  ${_pfx}ImageIterators
+  ${_pfx}NeighborhoodImageIterators
+  ${_pfx}BaseImageFilters
+  ${_pfx}ImageInterpolators
+  ${_pfx}ExtractImageFilters
+  ${_pfx}ITKImageFeatureFilters
+  )
 
 ## ===================================================
 ## == Keep track of all created instances libraries ==
index 999e79b4d80dca77efa4d3ea9e6d770d68376506..dc1e9dd0e645c0a2dc10cf5108b9d5c2eb300ee3 100644 (file)
@@ -8,6 +8,9 @@ define out_reals=#real_types#
 
 tinclude itk#filters#:h|hxx
 tinclude itkImageAlgorithm:h|hxx
+tinclude itkNeighborhoodAlgorithm:h|hxx
+tinclude itkNeighborhoodOperatorImageFilter:h|hxx
+tinclude itkNeighborhoodInnerProduct:h|hxx
 
 cinclude complex
 cinclude itkImage.h
@@ -22,6 +25,11 @@ instances itk::#filters#< itk::Image< #in_scalars#, 2 >, itk::Image< #out_scalar
 instances itk::#filters#< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< itk::CovariantVector< #real_types#, #process_dims# >, #process_dims# > >
 instances itk::#filters#< itk::Image< itk::CovariantVector< #real_types#, #process_dims# >, #process_dims# >, itk::Image< #scalar_pixels#, #process_dims# > >
 
+instances itk::NeighborhoodAlgorithm::ImageBoundaryFacesCalculator< itk::Image< signed char, #process_dims# > >
+instances itk::NeighborhoodAlgorithm::ImageBoundaryFacesCalculator< itk::Image< #scalar_pixels#, #process_dims# > >
+instances itk::NeighborhoodInnerProduct< itk::Image< #scalar_pixels#, #process_dims# >, #in_reals#, #out_reals# >
+instances itk::NeighborhoodOperatorImageFilter< itk::Image< #in_scalars#, #process_dims# >, itk::Image< #out_scalars#, #process_dims# >, #real_types# >
+
 minstances void #_export_# itk::ImageAlgorithm::DispatchedCopy< itk::Image< #scalar_pixels#, 3 >, itk::Image< #scalar_pixels#, 2 > >( itk::Image< #scalar_pixels#, 3 > const*, itk::Image< #scalar_pixels#, 2 >*, itk::Image< #scalar_pixels#, 3 >::RegionType const&, itk::Image< #scalar_pixels#, 2 >::RegionType const&, std::integral_constant< bool, false > )
 
 minstances void #_export_# itk::ImageAlgorithm::DispatchedCopy< itk::Image< #scalar_pixels#, 2 >, itk::Image< #scalar_pixels#, 3 > >( itk::Image< #scalar_pixels#, 2 > const*, itk::Image< #scalar_pixels#, 3 >*, itk::Image< #scalar_pixels#, 2 >::RegionType const&, itk::Image< #scalar_pixels#, 3 >::RegionType const&, std::integral_constant< bool, false > )
index 7a1643831436a78d1358d0c1c9fabcaacd2d5b95..b63591fe9dee0b49a2703876fb68960a812cf321 100644 (file)
@@ -1,10 +1,14 @@
 header #define ITK_MANUAL_INSTANTIATION
 
 define filters=RegionOfInterestImageFilter;ExtractImageFilter
+define i_scalars=#scalar_pixels#
+define o_scalars=#scalar_pixels#
 
 tinclude itk#filters#:h|hxx
+tinclude itkShiftScaleImageFilter:h|hxx
 
 instances itk::#filters#< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #scalar_pixels#, #process_dims# > >
 instances itk::ExtractImageFilter< itk::Image< #scalar_pixels#, 3 >, itk::Image< #scalar_pixels#, 2 > >
+instances itk::ShiftScaleImageFilter< itk::Image< #i_scalars#, #process_dims# >, itk::Image< #o_scalars#, #process_dims# > >
 
 ** eof - $RCSfile$
diff --git a/lib/cpInstances/ITKAnisotropicSmoothing.i b/lib/cpInstances/ITKAnisotropicSmoothing.i
new file mode 100644 (file)
index 0000000..c381d8b
--- /dev/null
@@ -0,0 +1,12 @@
+header #define ITK_MANUAL_INSTANTIATION
+
+define functions=ScalarAnisotropicDiffusionFunction;GradientNDAnisotropicDiffusionFunction
+define filters=AnisotropicDiffusionImageFilter
+
+tinclude itk#functions#:h|hxx
+tinclude itk#filters#:h|hxx
+
+instances itk::#functions#< itk::Image< #real_types#, #process_dims# > >
+instances itk::#filters#< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #real_types#, #process_dims# > >
+
+** eof - $RCSfile$
diff --git a/lib/cpInstances/ITKDifferenceImageFilters.i b/lib/cpInstances/ITKDifferenceImageFilters.i
new file mode 100644 (file)
index 0000000..efa3e64
--- /dev/null
@@ -0,0 +1,15 @@
+header #define ITK_MANUAL_INSTANTIATION
+
+define base=FiniteDifferenceImageFilter;DenseFiniteDifferenceImageFilter
+define functions=FiniteDifferenceFunction
+
+define i_reals=#real_types#
+define o_reals=#real_types#
+
+tinclude itk#functions#:h|hxx
+tinclude itk#base#:h|hxx
+
+instances itk::#functions#< itk::Image< #i_reals#, #process_dims# > >
+instances itk::#base#< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #i_reals#, #process_dims# > >
+
+** eof - $RCSfile$
diff --git a/lib/cpInstances/ITKImageFeatureFilters.i b/lib/cpInstances/ITKImageFeatureFilters.i
new file mode 100644 (file)
index 0000000..87f6415
--- /dev/null
@@ -0,0 +1,14 @@
+header #define ITK_MANUAL_INSTANTIATION
+
+define filters=LaplacianImageFilter
+define op=LaplacianOperator
+define i_reals=#real_types#
+define o_reals=#real_types#
+
+tinclude itk#op#:h|hxx
+tinclude itk#filters#:h|hxx
+
+instances itk::#op#< #i_reals#, #process_dims#, itk::NeighborhoodAllocator< #i_reals# > >
+instances itk::#filters#< itk::Image< #i_reals#, #process_dims# >, itk::Image< #o_reals#, #process_dims# > >
+
+** eof - $RCSfile$
diff --git a/lib/cpInstances/ITKLevelSetFilters.i b/lib/cpInstances/ITKLevelSetFilters.i
new file mode 100644 (file)
index 0000000..1031051
--- /dev/null
@@ -0,0 +1,28 @@
+header #define ITK_MANUAL_INSTANTIATION
+
+define base=ZeroCrossingImageFilter;SparseFieldLevelSetImageFilter
+define filters=SegmentationLevelSetImageFilter;ThresholdSegmentationLevelSetImageFilter
+define functions=LevelSetFunction
+define ls_functions=SegmentationLevelSetFunction;ThresholdSegmentationLevelSetFunction
+
+define i_reals=#real_types#
+define o_reals=#real_types#
+
+tinclude itk#functions#:h|hxx
+tinclude itk#ls_functions#:h|hxx
+tinclude itk#base#:h|hxx
+tinclude itk#filters#:h|hxx
+tinclude itkSparseFieldLayer:h|hxx
+tinclude itkObjectStore:h|hxx
+
+cinclude itkLinearInterpolateImageFunction.hxx
+
+instances itk::SparseFieldLayer< itk::SparseFieldLevelSetNode< itk::Index< #process_dims# > > >
+instances itk::ObjectStore< itk::SparseFieldLevelSetNode< itk::Index< #process_dims# > > >
+
+instances itk::#functions#< itk::Image< #i_reals#, #process_dims# > >
+instances itk::#ls_functions#< itk::Image< #i_reals#, #process_dims# >, itk::Image< #o_reals#, #process_dims# > >
+instances itk::#base#< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #i_reals#, #process_dims# > >
+instances itk::#filters#< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #i_reals#, #process_dims# >, #o_reals# >
+
+** eof - $RCSfile$
index c9214b4013c9b6ab287b55e2f3370d698ab2a109..22374c3960a8fb8140b4ce17e55b05c9cba09125 100644 (file)
@@ -1,17 +1,20 @@
 header #define ITK_MANUAL_INSTANTIATION
 
+define v=FixedArray
 define i_real=#real_types#
 define o_real=#real_types#
 define interp=Linear
 
 tinclude itkImageFunction:h|hxx
 tinclude itk#interp#InterpolateImageFunction:h|hxx
+tinclude itkVectorLinearInterpolateImageFunction:h|hxx
 
-NearestNeighbor
-
+cinclude itk#v#.h
 cinclude itkImage.h
 
 instances itk::ImageFunction< itk::Image< #scalar_pixels#, #process_dims# >, #i_real#, #o_real# >
 instances itk::#interp#InterpolateImageFunction< itk::Image< #scalar_pixels#, #process_dims# >, #real_types# >
 
+instances itk::VectorLinearInterpolateImageFunction< itk::Image< itk::#v#< #i_real#, #process_dims# >, #process_dims# >, #o_real# >
+
 ** eof - $RCSfile$
index 0cfefb33b5b0a2872fac2549422622cc28557abe..909b65ce8f7039373fafeb77954fce23521418db 100644 (file)
@@ -13,6 +13,7 @@ cinclude itk#matrices#.h
 cinclude itkOffset.h
 
 instances itk::#it#< itk::Image< #scalar_pixels#, #process_dims# > >
+instances itk::#it#< itk::Image< signed #int_types#, #process_dims# > >
 instances itk::#it#< itk::Image< std::complex< #real_types# >, #process_dims# > >
 instances itk::#it#< itk::Image< itk::#color_pixels#< #scalar_pixels# >, #process_dims# > >
 instances itk::#it#< itk::Image< itk::#vectors#< #real_types#, #process_dims# >, #process_dims# > >
index 72fc70613ef2ffc1e36ac796652482739583ad93..2fa591b8a64640b60b1e4f465b85ad0ce2c39d8b 100644 (file)
@@ -2,8 +2,10 @@ header #define ITK_MANUAL_INSTANTIATION
 
 define it=ConstNeighborhoodIterator;NeighborhoodIterator;ConstShapedNeighborhoodIterator;ShapedNeighborhoodIterator
 define co=ZeroFluxNeumannBoundaryCondition
+define pi=#scalar_pixels#;signed char
+define op=Neighborhood;NeighborhoodOperator;DerivativeOperator
 
-tinclude itkNeighborhood:h|hxx
+tinclude itk#op#:h|hxx
 tinclude itk#co#:h|hxx
 tinclude itk#it#:h|hxx
 
@@ -15,9 +17,9 @@ cinclude itk#diff_tensors#.h
 cinclude itk#matrices#.h
 cinclude itkOffset.h
 
-instances itk::NeighborhoodAllocator< #scalar_pixels# >
-instances itk::Neighborhood< #scalar_pixels#, #process_dims#, itk::NeighborhoodAllocator< #scalar_pixels# > >
-instances itk::#co#< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #scalar_pixels#, #process_dims# > >
-instances itk::#it#< itk::Image< #scalar_pixels#, #process_dims# >, itk::#co#< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #scalar_pixels#, #process_dims# > > >
+instances itk::NeighborhoodAllocator< #pi# >
+instances itk::#op#< #pi#, #process_dims#, itk::NeighborhoodAllocator< #pi# > >
+instances itk::#co#< itk::Image< #pi#, #process_dims# >, itk::Image< #pi#, #process_dims# > >
+instances itk::#it#< itk::Image< #pi#, #process_dims# >, itk::#co#< itk::Image< #pi#, #process_dims# >, itk::Image< #pi#, #process_dims# > > >
 
 ** eof - $RCSfile$
index cce18c3d4f33cb026c86b5a5f82ce14f182f9b3c..1a8606c06dca7c5bb17b2c5bf62c0574a897e92d 100644 (file)
@@ -1,5 +1,6 @@
 header #define ITK_MANUAL_INSTANTIATION
 
+define pi=#scalar_pixels#;signed char
 define base_filters=ImageSource
 define i2v=VTKImageExport;VTKImageImport;ImageToVTKImageFilter;VTKImageToImageFilter
 
@@ -10,12 +11,12 @@ tinclude itkImageRegion:h|hxx
 tinclude itk#base_filters#:h|hxx
 tinclude itk#i2v#:h|hxx
 
-instances itk::ImportImageContainer< unsigned long, #scalar_pixels# >
+instances itk::ImportImageContainer< unsigned long, #pi# >
 instances itk::ImageRegion< #process_dims# >
 instances itk::ImageBase< #process_dims# >
-instances itk::Image< #scalar_pixels#, #process_dims# >
-instances itk::#base_filters#< itk::Image< #scalar_pixels#, #process_dims# > >
-instances itk::#i2v#< itk::Image< #scalar_pixels#, #visual_dims# > >
+instances itk::Image< #pi#, #process_dims# >
+instances itk::#base_filters#< itk::Image< #pi#, #process_dims# > >
+instances itk::#i2v#< itk::Image< #pi#, #visual_dims# > >
 
 minstances #_export_# std::ostream& itk::operator<< < #process_dims# >( std::ostream& a, itk::ImageRegion< #process_dims# > const& b )
 
index 17d1a338085a5d466a5a416329fa116dea800c1a..4a7c5f3785672140b09d33343968d361c74c7321 100644 (file)
@@ -1,5 +1,6 @@
 header #define ITK_MANUAL_INSTANTIATION
 
+define v=FixedArray;#vectors#
 define base_filters=ImageSource
 define i2v=VTKImageExport;VTKImageImport;ImageToVTKImageFilter;VTKImageToImageFilter
 
@@ -8,14 +9,14 @@ tinclude itkImage:h|hxx
 tinclude itk#base_filters#:h|hxx
 tinclude itk#i2v#:h|hxx
 
-cinclude itk#vectors#.h
+cinclude itk#v#.h
 cinclude itk#diff_tensors#.h
 cinclude itkOffset.h
 
-instances itk::ImportImageContainer< unsigned long, itk::#vectors#< #real_types#, #process_dims# > >
-instances itk::Image< itk::#vectors#< #real_types#, #process_dims# >, #process_dims# >
-instances itk::#base_filters#< itk::Image< itk::#vectors#< #real_types#, #process_dims# >, #process_dims# > >
-instances itk::#i2v#< itk::Image< itk::#vectors#< #real_types#, #visual_dims# >, #visual_dims# > >
+instances itk::ImportImageContainer< unsigned long, itk::#v#< #real_types#, #process_dims# > >
+instances itk::Image< itk::#v#< #real_types#, #process_dims# >, #process_dims# >
+instances itk::#base_filters#< itk::Image< itk::#v#< #real_types#, #process_dims# >, #process_dims# > >
+instances itk::#i2v#< itk::Image< itk::#v#< #real_types#, #visual_dims# >, #visual_dims# > >
 
 instances itk::ImportImageContainer< unsigned long, itk::#diff_tensors#< #real_types# > >
 instances itk::Image< itk::#diff_tensors#< #real_types# >, #process_dims# >
index bdc67e000d0c351e8a7e68ad39276fdc9e50ea4f..5b80a36bb9a19f392bf941be9a7c9fd4f7cd3d90 100644 (file)
@@ -232,6 +232,48 @@ Connect(
   return( ok );
 }
 
+// -------------------------------------------------------------------------
+bool cpPlugins::Interface::Workspace::
+Connect(
+  TDataObject* input,
+  const std::string& destination_filter,
+  const std::string& destination_input
+  )
+{
+  // Get filters and check pertinence
+  if( input == NULL )
+    return( false );
+  TFilter* destination = this->GetFilter( destination_filter );
+  if( destination == NULL )
+    return( false );
+  if( !( destination->HasInput( destination_input ) ) )
+    return( false );
+
+  // Check if there is room for a new connection
+  bool ok = true;
+  if( destination->IsInputMultiple( destination_input ) )
+  {
+    for(
+      unsigned int i = 0;
+      i < destination->GetInputSize( destination_input );
+      ++i
+      )
+      if(
+        destination->GetInput( destination_input, i )->GetSource( ) ==
+        input->GetSource( )
+        )
+        ok = false;
+  }
+  else
+    ok = ( destination->GetInput( destination_input ) == NULL );
+  if( ok )
+    destination->AddInput(
+      destination_input,
+      input
+      );
+  return( ok );
+}
+
 // -------------------------------------------------------------------------
 bool cpPlugins::Interface::Workspace::
 Disconnect(
index 1e6e6e21f4d42f20cb43e752aae68143c8de2db3..73db780f9dab7dcb800d5c249d15d268b3f23053 100644 (file)
@@ -24,6 +24,7 @@ namespace cpPlugins
       typedef itk::SmartPointer< Self >       Pointer;
       typedef itk::SmartPointer< const Self > ConstPointer;
 
+      typedef cpPlugins::BaseObjects::DataObject    TDataObject;
       typedef cpPlugins::BaseObjects::ProcessObject TFilter;
       typedef cpPlugins::BaseObjects::Widget        TWidget;
       typedef cpPlugins::Interface::Plugins         TPlugins;
@@ -108,6 +109,11 @@ namespace cpPlugins
         const std::string& destination_filter,
         const std::string& destination_input
         );
+      bool Connect(
+        TDataObject* input,
+        const std::string& destination_filter,
+        const std::string& destination_input
+        );
       bool Disconnect(
         const std::string& origin_filter,
         const std::string& origin_output,
index feabf0ecfa7e39e48f7a39e78bbaebc3a16abedf..8ad7dd414678a6b14bdcc1cae6717bc3dc19c601 100644 (file)
@@ -15,6 +15,7 @@ SET(
   ITKSliceFilters
   ITKSeparableFilters
   ITKGenericFilters
+  ITKLevelSetFilters
   ImageParaMorphologyFilters
   ImageThresholdFilters
   ImageGradientFilters
diff --git a/plugins/ITKLevelSetFilters/ThresholdSegmentationLevelSetImageFilter.cxx b/plugins/ITKLevelSetFilters/ThresholdSegmentationLevelSetImageFilter.cxx
new file mode 100644 (file)
index 0000000..45c2b40
--- /dev/null
@@ -0,0 +1,76 @@
+#include <ITKLevelSetFilters/ThresholdSegmentationLevelSetImageFilter.h>
+#include <cpInstances/Image.h>
+
+#include <itkThresholdSegmentationLevelSetImageFilter.h>
+
+// -------------------------------------------------------------------------
+cpPluginsITKLevelSetFilters::ThresholdSegmentationLevelSetImageFilter::
+ThresholdSegmentationLevelSetImageFilter( )
+  : Superclass( )
+{
+  this->_ConfigureInput< cpInstances::Image >( "Input", true, false );
+  this->_ConfigureInput< cpInstances::Image >( "Feature", true, false );
+  this->_ConfigureOutput< cpInstances::Image >( "Output" );
+
+  this->m_Parameters.ConfigureAsReal( "PropagationScaling", 1 );
+  this->m_Parameters.ConfigureAsReal( "CurvatureScaling", 1 );
+  this->m_Parameters.ConfigureAsReal( "MaximumRMSError", 0.02 );
+  this->m_Parameters.ConfigureAsReal( "UpperThreshold", 1 );
+  this->m_Parameters.ConfigureAsReal( "LowerThreshold", 0 );
+  this->m_Parameters.ConfigureAsReal( "IsoSurfaceValue", 0 );
+  this->m_Parameters.ConfigureAsUint( "NumberOfIterations", 100 );
+}
+
+// -------------------------------------------------------------------------
+cpPluginsITKLevelSetFilters::ThresholdSegmentationLevelSetImageFilter::
+~ThresholdSegmentationLevelSetImageFilter( )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpPluginsITKLevelSetFilters::ThresholdSegmentationLevelSetImageFilter::
+_GenerateData( )
+{
+  auto o = this->GetInputData( "Input" );
+  cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( o, _GD0 )
+    this->_Error( "Invalid input image dimension." );
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage >
+void cpPluginsITKLevelSetFilters::ThresholdSegmentationLevelSetImageFilter::
+_GD0( _TImage* image )
+{
+  auto f = this->GetInputData( "Feature" );
+  cpPlugins_Demangle_Image_RealPixels_2( f, _GD1, _TImage::ImageDimension, image )
+    this->_Error( "Invalid feature image." );
+}
+
+// -------------------------------------------------------------------------
+template< class _TFeature, class _TImage >
+void cpPluginsITKLevelSetFilters::ThresholdSegmentationLevelSetImageFilter::
+_GD1( _TFeature* feature, _TImage* image )
+{
+  typedef typename _TFeature::PixelType _TScalar;
+  typedef
+    itk::ThresholdSegmentationLevelSetImageFilter< _TImage, _TFeature, _TScalar >
+    _TFilter;
+
+  // Configure filter
+  _TFilter* filter = this->_CreateITK< _TFilter >( );
+  filter->SetInput( image );
+  filter->SetFeatureImage( feature );
+  filter->SetPropagationScaling( this->m_Parameters.GetReal( "PropagationScaling" ) );
+  filter->SetCurvatureScaling( this->m_Parameters.GetReal( "CurvatureScaling" ) );
+  filter->SetMaximumRMSError( this->m_Parameters.GetReal( "MaximumRMSError" ) );
+  filter->SetUpperThreshold( this->m_Parameters.GetReal( "UpperThreshold" ) );
+  filter->SetLowerThreshold( this->m_Parameters.GetReal( "LowerThreshold" ) );
+  filter->SetIsoSurfaceValue( this->m_Parameters.GetReal( "IsoSurfaceValue" ) );
+  filter->SetNumberOfIterations( this->m_Parameters.GetUint( "NumberOfIterations" ) );
+  filter->Update( );
+
+  // Connect output
+  this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
+}
+
+// eof - $RCSfile$
diff --git a/plugins/ITKLevelSetFilters/ThresholdSegmentationLevelSetImageFilter.h b/plugins/ITKLevelSetFilters/ThresholdSegmentationLevelSetImageFilter.h
new file mode 100644 (file)
index 0000000..3adab5a
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef __cpPluginsITKLevelSetFilters__ThresholdSegmentationLevelSetImageFilter__h__
+#define __cpPluginsITKLevelSetFilters__ThresholdSegmentationLevelSetImageFilter__h__
+
+#include <cpPluginsITKLevelSetFilters_Export.h>
+#include <cpPlugins/BaseObjects/ProcessObject.h>
+
+namespace cpPluginsITKLevelSetFilters
+{
+  /**
+   */
+  class cpPluginsITKLevelSetFilters_EXPORT ThresholdSegmentationLevelSetImageFilter
+    : public cpPlugins::BaseObjects::ProcessObject
+  {
+    cpPluginsObject(
+      ThresholdSegmentationLevelSetImageFilter,
+      cpPlugins::BaseObjects::ProcessObject,
+      ImageLevelSetFilters
+      );
+
+  protected:
+    template< class _TImage >
+    inline void _GD0( _TImage* image );
+
+    template< class _TFeature, class _TImage >
+    inline void _GD1( _TFeature* feature, _TImage* image );
+  };
+
+} // ecapseman
+
+#endif // __cpPluginsITKLevelSetFilters__ThresholdSegmentationLevelSetImageFilter__h__
+
+// eof - $RCSfile$