]> Creatis software - cpPlugins.git/commitdiff
...
authorLeonardo Flórez-Valencia <florez-l@javeriana.edu.co>
Fri, 4 Nov 2016 00:57:26 +0000 (19:57 -0500)
committerLeonardo Flórez-Valencia <florez-l@javeriana.edu.co>
Fri, 4 Nov 2016 00:57:26 +0000 (19:57 -0500)
16 files changed:
lib/Instances/BaseObjects.i
lib/Instances/CMakeLists.txt
lib/Instances/ImageComplexFilters.i
lib/Instances/ImageInterpolators.i [new file with mode: 0644]
lib/Instances/Transforms.i [new file with mode: 0644]
lib/cpExtensions/Algorithms/CPRImageFilter.h
lib/cpExtensions/Algorithms/CPRImageFilter.hxx
lib/cpExtensions/DataStructures/Simple3DCurve.cxx
lib/cpPlugins/DataObjects/Simple3DCurve.cxx
lib/cpPlugins/DataObjects/Simple3DCurve.d [new file with mode: 0644]
plugins/CMakeLists.txt
plugins/IO/ImageReader.cxx
plugins/ImageGenericFilters/ImageGenericFilters.i
plugins/ImageSliceFilters/CPRImageFilter.cxx [new file with mode: 0644]
plugins/ImageSliceFilters/CPRImageFilter.h [new file with mode: 0644]
plugins/ImageSliceFilters/ImageSliceFilters.i

index 88d6266f5c8debf845b665f87aa10b45567ffba3..704af337161b628322ccd3ae5517331e2a1b8d4b 100644 (file)
@@ -1,5 +1,13 @@
 header #define ITK_MANUAL_INSTANTIATION
+header #include <vnl/vnl_complex_traits.h>
+header VCL_DEFINE_SPECIALIZATION struct vnl_complex_traits< bool >
+header {
+header   enum { isreal = true };
+header   static bool conjugate( bool x ) { return( x ); }
+header   static std::complex< bool > complexify( bool x ) { return( std::complex< bool >( x, false ) ); }
+header };
 
+tinclude itkArray2D:h|hxx
 tinclude itkArray:h|hxx
 tinclude itkFixedArray:h|hxx
 tinclude itk#color_pixels#:h|hxx
@@ -8,11 +16,15 @@ tinclude itk#matrices#:h|hxx
 tinclude itk#diff_tensors#:h|hxx
 tinclude itkSymmetricEigenAnalysis:h|hxx
 tinclude itkSimpleDataObjectDecorator:h|hxx
+tinclude itkVariableLengthVector:h|hxx
 tinclude vnl/vnl_vector:h|hxx
+tinclude vnl/vnl_matrix:h|hxx
 
 cinclude vnl/vnl_c_vector.hxx
 
 instances vnl_vector< bool >
+instances vnl_matrix< bool >
+instances itk::Array2D< #scalar_pixels# >
 instances itk::Array< #scalar_pixels# >
 instances itk::FixedArray< #scalar_pixels#, #process_dims# >
 instances itk::FixedArray< #scalar_pixels#, 8 >
@@ -23,6 +35,7 @@ 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# >
+instances itk::VariableLengthVector< #scalar_pixels# >
 
 define my_vectors=FixedArray;Vector;Point
 
index 62750915d8f943a44f6458987b5320caea995efa..623325a1b24ed296fc73b860a4c7516e08d649bc 100644 (file)
@@ -6,9 +6,11 @@ SET(
   ImageNeighborhoodIterators
   ImageFiltersBases
   ImageComplexFilters
+  ImageInterpolators
   BoundingBoxes
   Meshes
   Paths
+  Transforms
   )
 
 SET(_all_libs)
@@ -31,8 +33,10 @@ 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_ImageComplexFilters cpInstances_ImageFiltersBases cpInstances_ImageIterators)
+TARGET_LINK_LIBRARIES(cpInstances_ImageInterpolators cpInstances_BaseObjects)
 TARGET_LINK_LIBRARIES(cpInstances_BoundingBoxes cpInstances_BaseObjects)
 TARGET_LINK_LIBRARIES(cpInstances_Meshes cpInstances_BoundingBoxes)
 TARGET_LINK_LIBRARIES(cpInstances_Paths cpInstances_BaseObjects ${VTK_LIBRARIES})
