]> Creatis software - FrontAlgorithms.git/commitdiff
...
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Sun, 17 Apr 2016 00:23:16 +0000 (19:23 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Sun, 17 Apr 2016 00:23:16 +0000 (19:23 -0500)
19 files changed:
appli/TempAirwaysAppli/TempAirwaysAppli.cxx
plugins/fpa/ExtractEndPointsAndBifurcationsFromMinimumSpanningTree.cxx
plugins/fpa/ExtractEndPointsAndBifurcationsFromMinimumSpanningTree.h
plugins/fpa/ExtractPathFromMinimumSpanningTree.cxx
plugins/fpa/ExtractPathFromMinimumSpanningTree.h
plugins/fpa/GradientBaseImageFunctionSource.cxx
plugins/fpa/GradientBaseImageFunctionSource.h
plugins/fpa/ImageDijkstra.cxx
plugins/fpa/ImageDijkstra.h
plugins/fpa/ImageRegionGrow.cxx
plugins/fpa/ImageRegionGrow.h
plugins/fpa/InvertCostFunction.cxx
plugins/fpa/InvertCostFunction.h
plugins/fpa/MinimumSpanningTreeReader.cxx
plugins/fpa/MinimumSpanningTreeReader.h
plugins/fpa/MinimumSpanningTreeWriter.cxx
plugins/fpa/MinimumSpanningTreeWriter.h
plugins/fpa/RegionGrowThresholdFunction.cxx
plugins/fpa/RegionGrowThresholdFunction.h

index 9e3692d23b6d5548a0c48983ca68555725f29074..ff6eaeb2d7d49e1638dc791fac0e774d3de23d79 100644 (file)
@@ -121,8 +121,11 @@ int main( int argc, char* argv[] )
       {
         for(unsigned int i = 0; i < treeInfoVector.size(); ++ i){
           TreeInfo info = treeInfoVector[i];
-          std::string err = info.myWorkspace->Execute( "eb" );
-          if( err != "" )
+          try
+          {
+            info.myWorkspace->Execute( "eb" );
+          }
+          catch( itk::ExceptionObject& err )
           {
             std::cerr << "Error: " << err << std::endl;
             std::exit( 1 );
index 8078a67856b61512b08bad78dedf8a3436a70cb1..73fbad0c95e7e2c05508bfde2e6f521dd15f9119 100644 (file)
@@ -29,40 +29,30 @@ fpaPlugins::ExtractEndPointsAndBifurcationsFromMinimumSpanningTree::
 }
 
 // -------------------------------------------------------------------------
-std::string fpaPlugins::ExtractEndPointsAndBifurcationsFromMinimumSpanningTree::
+void fpaPlugins::ExtractEndPointsAndBifurcationsFromMinimumSpanningTree::
 _GenerateData( )
 {
   auto image = this->GetInputData( "CostsImage" )->GetITK< itk::DataObject >( );
-  std::string   r = cpPlugin_Image_Demangle_Pixel_Dim( _GD0, image, float, 2 );
-  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( _GD0, image, double, 2 );
-  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( _GD0, image, float, 3 );
-  if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( _GD0, image, double, 3 );
-  return( r );
+  cpPlugins_Image_Demangle_Pixel_AllFloats     ( _GD0, image, 2 );
+  else cpPlugins_Image_Demangle_Pixel_AllFloats( _GD0, image, 3 );
+  else this->_Error( "Invalid input costs." );
 }
 
 // -------------------------------------------------------------------------
 template< class _TImage >
-std::string fpaPlugins::ExtractEndPointsAndBifurcationsFromMinimumSpanningTree::
+void fpaPlugins::ExtractEndPointsAndBifurcationsFromMinimumSpanningTree::
 _GD0( _TImage* image )
 {
   typedef fpa::Image::MinimumSpanningTree< _TImage::ImageDimension > _TMST;
   typedef fpa::Image::ExtractEndPointsAndBifurcationsFromMinimumSpanningTree< _TImage, _TMST > _TFilter;
 
   // Check input objects' integrity
-  if( image == NULL )
-    return(
-      "fpaPlugins::ExtractEndPointsAndBifurcationsFromMinimumSpanningTree: No valid input costs image."
-      );
   auto dmap = this->GetInputData( "DistanceMap" )->GetITK< _TImage >( );
   if( dmap == NULL )
-    return(
-      "fpaPlugins::ExtractEndPointsAndBifurcationsFromMinimumSpanningTree: Distance map does not have the same type as the costs image."
-      );
+    this->_Error( "Distance map does not have the same type as the costs image." );
   auto mst = this->GetInputData( "MST" )->GetITK< _TMST >( );
   if( mst == NULL )
-    return(
-      "fpaPlugins::ExtractEndPointsAndBifurcationsFromMinimumSpanningTree: No valid input tree."
-      );
+    this->_Error( "No valid input tree." );
 
   // Create filter and connect inputs
   _TFilter* filter = this->_CreateITK< _TFilter >( );
@@ -78,7 +68,6 @@ _GD0( _TImage* image )
   this->GetOutputData( "Bifurcations" )->SetITK( filter->GetBifurcations( ) );
   this->GetOutputData( "Collisions" )->SetITK( filter->GetCollisions( ) );
   this->GetOutputData( "Skeleton" )->SetITK( filter->GetSkeleton( ) );
-  return( "" );
 }
 
 // eof - $RCSfile$
index 5b85ca5b402e2038b444eac9f5d3bb14770a9006..27b0efca8f6347e2fc2adebfc4a03e0a50cd218c 100644 (file)
@@ -32,10 +32,10 @@ namespace fpaPlugins
     ExtractEndPointsAndBifurcationsFromMinimumSpanningTree( );
     virtual ~ExtractEndPointsAndBifurcationsFromMinimumSpanningTree( );
 
-    virtual std::string _GenerateData( ) ITK_OVERRIDE;
+    virtual void _GenerateData( ) ITK_OVERRIDE;
 
     template< class _TImage >
-      inline std::string _GD0( _TImage* image );
+      inline void _GD0( _TImage* image );
 
   private:
     // Purposely not implemented.
index c263b9c0c09ab8830a78c513fa61f6c7e6a2a75d..7e41b4f6dc337bd7d20295c40ac4c2ea94668556 100644 (file)
@@ -25,7 +25,7 @@ fpaPlugins::ExtractPathFromMinimumSpanningTree::
 }
 
 // -------------------------------------------------------------------------
-std::string fpaPlugins::ExtractPathFromMinimumSpanningTree::
+void fpaPlugins::ExtractPathFromMinimumSpanningTree::
 _GenerateData( )
 {
   typedef fpa::Image::MinimumSpanningTree< 2 > _2DMST;
@@ -34,33 +34,25 @@ _GenerateData( )
   auto mst = this->GetInputData( "MST" )->GetITK< itk::DataObject >( );
   auto mst2 = dynamic_cast< _2DMST* >( mst );
   auto mst3 = dynamic_cast< _3DMST* >( mst );
-  std::string   r = this->_GD0( mst2 );
-  if( r != "" ) r = this->_GD0( mst3 );
-  return( r );
+  if     ( mst2 != NULL ) this->_GD0( mst2 );
+  else if( mst3 != NULL ) this->_GD0( mst3 );
+  else this->_Error( "Invalid input MST." );
 }
 
 // -------------------------------------------------------------------------
 template< class _TMST >
-std::string fpaPlugins::ExtractPathFromMinimumSpanningTree::
+void fpaPlugins::ExtractPathFromMinimumSpanningTree::
 _GD0( _TMST* mst )
 {
   typedef fpa::Base::ExtractPathFromMinimumSpanningTree< _TMST > _TFilter;
   typedef
     cpExtensions::DataStructures::ImageIndexesContainer< _TMST::Dimension >
     _TVertices;
-  if( mst == NULL )
-    return(
-      "fpaPlugins::ExtractPathFromMinimumSpanningTree: No valid input tree."
-      );
   auto vertices = this->GetInputData( "Seeds" )->GetITK< _TVertices >( );
   if( vertices == NULL )
-    return(
-      "fpaPlugins::ExtractPathFromMinimumSpanningTree: No valid vertices."
-      );
+    this->_Error( "No valid vertices." );
   if( vertices->Get( ).size( ) < 2 )
-    return(
-      "fpaPlugins::ExtractPathFromMinimumSpanningTree: Not enough vertices."
-      );
+    this->_Error( "Not enough vertices." );
   auto v0 = vertices->Get( )[ this->m_Parameters.GetUint( "Vertex0" ) ];
   auto v1 = vertices->Get( )[ this->m_Parameters.GetUint( "Vertex1" ) ];
 
@@ -73,7 +65,6 @@ _GD0( _TMST* mst )
 
   // Connect output and finish
   this->GetOutputData( "Output" )->SetITK( filter->GetOutput( ) );
-  return( "" );
 }
 
 // eof - $RCSfile$
index d0d407b7f15e6171e93c0a2ae27e90e7eaac41c4..fd445bd5ffb9c529fd015311b9073ab71a15977a 100644 (file)
@@ -30,10 +30,10 @@ namespace fpaPlugins
     ExtractPathFromMinimumSpanningTree( );
     virtual ~ExtractPathFromMinimumSpanningTree( );
 
-    virtual std::string _GenerateData( ) ITK_OVERRIDE;
+    virtual void _GenerateData( ) ITK_OVERRIDE;
 
     template< class _TMST >
-      inline std::string _GD0( _TMST* mst );
+      inline void _GD0( _TMST* mst );
 
   private:
     // Purposely not implemented.
index 926523d9dcdbe162e439d5253f87b0392ba39fe2..df069d3cfea9a9671b3174820e24d4b5e3e0e693 100644 (file)
@@ -35,38 +35,34 @@ fpaPlugins::GradientBaseImageFunctionSource::
 }
 
 // -------------------------------------------------------------------------
-std::string fpaPlugins::GradientBaseImageFunctionSource::
+void fpaPlugins::GradientBaseImageFunctionSource::
 _GenerateData( )
 {
   auto image = this->GetInputData( "Input" )->GetITK< itk::DataObject >( );
-  std::string   cpPlugin_Image_Demangle_VectorPixel_AllFloats( r, _GD0, image, itk::CovariantVector, 2 );
-  if( r != "" ) cpPlugin_Image_Demangle_VectorPixel_AllFloats( r, _GD0, image, itk::CovariantVector, 3 );
-  return( r );
+  cpPlugins_Image_Demangle_VectorPixel_AllFloats     ( _GD0, image, CovariantVector, 2 );
+  else cpPlugins_Image_Demangle_VectorPixel_AllFloats( _GD0, image, CovariantVector, 3 );
+  else this->_Error( "Invalid input image." );
 }
 
 // -------------------------------------------------------------------------
 template< class _TImage >
-std::string fpaPlugins::GradientBaseImageFunctionSource::
+void fpaPlugins::GradientBaseImageFunctionSource::
 _GD0( _TImage* image )
 {
   typedef fpa::Image::Functors::GulsunTekMedialness< _TImage > _TGT;
   typedef fpa::Image::Functors::FluxMedialness< _TImage > _TFl;
   typedef fpa::Image::Functors::MFluxMedialness< _TImage > _TMFl;
 
-  if( image == NULL )
-    return( "GradientBaseImageFunctionSource: Invalid input image." );
-
   auto ft = this->m_Parameters.GetSelectedChoice( "FunctionType" );
-  if     ( ft == "Gulsun&Tek" ) return( this->_GD1< _TImage, _TGT >( image ) );
-  else if( ft == "Flux" )       return( this->_GD1< _TImage, _TFl >( image ) );
-  else if( ft == "MFlux" )      return( this->_GD1< _TImage, _TMFl >( image ) );
-  else
-    return( "GradientBaseImageFunctionSource: Invalid function type." );
+  if     ( ft == "Gulsun&Tek" ) this->_GD1< _TImage, _TGT >( image );
+  else if( ft == "Flux" )       this->_GD1< _TImage, _TFl >( image );
+  else if( ft == "MFlux" )      this->_GD1< _TImage, _TMFl >( image );
+  else this->_Error( "Invalid function type." );
 }
 
 // -------------------------------------------------------------------------
 template< class _TImage, class _TFunction >
-std::string fpaPlugins::GradientBaseImageFunctionSource::
+void fpaPlugins::GradientBaseImageFunctionSource::
 _GD1( _TImage* image )
 {
   typedef itk::Image< typename _TFunction::TOutput, _TImage::ImageDimension > _TOutImage;
@@ -92,7 +88,6 @@ _GD1( _TImage* image )
 
   // Connect output and finish
   this->GetOutputData( "Output" )->SetITK( filter->GetOutput( ) );
-  return( "" );
 }
 
 // eof - $RCSfile$
index 97862a25a1be4710f94d21d9405bccd1288105e8..feae73096c78d84d049791bad4e14ea0aaa78742 100644 (file)
@@ -30,13 +30,13 @@ namespace fpaPlugins
     GradientBaseImageFunctionSource( );
     virtual ~GradientBaseImageFunctionSource( );
 
-    virtual std::string _GenerateData( ) ITK_OVERRIDE;
+    virtual void _GenerateData( ) ITK_OVERRIDE;
 
     template< class _TImage >
-      inline std::string _GD0( _TImage* image );
+      inline void _GD0( _TImage* image );
 
     template< class _TImage, class _TFunction >
-      inline std::string _GD1( _TImage* image );
+      inline void _GD1( _TImage* image );
 
   private:
     // Purposely not implemented.
index b906a2179c92d61ef6f9b1a37e5521618e9564b3..b45999d57351897c456bf0f5b40ac297c7e064c4 100644 (file)
@@ -22,18 +22,18 @@ fpaPlugins::ImageDijkstra::
 }
 
 // -------------------------------------------------------------------------
