]> Creatis software - cpPlugins.git/commitdiff
...
authorLeonardo Flórez-Valencia <florez-l@javeriana.edu.co>
Tue, 6 Dec 2016 21:25:21 +0000 (16:25 -0500)
committerLeonardo Flórez-Valencia <florez-l@javeriana.edu.co>
Tue, 6 Dec 2016 21:25:21 +0000 (16:25 -0500)
lib/cpPlugins/BaseObjects/ProcessObject.h
plugins/CMakeLists.txt
plugins/ITKImageInterpolators/InterpolateImageFunction.cxx
plugins/ITKImageInterpolators/InterpolateImageFunction.h
plugins/ITKSliceFilters/CPRImageFilter.cxx
plugins/ITKSliceFilters/ITKSliceFilters.i

index 5dbf8b315ea6fd8a510eb011248a9224037115e8..ce5c5a6ab24a3de6ededc139be98d75eef0648e1 100644 (file)
@@ -51,8 +51,8 @@ namespace cpPlugins
       Parameters* GetParameters( );
       const Parameters* GetParameters( ) const;
 
-      virtual void SetITK( itk::LightObject* o ) final;
-      virtual void SetVTK( vtkObjectBase* o ) final;
+      virtual void SetITK( itk::LightObject* o );
+      virtual void SetVTK( vtkObjectBase* o );
 
       // "Getters"
       std::set< std::string > GetInputsNames( ) const;