+TARGET_LINK_LIBRARIES(cpInstances_Transforms cpInstances_BaseObjects)
 
 ## eof - $RCSfilfe$
index 167c0f5abbd78dd0f29aa8aa099df47bfe62b045..961364c9e71acb48509ba43c38d19f76e98e8b14 100644 (file)
@@ -6,6 +6,11 @@ tinclude itkImageToImageFilter:h|hxx
 tinclude itkInPlaceImageFilter:h|hxx
 tinclude itkRecursiveSeparableImageFilter:h|hxx
 
+instances itk::ImageToImageFilter< itk::Image< #scalar_pixels#, 3 >, itk::Image< #scalar_pixels#, 2 > >
+instances itk::ImageToImageFilter< itk::Image< #scalar_pixels#, 2 >, itk::Image< #scalar_pixels#, 3 > >
+instances itk::InPlaceImageFilter< itk::Image< #scalar_pixels#, 3 >, itk::Image< #scalar_pixels#, 2 > >
+instances itk::InPlaceImageFilter< itk::Image< #scalar_pixels#, 2 >, itk::Image< #scalar_pixels#, 3 > >
+
 instances itk::ImageToImageFilter< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< itk::CovariantVector< #real_types#, #process_dims# >, #process_dims# > >
 instances itk::ImageToImageFilter< itk::Image< itk::CovariantVector< #real_types#, #process_dims# >, #process_dims# >, itk::Image< #scalar_pixels#, #process_dims# > >
 instances itk::RecursiveSeparableImageFilter< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #real_types#, #process_dims# > >
diff --git a/lib/Instances/ImageInterpolators.i b/lib/Instances/ImageInterpolators.i
new file mode 100644 (file)
index 0000000..f4464fd
--- /dev/null
@@ -0,0 +1,14 @@
+header #define ITK_MANUAL_INSTANTIATION
+
+define i_real=#real_types#
+define o_real=#real_types#
+
+tinclude itkImageFunction:h|hxx
+tinclude itkLinearInterpolateImageFunction:h|hxx
+
+cinclude itkImage.h
+
+instances itk::ImageFunction< itk::Image< #scalar_pixels#, #process_dims# >, #i_real#, #o_real# >
+instances itk::LinearInterpolateImageFunction< itk::Image< #scalar_pixels#, #process_dims# >, #real_types# >
+
+** eof - $RCSfile$
diff --git a/lib/Instances/Transforms.i b/lib/Instances/Transforms.i
new file mode 100644 (file)
index 0000000..a242495
--- /dev/null
@@ -0,0 +1,18 @@
+header #define ITK_MANUAL_INSTANTIATION
+
+define tr=AffineTransform
+
+tinclude itkOptimizerParameters:h|hxx
+tinclude itkTransform:h|hxx
+tinclude itkMatrixOffsetTransformBase:h|hxx
+tinclude itk#tr#:h|hxx
+tinclude itkDataObjectDecorator:h|hxx
+
+instances itk::OptimizerParameters< #real_types# >
+instances itk::MatrixOffsetTransformBase< #real_types#, #process_dims#, #process_dims# >
+instances itk::Transform< #real_types#, #process_dims#, #process_dims# >
+instances itk::#tr#< #real_types#, #process_dims# >
+instances itk::DataObjectDecorator< itk::Transform< #real_types#, #process_dims#, #process_dims# > >
+instances itk::DataObjectDecorator< itk::#tr#< #real_types#, #process_dims# > >
+
+** eof - $RCSfile$
index 9161260626a65e242d4477e1a444e58c7190dec7..ed13da33fb4e589b7a32f1f941c47aa2d112267e 100644 (file)
@@ -1,7 +1,9 @@
 #ifndef __cpExtensions__Algorithms__CPRImageFilter__h__
 #define __cpExtensions__Algorithms__CPRImageFilter__h__
 