-std::string fpaPlugins::ImageDijkstra::
+void fpaPlugins::ImageDijkstra::
 _GenerateData( )
 {
   auto image = this->GetInputData( "Input" )->GetITK< itk::DataObject >( );
-  std::string   cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 2 );
-  if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 3 );
-  return( r );
+  cpPlugins_Image_Demangle_Pixel_AllScalars     ( _GD0, image, 2 );
+  else cpPlugins_Image_Demangle_Pixel_AllScalars( _GD0, image, 3 );
+  else this->_Error( "No valid input image." );
 }
 
 // -------------------------------------------------------------------------
 template< class _TImage >
-std::string fpaPlugins::ImageDijkstra::
+void fpaPlugins::ImageDijkstra::
 _GD0( _TImage* image )
 {
   typedef float                                          _TPixel;
@@ -43,9 +43,6 @@ _GD0( _TImage* image )
   typedef itk::FunctionBase< _TCost, _TCost >            _TCostFunctor;
   typedef typename _TFilter::TMinimumSpanningTree        _TMST;
 
-  if( image == NULL )
-    return( "fpaPlugins::ImageDijkstra: Invalid image type." );
-
   auto base_functor =
     this->GetInputData( "CostFunctor" )->GetITK< itk::LightObject >( );
   _TCostFunctor* functor = NULL;
@@ -53,7 +50,7 @@ _GD0( _TImage* image )
   {
     functor = dynamic_cast< _TCostFunctor* >( base_functor );
     if( functor == NULL )
-      return( "fpaPlugins::ImageDijkstra: Given cost functor is invalid." );
+      this->_Error( "Given cost functor is invalid." );
 
   } // fi
   
@@ -68,7 +65,6 @@ _GD0( _TImage* image )
   // Connect remaining output
   this->GetOutputData( "Output" )->SetITK( filter->GetOutput( ) );
   this->GetOutputData( "MST" )->SetITK( filter->GetMinimumSpanningTree( ) );
-  return( "" );
 }
 
 // eof - $RCSfile$
