]> Creatis software - cpPlugins.git/commitdiff
...
authorLeonardo Flórez-Valencia <florez-l@javeriana.edu.co>
Wed, 2 Nov 2016 22:33:21 +0000 (17:33 -0500)
committerLeonardo Flórez-Valencia <florez-l@javeriana.edu.co>
Wed, 2 Nov 2016 22:33:21 +0000 (17:33 -0500)
plugins/IO/ImageJSkeletonWriter.cxx
plugins/ImageBooleanFilters/ImageBooleanFilters.i
plugins/ImageBooleanFilters/InvertIntensityImageFilter.cxx [new file with mode: 0644]
plugins/ImageBooleanFilters/InvertIntensityImageFilter.h [new file with mode: 0644]

index 10772428a7d44e9248bef47e093a419253784b7d..b6c279d060b9953209ab97d7215305ac8ad0650b 100644 (file)
@@ -67,15 +67,9 @@ _GD0( _TSkeleton* skeleton )
   auto mIt = skeleton->BeginEdgesRows( );
   for( ; mIt != skeleton->EndEdgesRows( ); ++mIt )
   {
-    /* TODO
-       mIt->first; --> this is the row index. <--
-    */
     auto rIt = mIt->second.begin( );
     for( ; rIt != mIt->second.end( ); ++rIt )
     {
-      /* TODO
-         rIt->first;  --> this is the column index.
-      */
       auto eIt = rIt->second.begin( );
       for( ; eIt != rIt->second.end( ); ++eIt )
       {
index c185fbd003e600b175f9147ac74628a8ef92b5dc..99f27cb2883104cc8f6bcfb5d63e1e580bc2fcde 100644 (file)
@@ -6,10 +6,13 @@ define all_ints=#int_types#;unsigned #int_types#
 
 tinclude itkBinaryFunctorImageFilter:h|hxx
 tinclude itkUnaryFunctorImageFilter:h|hxx
+tinclude itkInvertIntensityImageFilter:h|hxx
 cinclude itk#filters#ImageFilter.h
 
 instances itk::BinaryFunctorImageFilter< itk::Image< #all_ints#, #process_dims# >, itk::Image< #all_ints#, #process_dims# >, itk::Image< #all_ints#, #process_dims# >, itk::Functor::#functors#< #all_ints#, #all_ints#, #all_ints# > >
 
 instances itk::UnaryFunctorImageFilter< itk::Image< #all_ints#, #process_dims# >, itk::Image< #all_ints#, #process_dims# >, itk::Functor::NOT< #all_ints#, #all_ints# > >
 
+instances itk::InvertIntensityImageFilter< itk::Image< #scalar_pixels#, #process_dims# > >
+
 ** eof - $RCSfile$
diff --git a/plugins/ImageBooleanFilters/InvertIntensityImageFilter.cxx b/plugins/ImageBooleanFilters/InvertIntensityImageFilter.cxx
new file mode 100644 (file)
index 0000000..33e2ae8
--- /dev/null
@@ -0,0 +1,49 @@
+#include <ImageBooleanFilters/InvertIntensityImageFilter.h>
+#include <cpPlugins/DataObjects/Image.h>
+#include <cpPlugins/DataObjects/Image_Demanglers.h>
+
+#include <itkInvertIntensityImageFilter.h>
+
+// -------------------------------------------------------------------------
+cpPluginsImageBooleanFilters::InvertIntensityImageFilter::
+InvertIntensityImageFilter( )
+  : Superclass( )
+{
+  typedef cpPlugins::DataObjects::Image _TImage;
+
+  this->_ConfigureInput< _TImage >( "Input", true, false );
+  this->_ConfigureOutput< _TImage >( "Output" );
+  this->m_Parameters.ConfigureAsUint( "Maximum", 1 );
+}
+
+// -------------------------------------------------------------------------
+cpPluginsImageBooleanFilters::InvertIntensityImageFilter::
+~InvertIntensityImageFilter( )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpPluginsImageBooleanFilters::InvertIntensityImageFilter::
+_GenerateData( )
+{
+  auto o = this->GetInputData( "Input" );
+  cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( o, _GD0 )
+    this->_Error( "Invalid input image." );
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage >
+void cpPluginsImageBooleanFilters::InvertIntensityImageFilter::
+_GD0( _TImage* image )
+{
+  typedef itk::InvertIntensityImageFilter< _TImage > _TFilter;
+
+  // Configure filter
+  auto filter = this->_CreateITK< _TFilter >( );
+  filter->SetInput( image );
+  filter->SetMaximum( this->m_Parameters.GetUint( "Maximum" ) );
+  filter->Update( );
+  this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
+}
+
+// eof - $RCSfile$
diff --git a/plugins/ImageBooleanFilters/InvertIntensityImageFilter.h b/plugins/ImageBooleanFilters/InvertIntensityImageFilter.h
new file mode 100644 (file)
index 0000000..c6422bb
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef __cpPluginsImageBooleanFilters__InvertIntensityImageFilter__h__
+#define __cpPluginsImageBooleanFilters__InvertIntensityImageFilter__h__
+
+#include <cpPluginsImageBooleanFilters_Export.h>
+#include <cpPlugins/BaseObjects/ProcessObject.h>
+
+namespace cpPluginsImageBooleanFilters
+{
+  /**
+   */
+  class cpPluginsImageBooleanFilters_EXPORT InvertIntensityImageFilter
+    : public cpPlugins::BaseObjects::ProcessObject
+  {
+    cpPluginsObject(
+      InvertIntensityImageFilter,
+      cpPlugins::BaseObjects::ProcessObject,
+      ImageBooleanFilters
+      );
+
+  protected:
+    template< class _TImage >
+    inline void _GD0( _TImage* image );
+  };
+
+} // ecapseman
+
+#endif // __cpPluginsImageBooleanFilters__InvertIntensityImageFilter__h__
+
+// eof - $RCSfile$