+#include <vector>
 #include <itkImageToImageFilter.h>
+#include <itkJoinSeriesImageFilter.h>
 #include <cpExtensions/Algorithms/IsoImageSlicer.h>
 
 namespace cpExtensions
@@ -24,8 +26,11 @@ namespace cpExtensions
       typedef _TCurve TCurve;
       typedef typename TCurve::TScalar TScalar;
 
-      typedef IsoImageSlicer< TImage, TScalar > TSlicer;
+      typedef IsoImageSlicer< TImage, TScalar >      TSlicer;
       typedef typename TSlicer::TInterpolateFunction TInterpolateFunction;
+      typedef typename TSlicer::TSliceImage          TSliceImage;
+
+      typedef itk::JoinSeriesImageFilter< TSliceImage, TImage > TJoinFilter;
 
     public:
       itkNewMacro( Self );
@@ -53,6 +58,9 @@ namespace cpExtensions
     protected:
       double m_SliceRadius;
       typename TInterpolateFunction::Pointer m_Interpolator;
+
+      std::vector< typename TSlicer::Pointer > m_Slicers;
+      typename TJoinFilter::Pointer            m_Join;
     };
 
   } // ecapseman
index b2b8d969b1a6e69a8bfcbd7060f8c270c1e892e4..de76e7fd266e755d5327cd80c6fcb578f563f558 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef __cpExtensions__Algorithms__CPRImageFilter__hxx__
 #define __cpExtensions__Algorithms__CPRImageFilter__hxx__
 
-#include <itkImageRegionIterator.h>
-#include <itkImageSliceIteratorWithIndex.h>
 #include <itkMinimumMaximumImageCalculator.h>
 
 // -------------------------------------------------------------------------
@@ -72,9 +70,7 @@ template< class _TImage, class _TCurve >
 void cpExtensions::Algorithms::CPRImageFilter< _TImage, _TCurve >::
 GenerateData( )
 {
-  typedef itk::MinimumMaximumImageCalculator< _TImage >           _TMinMax;
-  typedef itk::ImageSliceIteratorWithIndex< _TImage >               _T3DIt;
-  typedef itk::ImageRegionIterator< typename TSlicer::TSliceImage > _T2DIt;
+  typedef itk::MinimumMaximumImageCalculator< _TImage > _TMinMax;
 
   auto input = this->GetInput( );
   auto curve = this->GetCurve( );
@@ -85,50 +81,45 @@ GenerateData( )
   minmax->SetImage( input );
   minmax->Compute( );
 
-  // Prepare slicer
-  typename TSlicer::Pointer slicer = TSlicer::New( );
-  slicer->SetInput( input );
-  slicer->SetDefaultValue( minmax->GetMinimum( ) );
-  slicer->SpacingFromMinimumOn( );
-  if( this->m_Interpolator.IsNotNull( ) )
-    slicer->SetInterpolator( this->m_Interpolator );
-  slicer->SizeFromMaximumOff( );
-  if( this->m_SliceRadius > double( 0 ) )
-  {
-    slicer->SizeFromMinimumOff( );
-    slicer->SetSize( this->m_SliceRadius );
-  }
-  else
-    slicer->SizeFromMinimumOn( );
-
-  // Slice image
-  _T3DIt oIt( output, output->GetRequestedRegion( ) );
-  oIt.SetFirstDirection( 1 );
-  oIt.SetSecondDirection( 2 );
-  oIt.GoToBegin( );
+  // Main loop
+  this->m_Join = TJoinFilter::New( );
+  this->m_Slicers.clear( );
   unsigned long N = curve->GetNumberOfPoints( );
+  double len = 0;
+  typename _TCurve::TPoint p, q;
   for( unsigned long n = 0; n < N; ++n )
   {
-    slicer->SetTranslation( curve->GetPoint( n ) );
+    p = curve->GetPoint( n );
+    if( n > 0 )
+      len += p.EuclideanDistanceTo( q );
+    q = p;
+
+    // Prepare slicer
+    typename TSlicer::Pointer slicer = TSlicer::New( );
+    slicer->SetInput( input );
+    slicer->SetDefaultValue( minmax->GetMinimum( ) );
+    slicer->SpacingFromMinimumOn( );
+    if( this->m_Interpolator.IsNotNull( ) )
+      slicer->SetInterpolator( this->m_Interpolator );
+    slicer->SizeFromMaximumOff( );
+    if( this->m_SliceRadius > double( 0 ) )
+    {
+      slicer->SizeFromMinimumOff( );
+      slicer->SetSize( this->m_SliceRadius );
+    }
+    else
+      slicer->SizeFromMinimumOn( );
+    slicer->SetTranslation( p );
     slicer->SetRotation( curve->GetFrame( n ) );
     slicer->Update( );
 
-    // Fill output image
-    _T2DIt sIt(
-      slicer->GetOutput( ), slicer->GetOutput( )->GetRequestedRegion( )
-      );
-    for( sIt.GoToBegin( ); !sIt.IsAtEnd( ); ++sIt )
-    {
-      oIt.Set( sIt.Get( ) );
-      ++oIt;
-      if( oIt.IsAtEndOfLine( ) )
-        oIt.NextLine( );
-      if( oIt.IsAtEndOfSlice( ) )
-        oIt.NextSlice( );
-
-    } // rof
+    this->m_Join->SetInput( n, slicer->GetOutput( ) );
+    this->m_Slicers.push_back( slicer );
 
   } // rof
+  this->m_Join->SetSpacing( len / double( N ) );
+  this->m_Join->Update( );
+  this->GetOutput( )->Graft( this->m_Join->GetOutput( ) );
 }
 
 #endif // __cpExtensions__Algorithms__CPRImageFilter__hxx__
