X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FImage%2FDijkstraWithEndPointDetection.hxx;h=cb417f027092de357d1353ff18b4cd367f860729;hb=6468f1fda5fed2788fbaef1a7925c91ecff83d13;hp=dc51a6442c0a66f7ed77663c25e8bb3c161923a7;hpb=f28d460c6d9ce93e55c073bd04dba8de16d55d3a;p=FrontAlgorithms.git diff --git a/lib/fpa/Image/DijkstraWithEndPointDetection.hxx b/lib/fpa/Image/DijkstraWithEndPointDetection.hxx index dc51a64..cb417f0 100644 --- a/lib/fpa/Image/DijkstraWithEndPointDetection.hxx +++ b/lib/fpa/Image/DijkstraWithEndPointDetection.hxx @@ -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 } // -------------------------------------------------------------------------