index cb5b411b8b242401b175def7ccae52d79f1df91d..e4cb3de5f651235a86ff2b028fd061a1dcd42c67 100644 (file)
@@ -25,10 +25,10 @@ namespace fpaPlugins
     ImageDijkstra( );
     virtual ~ImageDijkstra( );
 
-    virtual std::string _GenerateData( ) ITK_OVERRIDE;
+    virtual void _GenerateData( ) ITK_OVERRIDE;
 
     template< class _TImage >
-      std::string _GD0( _TImage* image );
+      inline void _GD0( _TImage* image );
 
   private:
     // Purposely not implemented.
index 8ee71cabc001bdc21a1d4a3d12285985f64d8b40..16a47e85953cfa3f32b3cb8c967ec9dfa526a7cc 100644 (file)
@@ -22,18 +22,18 @@ fpaPlugins::ImageRegionGrow::
 }
 
 // -------------------------------------------------------------------------
-std::string fpaPlugins::ImageRegionGrow::
+void fpaPlugins::ImageRegionGrow::
 _GenerateData( )
 {
   auto image = this->GetInputData( "Input" )->GetITK< itk::DataObject >( );
-  std::string   cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 2 );
-  if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 3 );
-  return( r );
+  cpPlugins_Image_Demangle_Pixel_AllScalars     ( _GD0, image, 2 );
+  else cpPlugins_Image_Demangle_Pixel_AllScalars( _GD0, image, 3 );
+  else this->_Error( "No valid input image." );
 }
 
 // -------------------------------------------------------------------------
 template< class _TImage >