index cda4399703e2a29f4b3636bce914b689b67360a9..1d1a92e000bcf114c7bd9873aa96b0063aa0f326 100644 (file)
@@ -50,6 +50,10 @@ GetFrame( unsigned int id ) const
     prev_no[ 1 ] = _TScalar( 1 );
     for( unsigned int i = 0; i < N; ++i )
     {
+      auto ntg = tg[ i ].GetNorm( );
+      if( double( ntg ) > double( 0 ) )
+        tg[ i ] /= ntg;
+
       _TScalar ct = prev_tg * tg[ i ];
       TVector a = itk::CrossProduct( prev_tg, tg[ i ] );
       _TScalar st = a.GetNorm( );
@@ -60,6 +64,10 @@ GetFrame( unsigned int id ) const
         ( prev_no * ct ) +
         ( itk::CrossProduct( a, prev_no ) * st ) +
         ( a * ( ( a * prev_no ) * ( _TScalar( 1 ) - ct ) ) );
+      auto nno = no[ i ].GetNorm( );
+      if( double( nno ) > double( 0 ) )
+        no[ i ] /= nno;
+
       bn[ i ] = itk::CrossProduct( tg[ i ], no[ i ] );
 
       prev_tg = tg[ i ];
@@ -80,7 +88,6 @@ GetFrame( unsigned int id ) const
       } // rof
       this->m_Frames.push_back( m );
 
-
     } // rof
 
     this->m_FramesUpdated = true;
index 27097c9f61072873f73973f1095e687888377f48..7f79bba05399b424d066b040cd9eff1a7f1e9eaa 100644 (file)
@@ -2,24 +2,17 @@
 #include <cpExtensions/DataStructures/Simple3DCurve.h>
 #include <cpExtensions/Visualization/Simple3DCurveToPolyData.h>
 
