]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Image/DijkstraWithEndPointDetection.hxx
CMake updated. Some other filters added.
[FrontAlgorithms.git] / lib / fpa / Image / DijkstraWithEndPointDetection.hxx
index dc51a6442c0a66f7ed77663c25e8bb3c161923a7..cb417f027092de357d1353ff18b4cd367f860729 100644 (file)
@@ -428,6 +428,7 @@ _LabelAll( )
   // Configure and obtain inputs
   const I* input = this->GetInput( );
   const TMinimumSpanningTree* mst = this->GetMinimumSpanningTree( );
+  const TUniqueVertices* bifurcations = this->GetBifurcations( );
   TBranches* branches = this->GetBranches( );
   TLabelImage* label = this->GetLabelImage( );
   label->FillBuffer( 0 );
@@ -473,28 +474,26 @@ _LabelAll( )
   this->m_NumberOfBranches = actual_label;
 
   // Label bifurcations
-  /* TODO: Is this necessary?
-     typename TUniqueVertices::const_iterator bifIt =
-     this->m_Bifurcations.begin( );
-     for( ; bifIt != this->m_Bifurcations.end( ); ++bifIt )
-     {
-     actual_label++;
-     double d = std::sqrt( double( input->GetPixel( *bifIt ) ) );
-     _TRegion region = this->_Region( *bifIt, d );
-     itk::ImageRegionConstIteratorWithIndex< I > iIt( input, region );
-     itk::ImageRegionIteratorWithIndex< TLabelImage > lIt( label, region );
-     iIt.GoToBegin( );
-     lIt.GoToBegin( );
-     for( ; !iIt.IsAtEnd( ); ++iIt, ++lIt )
-     {
-     // Mask real input image
-     if( !( iIt.Get( ) < ( typename I::PixelType )( 0 ) ) )
-     lIt.Set( actual_label );
-
-     } // rof
-
-     } // rof
-  */
+  typename TUniqueVertices::ConstIterator bifIt =
+    bifurcations->Begin( );
+  for( ; bifIt != bifurcations->End( ); ++bifIt )
+  {
+    actual_label++;
+    double d = std::sqrt( double( input->GetPixel( *bifIt ) ) );
+    _TRegion region = this->_Region( *bifIt, d * 1.5 );
+    itk::ImageRegionConstIteratorWithIndex< I > iIt( input, region );
+    itk::ImageRegionIteratorWithIndex< TLabelImage > lIt( label, region );
+    iIt.GoToBegin( );
+    lIt.GoToBegin( );
+    for( ; !iIt.IsAtEnd( ); ++iIt, ++lIt )
+    {
+      // Mask real input image
+      if( !( iIt.Get( ) < ( typename I::PixelType )( 0 ) ) )
+        lIt.Set( actual_label );
+
+    } // rof
+
+  } // rof
 }
 
 // -------------------------------------------------------------------------