-std::string fpaPlugins::ImageRegionGrow::
+void fpaPlugins::ImageRegionGrow::
 _GD0( _TImage* image )
 {
   typedef unsigned short _TPixel;
@@ -42,9 +42,6 @@ _GD0( _TImage* image )
   typedef typename _TFilter::TGrowingFunction            _TGrowFunctor;
   typedef typename _TFilter::TResult                     _TResult;
 
-  if( image == NULL )
-    return( "fpaPlugins::ImageRegionGrow: Invalid image type." );
-
   // Create filter
   _TFilter* filter = this->_ConfigureFilter< _TFilter >( );
 
@@ -66,7 +63,6 @@ _GD0( _TImage* image )
 
   // Connect remaining output
   this->GetOutputData( "Output" )->SetITK( filter->GetOutput( ) );
-  return( "" );
 }
 
 // eof - $RCSfile$
index be156c526bddd72a07fa8b03237ebc9b238bea95..ce6a82edebce5fcca2d49ad62927ee24fd133be7 100644 (file)
@@ -25,10 +25,10 @@ namespace fpaPlugins
     ImageRegionGrow( );
     virtual ~ImageRegionGrow( );
 
-    virtual std::string _GenerateData( ) ITK_OVERRIDE;
+    virtual void _GenerateData( ) ITK_OVERRIDE;
 
     template< class _TImage >