+#include <cpPlugins/DataObjects/Simple3DCurve_Demanglers.h>
+
 // -------------------------------------------------------------------------
 void cpPlugins::DataObjects::Simple3DCurve::
 SetITK( itk::LightObject* o )
 {
-  typedef cpExtensions::DataStructures::Simple3DCurve< float >  _TF;
-  typedef cpExtensions::DataStructures::Simple3DCurve< double > _TD;
-
-  this->Superclass::SetITK( o );
-  auto lf = dynamic_cast< _TF* >( o );
-  auto ld = dynamic_cast< _TD* >( o );
-  if     ( lf != NULL ) this->_ITK_2_VTK( lf );
-  else if( ld != NULL ) this->_ITK_2_VTK( ld );
-  else
+  cpPlugins_Demangle_Simple3DCurve_All_1( o, _ITK_2_VTK )
   {
     this->m_VTK = NULL;
     this->m_ITKvVTK = NULL;
-
-  } // fi
+  }
 }
 
 // -------------------------------------------------------------------------
diff --git a/lib/cpPlugins/DataObjects/Simple3DCurve.d b/lib/cpPlugins/DataObjects/Simple3DCurve.d
new file mode 100644 (file)
index 0000000..998b791
--- /dev/null
@@ -0,0 +1,4 @@
+
+All cpExtensions::DataStructures::Simple3DCurve< #real_types# >
+
+** eof - $RCSfile$
index c8223be128b1c859e58e39da9655aa64c2633a7f..fbe5996c7ac3a254505b3423b0180942c6f7f1bc 100644 (file)
@@ -48,6 +48,10 @@ TARGET_LINK_LIBRARIES(
   cpPluginsImageDistanceMaps
   cpPluginsImageThresholdFilters
   )
+TARGET_LINK_LIBRARIES(
+  cpPluginsImageSliceFilters
+  cpPluginsImageGenericFilters
+  )
 IF(ParabolicMorphology_LOADED)
   TARGET_LINK_LIBRARIES(
     cpPluginsImageParaMorphologyFilters
index 972ae5b05e136243a0d8a760dc885acf1bd8b2b4..ffd3e8b807642fe871d3f14a32831eea14737a79 100644 (file)
@@ -129,12 +129,12 @@ _GD0( itk::ImageIOBase* io )
     if( ct == itk::ImageIOBase::LONG ) success = this->_GD1< long, _Dim >( io );
     if( ct == itk::ImageIOBase::ULONG ) success = this->_GD1< ulong, _Dim >( io );
 #endif // cpPlugins_CONFIG_INTEGER_TYPES_long
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_float
+#ifdef cpPlugins_CONFIG_REAL_TYPES_float
     if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< float, _Dim >( io );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_float
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_double
+#endif // cpPlugins_CONFIG_REAL_TYPES_float
+#ifdef cpPlugins_CONFIG_REAL_TYPES_double
     if( ct == itk::ImageIOBase::DOUBLE ) success = this->_GD1< double, _Dim >( io );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_double
+#endif // cpPlugins_CONFIG_REAL_TYPES_double
   }
   else if( pt == itk::ImageIOBase::RGB )
   {
@@ -155,12 +155,12 @@ _GD0( itk::ImageIOBase* io )
     if( ct == itk::ImageIOBase::LONG ) success = this->_GD1< itk::RGBPixel< long >, _Dim >( io );
     if( ct == itk::ImageIOBase::ULONG ) success = this->_GD1< itk::RGBPixel< ulong >, _Dim >( io );
 #  endif // cpPlugins_CONFIG_INTEGER_TYPES_long
-#  ifdef cpPlugins_CONFIG_INTEGER_TYPES_float
+#  ifdef cpPlugins_CONFIG_REAL_TYPES_float
     if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< itk::RGBPixel< float >, _Dim >( io );
-#  endif // cpPlugins_CONFIG_INTEGER_TYPES_float
-#  ifdef cpPlugins_CONFIG_INTEGER_TYPES_double
+#  endif // cpPlugins_CONFIG_REAL_TYPES_float
+#  ifdef cpPlugins_CONFIG_REAL_TYPES_double
     if( ct == itk::ImageIOBase::DOUBLE ) success = this->_GD1< itk::RGBPixel< double >, _Dim >( io );
-#  endif // cpPlugins_CONFIG_INTEGER_TYPES_double
+#  endif // cpPlugins_CONFIG_REAL_TYPES_double
 #endif // cpPlugins_CONFIG_COLOR_PIXELS_RGBPixel
   }
   else if( pt == itk::ImageIOBase::RGBA )