index 9a44ffb0f25ba452ba6b1558e865e59720d79c69..4953e5a49757953cc99877f340118c19cfe70d6f 100644 (file)
@@ -73,6 +73,7 @@ TARGET_LINK_LIBRARIES(
 TARGET_LINK_LIBRARIES(
   cpPluginsITKSliceFilters
   cpPluginsITKImageInterpolators
+  cpPluginsITKImageGenericFilters_1
   )
 
 ## eof - $RCSfile$
index 8d85bc9cae1aa236367f3aef017cab0a429f00a2..5089870140538eb4397338bd5d97c26a37e3eb65 100644 (file)
@@ -1,5 +1,21 @@
 #include <ITKImageInterpolators/InterpolateImageFunction.h>
 
+// -------------------------------------------------------------------------
+void cpPluginsITKImageInterpolators::InterpolateImageFunction::
+SetITK( itk::LightObject* o )
+{
+  if( this->m_ITK.GetPointer( ) != o )
+    this->m_ITK = o;
+}
+
+// -------------------------------------------------------------------------
+void cpPluginsITKImageInterpolators::InterpolateImageFunction::
+SetVTK( vtkObjectBase* o )
+{
+  if( this->m_VTK.GetPointer( ) != o )
+    this->m_VTK = o;
+}
+
 // -------------------------------------------------------------------------
 cpPluginsITKImageInterpolators::InterpolateImageFunction::
 InterpolateImageFunction( )
index 88b8b58c667deb5133797cfbfcabc344508dc6e6..3a10dab16151073eeaa90504f645d44f45ad173d 100644 (file)
@@ -21,6 +21,10 @@ namespace cpPluginsITKImageInterpolators
     itkTypeMacro( BaseFilter, cpPlugins::BaseObjects::ProcessObject );
     cpPlugins_Id_Macro( InterpolateImageFunction, ImageInterpolators );
 
+  public:
+    virtual void SetITK( itk::LightObject* o ) cpPlugins_OVERRIDE;
+    virtual void SetVTK( vtkObjectBase* o ) cpPlugins_OVERRIDE;
+
   protected:
     InterpolateImageFunction( );
     virtual ~InterpolateImageFunction( );
index 9c22570bb12e98ec4191d3a6ffd9c2240faa8996..2f84bf5ba1d33e9c30a9495b5272447e7e8f4bed 100644 (file)
@@ -1,28 +1,23 @@
 #include <ITKSliceFilters/CPRImageFilter.h>
 
-/* TODO
-   #include <cpInstances/Image.h>
-   #include <cpInstances/Simple3DCurve.h>
+#include <cpInstances/Image.h>
+#include <cpInstances/Simple3DCurve.h>
 
-   #include <itkImage.h>
-   #include <cpExtensions/DataStructures/Simple3DCurve.h>
-   #include <cpExtensions/Algorithms/CPRImageFilter.h>
-*/
+#include <itkImage.h>
+#include <cpExtensions/DataStructures/Simple3DCurve.h>
+#include <cpExtensions/Algorithms/CPRImageFilter.h>
 
 // -------------------------------------------------------------------------
 cpPluginsITKSliceFilters::CPRImageFilter::
 CPRImageFilter( )
   : Superclass( )
 {
-  /* TODO
-     typedef cpInstances::Image         _TImage;
-     typedef cpInstances::Simple3DCurve _TCurve;
-     this->_ConfigureInput< _TImage >( "Image", true, false );
-     this->_ConfigureInput< _TCurve >( "Curve", true, false );
-     this->_ConfigureOutput< _TImage >( "Output" );
-
-     this->m_Parameters.ConfigureAsReal( "SliceRadius", 1 );
-  */
+  typedef cpInstances::Image         _TImage;
+  typedef cpInstances::Simple3DCurve _TCurve;
+  this->_ConfigureInput< _TImage >( "Image", true, false );
+  this->_ConfigureInput< _TCurve >( "Curve", true, false );
+  this->_ConfigureOutput< _TImage >( "Output" );
+  this->m_Parameters.ConfigureAsReal( "SliceRadius", 1 );
 }
 
 // -------------------------------------------------------------------------
@@ -35,11 +30,9 @@ cpPluginsITKSliceFilters::CPRImageFilter::
 void cpPluginsITKSliceFilters::CPRImageFilter::
 _GenerateData( )
 {
-  /* TODO
-     auto o = this->GetInputData( "Image" );
-     cpPlugins_Demangle_Image_ScalarPixels_1( o, _GD0, 3 )
-     this->_Error( "Invalid input image." );
-  */
+  auto o = this->GetInputData( "Image" );
+  cpPlugins_Demangle_Image_ScalarPixels_1( o, _GD0, 3 )
+    this->_Error( "Invalid input image." );
 }
 
 // -------------------------------------------------------------------------
@@ -47,11 +40,9 @@ template< class _TImage >
 void cpPluginsITKSliceFilters::CPRImageFilter::
 _GD0( _TImage* image )
 {
-  /* TODO
-     auto o = this->GetInputData( "Curve" );
-     cpPlugins_Demangle_Simple3DCurve_All_2( o, _GD1, image )
-     this->_Error( "Invalid input curve." );
-  */
+  auto o = this->GetInputData( "Curve" );
+  cpPlugins_Demangle_Simple3DCurve_All_2( o, _GD1, image )
+    this->_Error( "Invalid input curve." );
 }
 
 // -------------------------------------------------------------------------
@@ -59,16 +50,14 @@ template< class _TCurve, class _TImage >
 void cpPluginsITKSliceFilters::CPRImageFilter::
 _GD1( _TCurve* curve, _TImage* image )
 {
-  /* TODO
-     typedef cpExtensions::Algorithms::CPRImageFilter< _TImage, _TCurve > _TFilter;
-
-     auto filter = this->_CreateITK< _TFilter >( );
-     filter->SetInput( image );
-     filter->SetCurve( curve );
-     filter->SetSliceRadius( this->m_Parameters.GetReal( "SliceRadius" ) );
-     filter->Update( );
-     this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
-  */
+  typedef cpExtensions::Algorithms::CPRImageFilter< _TImage, _TCurve > _TFilter;
+
+  auto filter = this->_CreateITK< _TFilter >( );
+  filter->SetInput( image );
+  filter->SetCurve( curve );
+  filter->SetSliceRadius( this->m_Parameters.GetReal( "SliceRadius" ) );
+  filter->Update( );
+  this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
 }
 
 // eof - $RCSfile$
index c7966b422c96908211b2e3a5fe95d02fbbbf678d..ee71b1c7c7bea149ba7ad335f035fd1d2e765634 100644 (file)
@@ -1,7 +1,20 @@
 header #define ITK_MANUAL_INSTANTIATION
 
-tinclude itkResampleImageFilter:h|hxx
+tinclude itkImageToImageFilter:h|hxx
+tinclude itkInPlaceImageFilter:h|hxx
+instances itk::ImageToImageFilter< itk::Image< #scalar_types#, 3 >, itk::Image< #scalar_types#, 2 > >
+instances itk::InPlaceImageFilter< itk::Image< #scalar_types#, 3 >, itk::Image< #scalar_types#, 2 > >
 
+tinclude itkResampleImageFilter:h|hxx
 instances itk::ResampleImageFilter< itk::Image< #scalar_types#, #pdims# >, itk::Image< #scalar_types#, #pdims# >, #real_types#, #real_types# >
 
+tinclude cpExtensions/Algorithms/IsoImageSlicer:h|hxx
+tinclude itkExtractImageFilter:h|hxx
+tinclude itkJoinSeriesImageFilter:h|hxx
+tinclude itkImageAlgorithm:h|hxx
+
+cinclude cpExtensions/DataStructures/Simple3DCurve.h
+tinclude cpExtensions/Algorithms/CPRImageFilter:h|hxx
+instances cpExtensions::Algorithms::CPRImageFilter< itk::Image< #scalar_types#, 3 >, cpExtensions::DataStructures::Simple3DCurve< #real_types# > >
+
 ** eof - $RCSfile$