-      std::string _GD0( _TImage* image );
+      inline void _GD0( _TImage* image );
 
   private:
     // Purposely not implemented.
index 82631ef6bd0fe97286bd37076059fa467a23b00a..abd4f1ecf49d43de94fc6aa3472f075599e026ed 100644 (file)
@@ -30,19 +30,18 @@ fpaPlugins::InvertCostFunction::
 }
 
 // -------------------------------------------------------------------------
-std::string fpaPlugins::InvertCostFunction::
+void fpaPlugins::InvertCostFunction::
 _GenerateData( )
 {
   auto choice = this->m_Parameters.GetSelectedChoice( "ScalarType" );
-  if     ( choice == "float" )  return( this->_GD0< float >( ) );
-  else if( choice == "double" ) return( this->_GD0< double >( ) );
-  else
-    return( "fpaPlugins::InvertCostFunction: invalid scalar type." );
+  if     ( choice == "float" )  this->_GD0< float >( );
+  else if( choice == "double" ) this->_GD0< double >( );
+  else this->_Error( "Invalid scalar type." );
 }
 
 // -------------------------------------------------------------------------
 template< class _TScalar >
-std::string fpaPlugins::InvertCostFunction::
+void fpaPlugins::InvertCostFunction::
 _GD0( )
 {
   typedef fpa::Base::Functors::InvertCostFunction< _TScalar > _TFunctor;
@@ -57,7 +56,6 @@ _GD0( )
   } // fi
   f->SetAlpha( this->m_Parameters.GetReal( "Alpha" ) );
   f->SetBeta( this->m_Parameters.GetReal( "Beta" ) );
-  return( "" );
 }
 
 // eof - $RCSfile$
index f65c44aec25299b5ae8b4d587d552256cd6eedb2..c623914863f43a7bba24b8cf9e1be32d993ecf90 100644 (file)
@@ -26,10 +26,10 @@ namespace fpaPlugins
     InvertCostFunction( );
     virtual ~InvertCostFunction( );
 