@@ -182,81 +182,81 @@ _GD0( itk::ImageIOBase* io )
     if( ct == itk::ImageIOBase::LONG ) success = this->_GD1< itk::RGBAPixel< long >, _Dim >( io );
     if( ct == itk::ImageIOBase::ULONG ) success = this->_GD1< itk::RGBAPixel< ulong >, _Dim >( io );
 #  endif // cpPlugins_CONFIG_INTEGER_TYPES_long
-#  ifdef cpPlugins_CONFIG_INTEGER_TYPES_float
+#  ifdef cpPlugins_CONFIG_REAL_TYPES_float
     if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< itk::RGBAPixel< float >, _Dim >( io );
-#  endif // cpPlugins_CONFIG_INTEGER_TYPES_float
-#  ifdef cpPlugins_CONFIG_INTEGER_TYPES_double
+#  endif // cpPlugins_CONFIG_REAL_TYPES_float
+#  ifdef cpPlugins_CONFIG_REAL_TYPES_double
     if( ct == itk::ImageIOBase::DOUBLE ) success = this->_GD1< itk::RGBAPixel< double >, _Dim >( io );
-#  endif // cpPlugins_CONFIG_INTEGER_TYPES_double
+#  endif // cpPlugins_CONFIG_REAL_TYPES_double
 #endif // cpPlugins_CONFIG_COLOR_PIXELS_RGBAPixel
   }
   else if( pt == itk::ImageIOBase::COMPLEX )
   {
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_float
+#ifdef cpPlugins_CONFIG_REAL_TYPES_float
     if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< std::complex< float >, _Dim >( io );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_float
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_double
+#endif // cpPlugins_CONFIG_REAL_TYPES_float
+#ifdef cpPlugins_CONFIG_REAL_TYPES_double
     if( ct == itk::ImageIOBase::DOUBLE ) success = this->_GD1< std::complex< double >, _Dim >( io );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_double
+#endif // cpPlugins_CONFIG_REAL_TYPES_double
   }
   else if( pt == itk::ImageIOBase::COVARIANTVECTOR )
   {
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_float
+#ifdef cpPlugins_CONFIG_REAL_TYPES_float
     if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< itk::CovariantVector< float, _Dim >, _Dim >( io );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_float
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_double
+#endif // cpPlugins_CONFIG_REAL_TYPES_float
+#ifdef cpPlugins_CONFIG_REAL_TYPES_double
     if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< itk::CovariantVector< double, _Dim >, _Dim >( io );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_double
+#endif // cpPlugins_CONFIG_REAL_TYPES_double
   }
   else if( pt == itk::ImageIOBase::POINT )
   {
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_float
+#ifdef cpPlugins_CONFIG_REAL_TYPES_float
     if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< itk::Point< float, _Dim >, _Dim >( io );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_float
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_double
+#endif // cpPlugins_CONFIG_REAL_TYPES_float
+#ifdef cpPlugins_CONFIG_REAL_TYPES_double
     if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< itk::Point< double, _Dim >, _Dim >( io );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_double
+#endif // cpPlugins_CONFIG_REAL_TYPES_double
   }
   else if( pt == itk::ImageIOBase::VECTOR )
   {
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_float
+#ifdef cpPlugins_CONFIG_REAL_TYPES_float
     if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< itk::Vector< float, _Dim >, _Dim >( io );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_float
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_double
+#endif // cpPlugins_CONFIG_REAL_TYPES_float
+#ifdef cpPlugins_CONFIG_REAL_TYPES_double
     if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< itk::Vector< double, _Dim >, _Dim >( io );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_double
+#endif // cpPlugins_CONFIG_REAL_TYPES_double
   }
   else if( pt == itk::ImageIOBase::SYMMETRICSECONDRANKTENSOR )
   {
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_float
+#ifdef cpPlugins_CONFIG_REAL_TYPES_float
     if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< itk::SymmetricSecondRankTensor< float, _Dim >, _Dim >( io );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_float
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_double
+#endif // cpPlugins_CONFIG_REAL_TYPES_float
+#ifdef cpPlugins_CONFIG_REAL_TYPES_double
     if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< itk::SymmetricSecondRankTensor< double, _Dim >, _Dim >( io );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_double
+#endif // cpPlugins_CONFIG_REAL_TYPES_double
   }
   else if( pt == itk::ImageIOBase::DIFFUSIONTENSOR3D )
   {
     if( _Dim == 3 )
     {
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_float
+#ifdef cpPlugins_CONFIG_REAL_TYPES_float
       if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< itk::DiffusionTensor3D< float >, _Dim >( io );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_float
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_double
+#endif // cpPlugins_CONFIG_REAL_TYPES_float
+#ifdef cpPlugins_CONFIG_REAL_TYPES_double
       if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< itk::DiffusionTensor3D< double >, _Dim >( io );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_double
+#endif // cpPlugins_CONFIG_REAL_TYPES_double
     }
     else
       this->_Error( "DiffusionTensor3D dimension not supported." );
   }
   else if( pt == itk::ImageIOBase::MATRIX )
   {
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_float
+#ifdef cpPlugins_CONFIG_REAL_TYPES_float
     if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< itk::Matrix< float, _Dim, _Dim >, _Dim >( io );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_float
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_double
+#endif // cpPlugins_CONFIG_REAL_TYPES_float
+#ifdef cpPlugins_CONFIG_REAL_TYPES_double
     if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< itk::Matrix< double, _Dim, _Dim >, _Dim >( io );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_double
+#endif // cpPlugins_CONFIG_REAL_TYPES_double
   }
   else if( pt == itk::ImageIOBase::OFFSET )
   {
index 5ddb4523ce4df895744b26b5d8f44e7f85e90548..360bcbd58c4ebfb0b7aa4b80039d8bfec2c2c3ef 100644 (file)
@@ -3,11 +3,13 @@ header #define ITK_MANUAL_INSTANTIATION
 tinclude itkRegionOfInterestImageFilter:h|hxx
 tinclude itkRescaleIntensityImageFilter:h|hxx
 tinclude itkMinimumMaximumImageCalculator:h|hxx
+tinclude itkExtractImageFilter:h|hxx
 
 cinclude itk#color_pixels#.h
 cinclude itkImageAlgorithm.hxx
 cinclude itkUnaryFunctorImageFilter.hxx
 
+instances itk::ExtractImageFilter< itk::Image< #scalar_pixels#, 3 >, itk::Image< #scalar_pixels#, 2 > >
 instances itk::RegionOfInterestImageFilter< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #scalar_pixels#, #process_dims# > >
 instances itk::RegionOfInterestImageFilter< itk::Image< itk::#color_pixels#< #scalar_pixels# >, #process_dims# >, itk::Image< itk::#color_pixels#< #scalar_pixels# >, #process_dims# > >
 
diff --git a/plugins/ImageSliceFilters/CPRImageFilter.cxx b/plugins/ImageSliceFilters/CPRImageFilter.cxx
new file mode 100644 (file)
index 0000000..4e80ed2
--- /dev/null
@@ -0,0 +1,66 @@
+#include <ImageSliceFilters/CPRImageFilter.h>
+#include <cpPlugins/DataObjects/Image.h>
+#include <cpPlugins/DataObjects/Simple3DCurve.h>
+
+#include <cpPlugins/DataObjects/Image_Demanglers.h>
+#include <cpPlugins/DataObjects/Simple3DCurve_Demanglers.h>
+
+#include <itkImage.h>
+#include <cpExtensions/DataStructures/Simple3DCurve.h>
+#include <cpExtensions/Algorithms/CPRImageFilter.h>
+
+// -------------------------------------------------------------------------
+cpPluginsImageSliceFilters::CPRImageFilter::
+CPRImageFilter( )
+  : Superclass( )
+{
+  typedef cpPlugins::DataObjects::Image _TImage;
+  typedef cpPlugins::DataObjects::Simple3DCurve _TCurve;
+  this->_ConfigureInput< _TImage >( "Image", true, false );
+  this->_ConfigureInput< _TCurve >( "Curve", true, false );
+  this->_ConfigureOutput< _TImage >( "Output" );
+
+  this->m_Parameters.ConfigureAsReal( "SliceRadius", 1 );
+}
+
+// -------------------------------------------------------------------------
+cpPluginsImageSliceFilters::CPRImageFilter::
+~CPRImageFilter( )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpPluginsImageSliceFilters::CPRImageFilter::
+_GenerateData( )
+{
+  auto o = this->GetInputData( "Image" );
+  cpPlugins_Demangle_Image_ScalarPixels_1( o, _GD0, 3 )
+    this->_Error( "Invalid input image." );
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage >
+void cpPluginsImageSliceFilters::CPRImageFilter::
+_GD0( _TImage* image )
+{
+  auto o = this->GetInputData( "Curve" );
+  cpPlugins_Demangle_Simple3DCurve_All_2( o, _GD1, image )
+    this->_Error( "Invalid input curve." );
+}
+
+// -------------------------------------------------------------------------
+template< class _TCurve, class _TImage >
+void cpPluginsImageSliceFilters::CPRImageFilter::
+_GD1( _TCurve* curve, _TImage* image )
+{
+  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$
diff --git a/plugins/ImageSliceFilters/CPRImageFilter.h b/plugins/ImageSliceFilters/CPRImageFilter.h
new file mode 100644 (file)
index 0000000..faab230
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef __cpPluginsImageSliceFilters__CPRImageFilter__h__
+#define __cpPluginsImageSliceFilters__CPRImageFilter__h__
+
+#include <cpPluginsImageSliceFilters_Export.h>
+#include <cpPlugins/BaseObjects/ProcessObject.h>
+
+namespace cpPluginsImageSliceFilters
+{
+  /**
+   */
+  class cpPluginsImageSliceFilters_EXPORT CPRImageFilter
+    : public cpPlugins::BaseObjects::ProcessObject
+  {
+    cpPluginsObject(
+      CPRImageFilter,
+      cpPlugins::BaseObjects::ProcessObject,
+      ImageSliceFilters
+      );
+
+  protected:
+    template< class _TImage >
+    inline void _GD0( _TImage* image );
+
+    template< class _TCurve, class _TImage >
+    inline void _GD1( _TCurve* curve, _TImage* image );
+  };
+
+} // ecapseman
+
+#endif // __cpPluginsImageSliceFilters__CPRImageFilter__h__
+
+// eof - $RCSfile$
index 69bbbd5bb5531cc3daf96c3635c70d40397fee31..e2fdf0d55a497c8d616e692d87703bdee8e2af47 100644 (file)
@@ -1,6 +1,19 @@
+header #define ITK_MANUAL_INSTANTIATION
 
 tinclude cpExtensions/Algorithms/CPRImageFilter:h|hxx
+tinclude cpExtensions/Algorithms/IsoImageSlicer:h|hxx
+tinclude itkResampleImageFilter:h|hxx
+tinclude itkJoinSeriesImageFilter:h|hxx
+
 cinclude cpExtensions/DataStructures/Simple3DCurve.h
+cinclude itkImageAlgorithm.hxx
+
+instances itk::ResampleImageFilter< itk::Image< #scalar_pixels#, 3u >, itk::Image< #scalar_pixels#, 3u >, #real_types#, #real_types# >
+
+instances itk::JoinSeriesImageFilter< itk::Image< #scalar_types#, 2 >, itk::Image< #scalar_types#, 3 > >
+
+instances cpExtensions::Algorithms::BaseImageSlicer< itk::ResampleImageFilter< itk::Image< #scalar_pixels#, 3u >, itk::Image< #scalar_pixels#, 3u >, #real_types#, #real_types# >, itk::InterpolateImageFunction< itk::Image< #scalar_pixels#, 3u >, #real_types# > >
+
 
 instances cpExtensions::Algorithms::CPRImageFilter< itk::Image< #scalar_pixels#, 3 >, cpExtensions::DataStructures::Simple3DCurve< #real_types# > >