]> Creatis software - FrontAlgorithms.git/blobdiff - appli/CTBronchi/RandomWalker.h
...
[FrontAlgorithms.git] / appli / CTBronchi / RandomWalker.h
index 0edb26d49e702a57847b2ac0e0310ee5fc983187..c284a542e6e0fcbc39c147607b075a9f154f34fa 100644 (file)
 namespace CTBronchi
 {
   // -----------------------------------------------------------------------
-  template< class _TInputPtr, class _TOutputPtr, class _TLabelPtr >
+  template< class _TInputPtr, class _TLabelPtr >
   void RandomWalker(
-    _TOutputPtr& output,
+    _TLabelPtr& output,
     const _TInputPtr& input, const _TLabelPtr& labels,
     std::map< std::string, std::string >& args
     )
   {
     typedef typename _TInputPtr::ObjectType  _TInput;
-    typedef typename _TOutputPtr::ObjectType _TOutput;
     typedef typename _TLabelPtr::ObjectType _TLabel;
-    typedef typename _TOutput::PixelType _TOutputPixel;
-    typedef fpa::Filters::Image::RandomWalker< _TInput, _TLabel, _TOutputPixel > _TRandomWalker;
-    typedef fpa::Functors::Dijkstra::Image::Gaussian< _TInput, _TOutputPixel > _TWeight;
+    typedef float _TScalar;
+    typedef fpa::Filters::Image::RandomWalker< _TInput, _TLabel, _TScalar > _TRandomWalker;
+    typedef fpa::Functors::Dijkstra::Image::Gaussian< _TInput, _TScalar > _TWeight;
 
     typename _TWeight::Pointer weight = _TWeight::New( );
     weight->SetAlpha( std::atof( args[ "random_walker_alpha" ].c_str( ) ) );
@@ -37,7 +36,7 @@ namespace CTBronchi
     rw->SetWeightFunction( weight );
     double t = CTBronchi::MeasureTime( rw );
     std::cout << "RandomWalker executed in " << t << " s" << std::endl;
-    output = rw->GetOutput( );
+    output = rw->GetOutputLabels( );
     output->DisconnectPipeline( );
   }