-    virtual std::string _GenerateData( ) ITK_OVERRIDE;
+    virtual void _GenerateData( ) ITK_OVERRIDE;
 
     template< class _TScalar >
-      std::string _GD0( );
+      inline void _GD0( );
 
   private:
     // Purposely not implemented.
index 8326dfb6fefa31792773ca9a1ae01e12a194e68f..16f421e4e3b53c16b80bfdde46942c312c9e0403 100644 (file)
@@ -24,14 +24,14 @@ fpaPlugins::MinimumSpanningTreeReader::
 }
 
 // -------------------------------------------------------------------------
-std::string fpaPlugins::MinimumSpanningTreeReader::
+void fpaPlugins::MinimumSpanningTreeReader::
 _GenerateData( )
 {
   // Infere MST dimensions
   auto fname = this->m_Parameters.GetOpenFileName( "FileName" );
   std::ifstream input( fname.c_str( ) );
   if( !input )
-    return(
+    this->_Error(
       std::string( "MinimumSpanningTreeReader: Error opening file \"" ) +
       fname +
       std::string( "\"" )
@@ -40,15 +40,14 @@ _GenerateData( )
   input >> dim;
 
   // Real execution
-  if     ( dim == 2 ) return( this->_GD0< 2 >( fname ) );
-  else if( dim == 3 ) return( this->_GD0< 3 >( fname ) );
-  else
-    return( "MinimumSpanningTreeReader: invalid dimensions." );
+  if     ( dim == 2 ) this->_GD0< 2 >( fname );
+  else if( dim == 3 ) this->_GD0< 3 >( fname );
+  else this->_Error( "Invalid dimensions." );
 }
 
 // -------------------------------------------------------------------------
 template< unsigned int _NDim >
-std::string fpaPlugins::MinimumSpanningTreeReader::
+void fpaPlugins::MinimumSpanningTreeReader::
 _GD0( const std::string& fname )
 {
   typedef fpa::Image::MinimumSpanningTree< _NDim >     _TTree;
@@ -62,13 +61,10 @@ _GD0( const std::string& fname )
   }
   catch( itk::ExceptionObject& err )
   {
-    return(
-      "MinimumSpanningTreeReader: " + std::string( err.GetDescription( ) )
-      );
+    this->_Error( err.GetDescription( ) );
 
   } // yrt
   this->GetOutputData( "Output" )->SetITK( reader->GetOutput( ) );
-  return( "" );
 }
 
 // eof - $RCSfile$
index b8f3d27a7b2f9a9b25d2daa2b799299a4c237e14..dce25da6a3c4f7b9f61fecc9bf199b773b8b489e 100644 (file)
@@ -26,10 +26,10 @@ namespace fpaPlugins
     MinimumSpanningTreeReader( );
     virtual ~MinimumSpanningTreeReader( );
 
-    virtual std::string _GenerateData( ) ITK_OVERRIDE;
+    virtual void _GenerateData( ) ITK_OVERRIDE;
 
     template< unsigned int _NDim >
-      inline std::string _GD0( const std::string& fname );
+      inline void _GD0( const std::string& fname );
 
   private:
     // Purposely not implemented.
index 97570068a5b9195dd223a75fc5ee4a8e23a8c8b6..d0f35598b07966a50b2092c15b165fc90015e685 100644 (file)
@@ -24,7 +24,7 @@ fpaPlugins::MinimumSpanningTreeWriter::
 }
 
 // -------------------------------------------------------------------------
-std::string fpaPlugins::MinimumSpanningTreeWriter::
+void fpaPlugins::MinimumSpanningTreeWriter::
 _GenerateData( )
 {
   typedef fpa::Image::MinimumSpanningTree< 2 > _2D;
@@ -33,15 +33,14 @@ _GenerateData( )
   auto _2d = this->GetInputData( "Input" )->GetITK< _2D >( );
   auto _3d = this->GetInputData( "Input" )->GetITK< _3D >( );
 
-  if     ( _2d != NULL ) return( this->_GD0( _2d ) );
-  else if( _3d != NULL ) return( this->_GD0( _3d ) );
-  else
-    return( "MinimumSpanningTreeWriter: Not a valid MST." );
+  if     ( _2d != NULL ) this->_GD0( _2d );
+  else if( _3d != NULL ) this->_GD0( _3d );
+  else this->_Error( "Not a valid MST." );
 }
 
 // -------------------------------------------------------------------------
 template< class _TTree >
