]> Creatis software - cpPlugins.git/commitdiff
...
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Fri, 28 Oct 2016 15:25:10 +0000 (10:25 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Fri, 28 Oct 2016 15:25:10 +0000 (10:25 -0500)
19 files changed:
lib/Instances/BaseObjects.i
lib/Instances/CMakeLists.txt
lib/Instances/ImageFiltersBases.i
lib/Instances/ImageIterators.i
lib/Instances/ImageNeighborhoodIterators.i [new file with mode: 0644]
lib/cpPlugins/DataObjects/Image.cxx
lib/cpPlugins/DataObjects/Mesh.cxx
plugins/CMakeLists.txt
plugins/ImageDistanceMaps/BinaryContourImageFilter.cxx [new file with mode: 0644]
plugins/ImageDistanceMaps/BinaryContourImageFilter.h [new file with mode: 0644]
plugins/ImageDistanceMaps/ImageDistanceMaps.i
plugins/ImageDistanceMaps/SignedMaurerDistanceMapImageFilter.cxx
plugins/ImageThresholdFilters/BinaryThresholdImageFilter.cxx
plugins/ImageThresholdFilters/BinaryThresholdImageFilter.h
plugins/ImageThresholdFilters/ImageThresholdFilters.i [new file with mode: 0644]
plugins/ImageThresholdFilters/ImageToBoundingBoxFromThreshold.cxx
plugins/ImageThresholdFilters/ImageToBoundingBoxFromThreshold.h
plugins/ImageThresholdFilters/UnaryThresholdImageFilter.cxx
plugins/ImageThresholdFilters/UnaryThresholdImageFilter.h

index 699df69acef0af07fd629736abac0d3e6855e67a..384aad50b346213b815c21aaf922df70c1d884b2 100644 (file)
@@ -7,6 +7,7 @@ tinclude itk#vectors#:h|hxx
 tinclude itk#matrices#:h|hxx
 tinclude itk#diff_tensors#:h|hxx
 tinclude itkSymmetricEigenAnalysis:h|hxx
+tinclude itkSimpleDataObjectDecorator:h|hxx
 tinclude vnl/vnl_vector:h|hxx
 
 cinclude vnl/vnl_c_vector.hxx
@@ -21,6 +22,8 @@ instances itk::#diff_tensors#< #real_types# >
 instances itk::#matrices#< #real_types#, #process_dims#, #process_dims# >
 instances itk::SymmetricEigenAnalysis< itk::Matrix< #real_types#, #process_dims#, #process_dims# >, itk::FixedArray< #real_types#, #process_dims# >, itk::Matrix< #real_types#, #process_dims#, #process_dims# > >
 
+instances itk::SimpleDataObjectDecorator< #scalar_pixels# >
+
 define my_vectors=Vector;Point
 
 minstances #_export_# std::ostream& itk::operator<< < #real_types#, #process_dims# >( std::ostream& a, itk::#my_vectors#< #real_types#, #process_dims# > const& b )
index 44e646dafa23f95808aa27046e5167569a99b502..aaa936e4fa0bfc4396b4fddfe02381b0f5f03858 100644 (file)
@@ -3,6 +3,7 @@ SET(
   BaseObjects
   SimpleImages
   ImageIterators
+  ImageNeighborhoodIterators
   ImageFiltersBases
   BoundingBoxes
   Meshes
@@ -25,6 +26,7 @@ SET(
 TARGET_LINK_LIBRARIES(cpInstances_BaseObjects ${ITK_LIBRARIES})
 TARGET_LINK_LIBRARIES(cpInstances_SimpleImages cpInstances_BaseObjects)
 TARGET_LINK_LIBRARIES(cpInstances_ImageIterators cpInstances_SimpleImages)
+TARGET_LINK_LIBRARIES(cpInstances_ImageNeighborhoodIterators cpInstances_SimpleImages)
 TARGET_LINK_LIBRARIES(cpInstances_ImageFiltersBases cpInstances_SimpleImages)
 TARGET_LINK_LIBRARIES(cpInstances_BoundingBoxes cpInstances_BaseObjects)
 TARGET_LINK_LIBRARIES(cpInstances_Meshes cpInstances_BoundingBoxes)
index f7364f3cda56a7078064f8ae1414dd030ac7c826..249c0a8850b59f457c7f01a68280663ecaeab623 100644 (file)
@@ -1,6 +1,11 @@
 header #define ITK_MANUAL_INSTANTIATION
 
+define in_scalar_pixels=#scalar_pixels#
+define out_scalar_pixels=#scalar_pixels#
+define filters=ImageToImageFilter;InPlaceImageFilter
+
 tinclude itkImageSource:h|hxx
+tinclude itk#filters#:h|hxx
 
 cinclude complex
 cinclude itk#color_pixels#.h
@@ -16,4 +21,6 @@ instances itk::ImageSource< itk::Image< itk::#diff_tensors#< #real_types# >, 3 >
 instances itk::ImageSource< itk::Image< itk::#matrices#< #real_types#, #process_dims#, #process_dims# >, #process_dims# > >
 instances itk::ImageSource< itk::Image< itk::Offset< #process_dims# >, #process_dims# > >
 
+instances itk::#filters#< itk::Image< #in_scalar_pixels#, #process_dims# >, itk::Image< #out_scalar_pixels#, #process_dims# > >
+
 ** eof - $RCSfile$
index c77e0ca9b598f50064cb1779cb20aaf7a70d0df2..796aadf165f649a1cf175511635fa1672cafc16b 100644 (file)
@@ -1,6 +1,6 @@
 header #define ITK_MANUAL_INSTANTIATION
 
-define iter=ImageRegionConstIterator;ImageRegionIterator;ImageScanlineConstIterator;ImageScanlineIterator;ImageConstIteratorWithIndex;ImageIteratorWithIndex;ImageRegionConstIteratorWithIndex;ImageRegionIteratorWithIndex
+define iter=ImageRegionConstIterator;ImageRegionIterator;ImageScanlineConstIterator;ImageScanlineIterator;ImageConstIteratorWithIndex;ImageIteratorWithIndex;ImageRegionConstIteratorWithIndex;ImageRegionIteratorWithIndex;ImageLinearConstIteratorWithIndex;ImageLinearIteratorWithIndex
 
 tinclude itk#iter#:h|hxx
 
diff --git a/lib/Instances/ImageNeighborhoodIterators.i b/lib/Instances/ImageNeighborhoodIterators.i
new file mode 100644 (file)
index 0000000..a2e692c
--- /dev/null
@@ -0,0 +1,44 @@
+header #define ITK_MANUAL_INSTANTIATION
+
+define iter=ConstNeighborhoodIterator;NeighborhoodIterator
+define esp_iter=ConstShapedNeighborhoodIterator;ShapedNeighborhoodIterator
+define cond=ZeroFluxNeumannBoundaryCondition
+
+tinclude itkNeighborhood:h|hxx
+tinclude itk#cond#:h|hxx
+tinclude itk#iter#:h|hxx
+tinclude itk#esp_iter#:h|hxx
+
+cinclude complex
+cinclude itk#color_pixels#.h
+cinclude itk#vectors#.h
+cinclude itk#diff_tensors#.h
+cinclude itk#matrices#.h
+
+instances itk::Neighborhood< #scalar_pixels#, #process_dims#, itk::NeighborhoodAllocator< #scalar_pixels# > >
+instances itk::Neighborhood< std::complex< #real_types# >, #process_dims#, itk::NeighborhoodAllocator< std::complex< #real_types# > > >
+instances itk::Neighborhood< itk::#color_pixels#< #scalar_pixels# >, #process_dims#, itk::NeighborhoodAllocator< itk::#color_pixels#< #scalar_pixels# > > >
+instances itk::Neighborhood< itk::#vectors#< #real_types#, #process_dims# >, #process_dims#, itk::NeighborhoodAllocator< itk::#vectors#< #real_types#, #process_dims# > > >
+instances itk::Neighborhood< itk::#diff_tensors#< #real_types# >, #process_dims#, itk::NeighborhoodAllocator< itk::#diff_tensors#< #real_types# > > >
+instances itk::Neighborhood< itk::#matrices#< #real_types#, #process_dims#, #process_dims# >, #process_dims#, itk::NeighborhoodAllocator< itk::#matrices#< #real_types#, #process_dims#, #process_dims# > > >
+instances itk::Neighborhood< itk::Offset< #process_dims# >, #process_dims#, itk::NeighborhoodAllocator< itk::Offset< #process_dims# > > >
+
+instances itk::#cond#< itk::Image< #scalar_pixels#, #process_dims# > >
+instances itk::#cond#< itk::Image< std::complex< #real_types# >, #process_dims# > >
+instances itk::#cond#< itk::Image< itk::#color_pixels#< #scalar_pixels# >, #process_dims# > >
+instances itk::#cond#< itk::Image< itk::#vectors#< #real_types#, #process_dims# >, #process_dims# > >
+instances itk::#cond#< itk::Image< itk::#diff_tensors#< #real_types# >, 3 > >
+instances itk::#cond#< itk::Image< itk::#matrices#< #real_types#, #process_dims#, #process_dims# >, #process_dims# > >
+instances itk::#cond#< itk::Image< itk::Offset< #process_dims# >, #process_dims# > >
+
+instances itk::#iter#< itk::Image< #scalar_pixels#, #process_dims# >, itk::#cond#< itk::Image< #scalar_pixels#, #process_dims# > > >
+instances itk::#iter#< itk::Image< std::complex< #real_types# >, #process_dims# >, itk::#cond#< itk::Image< std::complex< #real_types# >, #process_dims# > > >
+instances itk::#iter#< itk::Image< itk::#color_pixels#< #scalar_pixels# >, #process_dims# >, itk::#cond#< itk::Image< itk::#color_pixels#< #scalar_pixels# >, #process_dims# > > >
+instances itk::#iter#< itk::Image< itk::#vectors#< #real_types#, #process_dims# >, #process_dims# >, itk::#cond#< itk::Image< itk::#vectors#< #real_types#, #process_dims# >, #process_dims# > > >
+instances itk::#iter#< itk::Image< itk::#diff_tensors#< #real_types# >, 3 >, itk::#cond#< itk::Image< itk::#diff_tensors#< #real_types# >, 3 > > >
+instances itk::#iter#< itk::Image< itk::#matrices#< #real_types#, #process_dims#, #process_dims# >, #process_dims# >, itk::#cond#< itk::Image< itk::#matrices#< #real_types#, #process_dims#, #process_dims# >, #process_dims# > > >
+instances itk::#iter#< itk::Image< itk::Offset< #process_dims# >, #process_dims# >, itk::#cond#< itk::Image< itk::Offset< #process_dims# >, #process_dims# > > >
+
+instances itk::#esp_iter#< itk::Image< #scalar_pixels#, #process_dims# >, itk::#cond#< itk::Image< #scalar_pixels#, #process_dims# > > >
+
+** eof - $RCSfile$
index 60ac5b3a52ed32a777fe99a7ce45c459ed0f701f..8378b402e94f0d4f70768aadcd734e6a4e845a0f 100644 (file)
@@ -16,8 +16,8 @@ void cpPlugins::DataObjects::Image::
 SetITK( itk::LightObject* o )
 {
   this->Superclass::SetITK( o );
-  cpPlugins_Demangle_Image_VisualDims( o, _ITK_2_VTK_0, );
-  cpPlugins_Demangle_Image_DiffTensors3D( o, _ITK_2_VTK_1, );
+  cpPlugins_Demangle_Image_VisualDims( o, _ITK_2_VTK_0, )
+    cpPlugins_Demangle_Image_DiffTensors3D( o, _ITK_2_VTK_1, )
   {
     this->m_VTK = NULL;
     this->m_ITKvVTK = NULL;
@@ -43,37 +43,37 @@ SetVTK( vtkObjectBase* o )
 
   bool success = false;
   auto stype = img->GetScalarType( );
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_char 
+#ifdef cpPlugins_CONFIG_INTEGER_TYPES_char
   if( stype == VTK_CHAR ) success = this->_VTK_2_ITK_0< char >( img );
   if( stype == VTK_UNSIGNED_CHAR ) success = this->_VTK_2_ITK_0< unsigned char >( img );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_char 
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_short 
+#endif // cpPlugins_CONFIG_INTEGER_TYPES_char
+#ifdef cpPlugins_CONFIG_INTEGER_TYPES_short
   if( stype == VTK_CHAR ) success = this->_VTK_2_ITK_0< short >( img );
   if( stype == VTK_UNSIGNED_CHAR ) success = this->_VTK_2_ITK_0< unsigned short >( img );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_short 
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_int 
+#endif // cpPlugins_CONFIG_INTEGER_TYPES_short
+#ifdef cpPlugins_CONFIG_INTEGER_TYPES_int
   if( stype == VTK_CHAR ) success = this->_VTK_2_ITK_0< int >( img );
   if( stype == VTK_UNSIGNED_CHAR ) success = this->_VTK_2_ITK_0< unsigned int >( img );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_int 
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_long 
+#endif // cpPlugins_CONFIG_INTEGER_TYPES_int
+#ifdef cpPlugins_CONFIG_INTEGER_TYPES_long
   if( stype == VTK_CHAR ) success = this->_VTK_2_ITK_0< long >( img );
   if( stype == VTK_UNSIGNED_CHAR ) success = this->_VTK_2_ITK_0< unsigned long >( img );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_long 
-#ifdef cpPlugins_CONFIG_REAL_TYPES_float 
+#endif // cpPlugins_CONFIG_INTEGER_TYPES_long
+#ifdef cpPlugins_CONFIG_REAL_TYPES_float
   if( stype == VTK_CHAR ) success = this->_VTK_2_ITK_0< float >( img );
-#endif // cpPlugins_CONFIG_REAL_TYPES_float 
-#ifdef cpPlugins_CONFIG_REAL_TYPES_double 
+#endif // cpPlugins_CONFIG_REAL_TYPES_float
+#ifdef cpPlugins_CONFIG_REAL_TYPES_double
   if( stype == VTK_CHAR ) success = this->_VTK_2_ITK_0< double >( img );
-#endif // cpPlugins_CONFIG_REAL_TYPES_double 
+#endif // cpPlugins_CONFIG_REAL_TYPES_double
   /* TODO
-     #define cpPlugins_CONFIG_COLOR_PIXELS_RGBPixel 
-     #define cpPlugins_CONFIG_COLOR_PIXELS_RGBAPixel 
-     #define cpPlugins_CONFIG_VECTORS_CovariantVector 
-     #define cpPlugins_CONFIG_VECTORS_Point 
-     #define cpPlugins_CONFIG_VECTORS_SymmetricSecondRankTensor 
-     #define cpPlugins_CONFIG_VECTORS_Vector 
-     #define cpPlugins_CONFIG_DIFFUSIONTENSORS_DiffusionTensor3D 
-     #define cpPlugins_CONFIG_MATRICES_Matrix 
+     #define cpPlugins_CONFIG_COLOR_PIXELS_RGBPixel
+     #define cpPlugins_CONFIG_COLOR_PIXELS_RGBAPixel
+     #define cpPlugins_CONFIG_VECTORS_CovariantVector
+     #define cpPlugins_CONFIG_VECTORS_Point
+     #define cpPlugins_CONFIG_VECTORS_SymmetricSecondRankTensor
+     #define cpPlugins_CONFIG_VECTORS_Vector
+     #define cpPlugins_CONFIG_DIFFUSIONTENSORS_DiffusionTensor3D
+     #define cpPlugins_CONFIG_MATRICES_Matrix
   */
   if( !success )
   {
@@ -102,9 +102,9 @@ template< class _TImage >
 void cpPlugins::DataObjects::Image::
 _ITK_2_VTK_0( _TImage* image )
 {
-  cpPlugins_Demangle_Image_ScalarPixels( image, _ITK_2_VTK_1, _TImage::ImageDimension, );
-  cpPlugins_Demangle_Image_ColorPixels( image, _ITK_2_VTK_1, _TImage::ImageDimension, );
-  cpPlugins_Demangle_Image_VectorPixels( image, _ITK_2_VTK_1, _TImage::ImageDimension, );
+  cpPlugins_Demangle_Image_ScalarPixels( image, _ITK_2_VTK_1, _TImage::ImageDimension, )
+    cpPlugins_Demangle_Image_ColorPixels( image, _ITK_2_VTK_1, _TImage::ImageDimension, )
+    cpPlugins_Demangle_Image_VectorPixels( image, _ITK_2_VTK_1, _TImage::ImageDimension, )
   {
     this->m_VTK = NULL;
     this->m_ITKvVTK = NULL;
index 4a955520adc2dcb50772f990302335c231973489..e1ce59466ac4055b8651d7eea0c2d54cd8450987 100644 (file)
@@ -12,8 +12,8 @@ void cpPlugins::DataObjects::Mesh::
 SetITK( itk::LightObject* o )
 {
   this->Superclass::SetITK( o );
-  cpPlugins_Demangle_Mesh_Meshes( o, _ITK_2_VTK, 2, );
-  cpPlugins_Demangle_Mesh_Meshes( o, _ITK_2_VTK, 3, );
+  cpPlugins_Demangle_Mesh_Meshes( o, _ITK_2_VTK, 2, )
+    cpPlugins_Demangle_Mesh_Meshes( o, _ITK_2_VTK, 3, )
   {
     this->m_VTK = NULL;
 
@@ -167,7 +167,7 @@ _ITK_2_VTK( _TMesh* mesh )
     vcells->InsertNextCell( cell->GetNumberOfPoints( ) );
     for( auto k = cell->PointIdsBegin( ); k != cell->PointIdsEnd( ); ++k )
       vcells->InsertCellPoint( IndexMap[ *k ] );
-    
+
   } // rof
 
   // Final assignations
index ac367ba8cd0a5c088ae0b70a848ca1d51925946e..c9cd7e385ee89540aebb0aa3e790890272a4d8ac 100644 (file)
@@ -13,7 +13,7 @@ SET(
   #ImageGradientFilters
   ImageMeshFilters
   ImageSources
-  #ImageThresholdFilters
+  ImageThresholdFilters
   IO
   MeshFilters
   MeshSources
@@ -43,4 +43,9 @@ FOREACH(_dir ${_dirlist})
     )
 ENDFOREACH(_dir)
 
+TARGET_LINK_LIBRARIES(
+  cpPluginsImageDistanceMaps
+  cpPluginsImageThresholdFilters
+  )
+
 ## eof - $RSCfile$
diff --git a/plugins/ImageDistanceMaps/BinaryContourImageFilter.cxx b/plugins/ImageDistanceMaps/BinaryContourImageFilter.cxx
new file mode 100644 (file)
index 0000000..c6d0e16
--- /dev/null
@@ -0,0 +1,76 @@
+#include <ImageDistanceMaps/BinaryContourImageFilter.h>
+#include <cpPlugins/DataObjects/Image.h>
+#include <cpPlugins/DataObjects/Image_Demanglers.h>
+
+#include <itkBinaryContourImageFilter.h>
+
+// -------------------------------------------------------------------------
+cpPluginsImageDistanceMaps::BinaryContourImageFilter::
+BinaryContourImageFilter( )
+  : Superclass( )
+{
+  typedef cpPlugins::DataObjects::Image _TImage;
+
+  this->_ConfigureInput< _TImage >( "Input", true, false );
+  this->_ConfigureOutput< _TImage >( "Output" );
+
+  this->m_Parameters.ConfigureAsReal( "BackgroundValue" );
+  this->m_Parameters.ConfigureAsReal( "ForegroundValue" );
+  this->m_Parameters.ConfigureAsBool( "FullyConnected" );
+
+  this->m_Parameters.SetReal( "BackgroundValue", 0 );
+  this->m_Parameters.SetReal( "ForegroundValue", 1 );
+  this->m_Parameters.SetBool( "FullyConnected", false );
+}
+
+// -------------------------------------------------------------------------
+cpPluginsImageDistanceMaps::BinaryContourImageFilter::
+~BinaryContourImageFilter( )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpPluginsImageDistanceMaps::BinaryContourImageFilter::
+_GenerateData( )
+{
+  auto o = this->GetInputData( "Input" );
+  cpPlugins_Demangle_Image_VisualDims( o, _GD0, )
+    this->_Error( "Invalid input image dimension." );
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage >
+void cpPluginsImageDistanceMaps::BinaryContourImageFilter::
+_GD0( _TImage* image )
+{
+  cpPlugins_Demangle_Image_ScalarPixels( image, _GD1, _TImage::ImageDimension, )
+    this->_Error( "Invalid input image pixel type." );
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage >
+void cpPluginsImageDistanceMaps::BinaryContourImageFilter::
+_GD1( _TImage* image )
+{
+  typedef
+    itk::BinaryContourImageFilter< _TImage, _TImage >
+    _TFilter;
+
+  // Get parameters
+  double b = this->m_Parameters.GetReal( "BackgroundValue" );
+  double f = this->m_Parameters.GetReal( "ForegroundValue" );
+  double c = this->m_Parameters.GetBool( "FullyConnected" );
+
+  // Configure filter
+  _TFilter* filter = this->_CreateITK< _TFilter >( );
+  filter->SetInput( image );
+  filter->SetBackgroundValue( ( typename _TImage::PixelType )( b ) );
+  filter->SetForegroundValue( ( typename _TImage::PixelType )( f ) );
+  filter->SetFullyConnected( c );
+  filter->Update( );
+
+  // Connect output
+  this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
+}
+
+// eof - $RCSfile$
diff --git a/plugins/ImageDistanceMaps/BinaryContourImageFilter.h b/plugins/ImageDistanceMaps/BinaryContourImageFilter.h
new file mode 100644 (file)
index 0000000..569a2f2
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef __cpPluginsImageDistanceMaps__BinaryContourImageFilter__h__
+#define __cpPluginsImageDistanceMaps__BinaryContourImageFilter__h__
+
+#include <cpPluginsImageDistanceMaps_Export.h>
+#include <cpPlugins/BaseObjects/ProcessObject.h>
+
+namespace cpPluginsImageDistanceMaps
+{
+  /**
+   */
+  class cpPluginsImageDistanceMaps_EXPORT BinaryContourImageFilter
+    : public cpPlugins::BaseObjects::ProcessObject
+  {
+    cpPluginsObject(
+      BinaryContourImageFilter,
+      cpPlugins::BaseObjects::ProcessObject,
+      ImageDistanceMaps
+      );
+
+  protected:
+    template< class _TImage >
+    inline void _GD0( _TImage* image );
+
+    template< class _TImage >
+    inline void _GD1( _TImage* image );
+  };
+
+} // ecapseman
+
+#endif // __cpPluginsImageDistanceMaps__BinaryContourImageFilter__h__
+
+// eof - $RCSfile$
index a29aaaad899a0ecc3acc173d5bebc1b91c80dca8..20a761c43bf9f358982b94e13fc7a55749030b3a 100644 (file)
@@ -1,11 +1,20 @@
 header #define ITK_MANUAL_INSTANTIATION
 
-define filters=SignedMaurerDistanceMapImageFilter
+define filters=BinaryContourImageFilter
+define dmaps=SignedMaurerDistanceMapImageFilter
+
 define iter=ImageRegionConstIterator;ImageRegionIterator
 
 tinclude itk#filters#:h|hxx
+tinclude itk#dmaps#:h|hxx
 tinclude itk#iter#:h|h
+tinclude itkProgressReporter:h|h
+tinclude itkImageHelper:h|h
+
+define in_scalar_pixels=#scalar_pixels#
+define out_scalar_pixels=#scalar_pixels#
 
-instances itk::#filters#< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #real_types#, #process_dims# > >
+instances itk::#filters#< itk::Image< #in_scalar_pixels#, #visual_dims# >, itk::Image< #out_scalar_pixels#, #visual_dims# > >
+instances itk::#dmaps#< itk::Image< #scalar_pixels#, #visual_dims# >, itk::Image< #real_types#, #visual_dims# > >
 
 ** eof - $RCSfile$
index ad2b183eba272b891532fff850df4ccf94eeda30..d34d1df308ec20bfc61f986bd7f6b3e7a1ab90f4 100644 (file)
@@ -45,7 +45,7 @@ void cpPluginsImageDistanceMaps::SignedMaurerDistanceMapImageFilter::
 _GenerateData( )
 {
   auto o = this->GetInputData( "Input" );
-  cpPlugins_Demangle_Image_ProcessDims( o, _GD0, )
+  cpPlugins_Demangle_Image_VisualDims( o, _GD0, )
     this->_Error( "Invalid input image dimension." );
 }
 
index b9eb3e713550b2e6df6a566cd3162777bc46f9e9..12537737b1f1c581a6389aca2646c4a9a4d63ba5 100644 (file)
@@ -1,17 +1,16 @@
-#include <plugins/ImageThresholdFilters/BinaryThresholdImageFilter.h>
+#include <ImageThresholdFilters/BinaryThresholdImageFilter.h>
 #include <cpPlugins/DataObjects/Image.h>
 
 #include <itkBinaryThresholdImageFilter.h>
-#include <itkBinaryThresholdImageFilter.hxx>
-#include <itkUnaryFunctorImageFilter.hxx>
 
 // -------------------------------------------------------------------------
 cpPluginsImageThresholdFilters::BinaryThresholdImageFilter::
 BinaryThresholdImageFilter( )
   : Superclass( )
 {
-  this->_ConfigureInput< cpPlugins::DataObjects::Image >( "Input", true, false );
-  this->_ConfigureOutput< cpPlugins::DataObjects::Image >( "Output" );
+  typedef cpPlugins::DataObjects::Image _TImage;
+  this->_ConfigureInput< _TImage >( "Input", true, false );
+  this->_ConfigureOutput< _TImage >( "Output" );
 
   this->m_Parameters.ConfigureAsReal( "LowerThresholdValue" );
   this->m_Parameters.ConfigureAsReal( "UpperThresholdValue" );
@@ -34,9 +33,11 @@ cpPluginsImageThresholdFilters::BinaryThresholdImageFilter::
 void cpPluginsImageThresholdFilters::BinaryThresholdImageFilter::
 _GenerateData( )
 {
-  auto o = this->GetInputData( "Input" );
-  cpPlugins_Demangle_ImageScalars_Dims( o, _GD0 );
-  else this->_Error( "Invalid input image." );
+  /* TODO
+     auto o = this->GetInputData( "Input" );
+     cpPlugins_Demangle_ImageScalars_Dims( o, _GD0 );
+     else this->_Error( "Invalid input image." );
+  */
 }
 
 // -------------------------------------------------------------------------
@@ -44,28 +45,30 @@ template< class _TImage >
 void cpPluginsImageThresholdFilters::BinaryThresholdImageFilter::
 _GD0( _TImage* image )
 {
-  typedef unsigned char _TBin;
-  typedef itk::Image< unsigned char, _TImage::ImageDimension > _TBinImage;
-  typedef itk::BinaryThresholdImageFilter< _TImage, _TBinImage > _TFilter;
-  typedef typename _TImage::PixelType _TPixel;
+  /* TODO
+     typedef unsigned char _TBin;
+     typedef itk::Image< unsigned char, _TImage::ImageDimension > _TBinImage;
+     typedef itk::BinaryThresholdImageFilter< _TImage, _TBinImage > _TFilter;
+     typedef typename _TImage::PixelType _TPixel;
 
-  // Get parameters
-  _TPixel lt = _TPixel( this->m_Parameters.GetReal( "LowerThresholdValue" ) );
-  _TPixel ut = _TPixel( this->m_Parameters.GetReal( "UpperThresholdValue" ) );
-  _TBin iv  = _TBin( this->m_Parameters.GetUint( "InsideValue" ) );
-  _TBin ov = _TBin( this->m_Parameters.GetUint( "OutsideValue" ) );
+     // Get parameters
+     _TPixel lt = _TPixel( this->m_Parameters.GetReal( "LowerThresholdValue" ) );
+     _TPixel ut = _TPixel( this->m_Parameters.GetReal( "UpperThresholdValue" ) );
+     _TBin iv  = _TBin( this->m_Parameters.GetUint( "InsideValue" ) );
+     _TBin ov = _TBin( this->m_Parameters.GetUint( "OutsideValue" ) );
 
-  // Configure filter
-  _TFilter* filter = this->_CreateITK< _TFilter >( );
-  filter->SetInput( image );
-  filter->SetLowerThreshold( lt );
-  filter->SetUpperThreshold( ut );
-  filter->SetInsideValue( iv );
-  filter->SetOutsideValue( ov );
-  filter->Update( );
+     // Configure filter
+     _TFilter* filter = this->_CreateITK< _TFilter >( );
+     filter->SetInput( image );
+     filter->SetLowerThreshold( lt );
+     filter->SetUpperThreshold( ut );
+     filter->SetInsideValue( iv );
+     filter->SetOutsideValue( ov );
+     filter->Update( );
 
-  // Connect output
-  this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
+     // Connect output
+     this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
+  */
 }
 
 // eof - $RCSfile$
index f6c60b622cdd78ee2495b261bf84b13128e421a6..38d35b9fa000321c80eef2a0361918e6fdf033f5 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __cpPluginsImageThresholdFilters__BinaryThresholdImageFilter__h__
 #define __cpPluginsImageThresholdFilters__BinaryThresholdImageFilter__h__
 
-#include <plugins/cpPluginsImageThresholdFilters_Export.h>
+#include <cpPluginsImageThresholdFilters_Export.h>
 #include <cpPlugins/BaseObjects/ProcessObject.h>
 
 namespace cpPluginsImageThresholdFilters
@@ -19,7 +19,7 @@ namespace cpPluginsImageThresholdFilters
 
   protected:
     template< class _TImage >
-      inline void _GD0( _TImage* image );
+    inline void _GD0( _TImage* image );
   };
 
 } // ecapseman
diff --git a/plugins/ImageThresholdFilters/ImageThresholdFilters.i b/plugins/ImageThresholdFilters/ImageThresholdFilters.i
new file mode 100644 (file)
index 0000000..50de8f1
--- /dev/null
@@ -0,0 +1,14 @@
+header #define ITK_MANUAL_INSTANTIATION
+
+define filters=BinaryThresholdImageFilter
+
+tinclude itk#filters#:h|hxx
+
+cinclude itkUnaryFunctorImageFilter.hxx
+
+define in_scalar_pixels=#scalar_pixels#
+define out_scalar_pixels=#scalar_pixels#
+
+instances itk::#filters#< itk::Image< #in_scalar_pixels#, #process_dims# >, itk::Image< #out_scalar_pixels#, #process_dims# > >
+
+** eof - $RCSfile$
index 6e2f15ff30432c1552b057fb6be860c080d6a0f3..52082a2b1b1b9952912c6efc41a57571107ee6db 100644 (file)
@@ -1,17 +1,19 @@
-#include <plugins/ImageThresholdFilters/ImageToBoundingBoxFromThreshold.h>
+#include <ImageThresholdFilters/ImageToBoundingBoxFromThreshold.h>
 #include <cpPlugins/DataObjects/Image.h>
 #include <cpPlugins/DataObjects/BoundingBox.h>
 
 #include <cpExtensions/Algorithms/ImageToBoundingBoxFromThreshold.h>
-#include <cpExtensions/Algorithms/ImageToBoundingBoxFromThreshold.hxx>
 
 // -------------------------------------------------------------------------
 cpPluginsImageThresholdFilters::ImageToBoundingBoxFromThreshold::
 ImageToBoundingBoxFromThreshold( )
   : Superclass( )
 {
-  this->_ConfigureInput< cpPlugins::DataObjects::Image >( "Input", true, false );
-  this->_ConfigureOutput< cpPlugins::DataObjects::BoundingBox >( "Output" );
+  typedef cpPlugins::DataObjects::Image _TImage;
+  typedef cpPlugins::DataObjects::BoundingBox _TBBox;
+
+  this->_ConfigureInput< _TImage >( "Input", true, false );
+  this->_ConfigureOutput< _TBBox >( "Output" );
 
   this->m_Parameters.ConfigureAsReal( "LowerThreshold" );
   this->m_Parameters.ConfigureAsReal( "UpperThreshold" );
@@ -30,9 +32,11 @@ cpPluginsImageThresholdFilters::ImageToBoundingBoxFromThreshold::
 void cpPluginsImageThresholdFilters::ImageToBoundingBoxFromThreshold::
 _GenerateData( )
 {
-  auto o = this->GetInputData( "Input" );
-  cpPlugins_Demangle_ImageScalars_Dims( o, _GD0 );
-  else this->_Error( "Invalid input image." );
+  /* TODO
+     auto o = this->GetInputData( "Input" );
+     cpPlugins_Demangle_ImageScalars_Dims( o, _GD0 );
+     else this->_Error( "Invalid input image." );
+  */
 }
 
 // -------------------------------------------------------------------------
@@ -40,25 +44,27 @@ template< class _TImage >
 void cpPluginsImageThresholdFilters::ImageToBoundingBoxFromThreshold::
 _GD0( _TImage* image )
 {
-  typedef
-    cpExtensions::Algorithms::ImageToBoundingBoxFromThreshold< _TImage >
-    _TFilter;
+  /* TODO
+     typedef
+     cpExtensions::Algorithms::ImageToBoundingBoxFromThreshold< _TImage >
+     _TFilter;
 
-  // Configure filter
-  _TFilter* filter = this->_CreateITK< _TFilter >( );
-  filter->SetImage( image );
-  filter->SetLowerThreshold( this->m_Parameters.GetReal( "LowerThreshold" ) );
-  filter->SetUpperThreshold( this->m_Parameters.GetReal( "UpperThreshold" ) );
-  filter->Compute( );
+     // Configure filter
+     _TFilter* filter = this->_CreateITK< _TFilter >( );
+     filter->SetImage( image );
+     filter->SetLowerThreshold( this->m_Parameters.GetReal( "LowerThreshold" ) );
+     filter->SetUpperThreshold( this->m_Parameters.GetReal( "UpperThreshold" ) );
+     filter->Compute( );
 
-  // Create output
-  auto reg = filter->GetRegion( );
-  auto bb = this->GetOutput< cpPlugins::DataObjects::BoundingBox >( "Output" );
-  typename _TImage::PointType p0, p1;
-  image->TransformIndexToPhysicalPoint( reg.GetIndex( ), p0 );
-  image->TransformIndexToPhysicalPoint( reg.GetIndex( ) + reg.GetSize( ), p1 );
-  bb->SetMinimum( p0 );
-  bb->SetMaximum( p1 );
+     // Create output
+     auto reg = filter->GetRegion( );
+     auto bb = this->GetOutput< cpPlugins::DataObjects::BoundingBox >( "Output" );
+     typename _TImage::PointType p0, p1;
+     image->TransformIndexToPhysicalPoint( reg.GetIndex( ), p0 );
+     image->TransformIndexToPhysicalPoint( reg.GetIndex( ) + reg.GetSize( ), p1 );
+     bb->SetMinimum( p0 );
+     bb->SetMaximum( p1 );
+  */
 }
 
 // eof - $RCSfile$
index 49f550690871ae68cc14ee9840237db224f70675..a791f04304cebaddd229ea2aabc512c15ca282fb 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __cpPluginsImageThresholdFilters__ImageToBoundingBoxFromThreshold__h__
 #define __cpPluginsImageThresholdFilters__ImageToBoundingBoxFromThreshold__h__
 
-#include <plugins/cpPluginsImageThresholdFilters_Export.h>
+#include <cpPluginsImageThresholdFilters_Export.h>
 #include <cpPlugins/BaseObjects/ProcessObject.h>
 
 namespace cpPluginsImageThresholdFilters
index 97754e7aaa3879aa1cf4a56380fb10458bf68b15..cd16ed3a243ce3e6de71ef48346598eb1d006f0e 100644 (file)
@@ -1,17 +1,16 @@
-#include <plugins/ImageThresholdFilters/UnaryThresholdImageFilter.h>
+#include <ImageThresholdFilters/UnaryThresholdImageFilter.h>
 #include <cpPlugins/DataObjects/Image.h>
 
 #include <cpExtensions/Algorithms/UnaryThresholdImageFilter.h>
-#include <cpExtensions/Algorithms/UnaryThresholdImageFilter.hxx>
-#include <itkUnaryFunctorImageFilter.hxx>
 
 // -------------------------------------------------------------------------
 cpPluginsImageThresholdFilters::UnaryThresholdImageFilter::
 UnaryThresholdImageFilter( )
   : Superclass( )
 {
-  this->_ConfigureInput< cpPlugins::DataObjects::Image >( "Input", true, false );
-  this->_ConfigureOutput< cpPlugins::DataObjects::Image >( "Output" );
+  typedef cpPlugins::DataObjects::Image _TImage;
+  this->_ConfigureInput< _TImage >( "Input", true, false );
+  this->_ConfigureOutput< _TImage >( "Output" );
 
   this->m_Parameters.ConfigureAsReal( "Threshold" );
   this->m_Parameters.ConfigureAsReal( "InsideValue" );
@@ -34,9 +33,11 @@ cpPluginsImageThresholdFilters::UnaryThresholdImageFilter::
 void cpPluginsImageThresholdFilters::UnaryThresholdImageFilter::
 _GenerateData( )
 {
-  auto o = this->GetInputData( "Input" );
-  cpPlugins_Demangle_ImageScalars_Dims( o, _GD0 );
-  else this->_Error( "Invalid input image." );
+  /* TODO
+     auto o = this->GetInputData( "Input" );
+     cpPlugins_Demangle_ImageScalars_Dims( o, _GD0 );
+     else this->_Error( "Invalid input image." );
+  */
 }
 
 // -------------------------------------------------------------------------
@@ -44,21 +45,23 @@ template< class _TImage >
 void cpPluginsImageThresholdFilters::UnaryThresholdImageFilter::
 _GD0( _TImage* image )
 {
-  typedef
-    cpExtensions::Algorithms::UnaryThresholdImageFilter< _TImage >
-    _TFilter;
+  /* TODO
+     typedef
+     cpExtensions::Algorithms::UnaryThresholdImageFilter< _TImage >
+     _TFilter;
 
-  // Configure filter
-  _TFilter* filter = this->_CreateITK< _TFilter >( );
-  filter->SetInput( image );
-  filter->SetThreshold( this->m_Parameters.GetReal( "Threshold" ) );
-  filter->SetInsideValue( this->m_Parameters.GetReal( "InsideValue" ) );
-  filter->SetOutsideValue( this->m_Parameters.GetReal( "OutsideValue" ) );
-  filter->SetStrict( this->m_Parameters.GetBool( "Strict" ) );
-  filter->Update( );
+     // Configure filter
+     _TFilter* filter = this->_CreateITK< _TFilter >( );
+     filter->SetInput( image );
+     filter->SetThreshold( this->m_Parameters.GetReal( "Threshold" ) );
+     filter->SetInsideValue( this->m_Parameters.GetReal( "InsideValue" ) );
+     filter->SetOutsideValue( this->m_Parameters.GetReal( "OutsideValue" ) );
+     filter->SetStrict( this->m_Parameters.GetBool( "Strict" ) );
+     filter->Update( );
 
-  // Connect output
-  this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
+     // Connect output
+     this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
+  */
 }
 
 // eof - $RCSfile$
index 1e07c3643633592be0df95d5c292599e3522b1ba..3360b4dac7602a10423505c5e1f02c3280429a20 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __cpPluginsImageThresholdFilters__UnaryThresholdImageFilter__h__
 #define __cpPluginsImageThresholdFilters__UnaryThresholdImageFilter__h__
 
-#include <plugins/cpPluginsImageThresholdFilters_Export.h>
+#include <cpPluginsImageThresholdFilters_Export.h>
 #include <cpPlugins/BaseObjects/ProcessObject.h>
 
 namespace cpPluginsImageThresholdFilters
@@ -19,7 +19,7 @@ namespace cpPluginsImageThresholdFilters
 
   protected:
     template< class _TImage >
-      inline void _GD0( _TImage* image );
+    inline void _GD0( _TImage* image );
   };
 
 } // ecapseman