-std::string fpaPlugins::MinimumSpanningTreeWriter::
+void fpaPlugins::MinimumSpanningTreeWriter::
 _GD0( _TTree* tree )
 {
   typedef fpa::IO::MinimumSpanningTreeWriter< _TTree > _TFilter;
@@ -55,12 +54,9 @@ _GD0( _TTree* tree )
   }
   catch( itk::ExceptionObject& err )
   {
-    return(
-      "MinimumSpanningTreeWriter: " + std::string( err.GetDescription( ) )
-      );
+    this->_Error( err.GetDescription( ) );
 
   } // yrt
-  return( "" );
 }
 
 // eof - $RCSfile$
index 286e1de42803d1e3351837bc6224d1d0a2bd9a01..6d2c02b931ef7080c237174e184b510b3ba390a7 100644 (file)
@@ -26,10 +26,10 @@ namespace fpaPlugins
     MinimumSpanningTreeWriter( );
     virtual ~MinimumSpanningTreeWriter( );
 
-    virtual std::string _GenerateData( ) ITK_OVERRIDE;
+    virtual void _GenerateData( ) ITK_OVERRIDE;
 
     template< class _TTree >
-      inline std::string _GD0( _TTree* tree );
+      inline void _GD0( _TTree* tree );
 
   private:
     // Purposely not implemented.
index 1c27fe57023d2b650a052676a3b3ad39ccf7b91b..8dc341f1b6dbe9ce40fce099ce4dbb81599e3dd6 100644 (file)
@@ -25,28 +25,25 @@ fpaPlugins::RegionGrowThresholdFunction::
 }
 
 // -------------------------------------------------------------------------
-std::string fpaPlugins::RegionGrowThresholdFunction::
+void fpaPlugins::RegionGrowThresholdFunction::
 _GenerateData( )
 {
   auto image =
     this->GetInputData( "ReferenceImage" )->GetITK< itk::DataObject >( );
-  std::string   cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 2 );
-  if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 3 );
-  return( r );
+  cpPlugins_Image_Demangle_Pixel_AllScalars     ( _GD0, image, 2 );
+  else cpPlugins_Image_Demangle_Pixel_AllScalars( _GD0, image, 3 );
+  else this->_Error( "No valid input image." );
 }
 
 // -------------------------------------------------------------------------
 template< class _TImage >
-std::string fpaPlugins::RegionGrowThresholdFunction::
+void fpaPlugins::RegionGrowThresholdFunction::
 _GD0( _TImage* image )
 {
   typedef
     fpa::Image::Functors::RegionGrowThresholdFunction< _TImage >
     _TFunctor;
 
-  if( image == NULL )
-    return( "fpaPlugins::RegionGrowThresholdFunction: invalid image type." );
-
   auto out = this->GetOutputData( "Output" );
   auto f = out->GetITK< _TFunctor >( );
   if( f == NULL )
@@ -58,7 +55,6 @@ _GD0( _TImage* image )
   } // fi
   f->SetLowerThreshold( this->m_Parameters.GetReal( "LowerThreshold" ) );
   f->SetUpperThreshold( this->m_Parameters.GetReal( "UpperThreshold" ) );
-  return( "" );
 }
 
 // eof - $RCSfile$
index 5a9c0165dafb93eea6b6e2558b8867e824fe7d70..f2348c6b22be34d576be50a9e4a2fb31a27258c5 100644 (file)
@@ -28,10 +28,10 @@ namespace fpaPlugins
     RegionGrowThresholdFunction( );
     virtual ~RegionGrowThresholdFunction( );
 
-    virtual std::string _GenerateData( ) ITK_OVERRIDE;
+    virtual void _GenerateData( ) ITK_OVERRIDE;
 
     template< class _TImage >
-      std::string _GD0( _TImage* image );
+      inline void _GD0( _TImage* image );
 
   private:
     // Purposely not implemented.