Commit dcbb0ec9 authored by Pierre Lassalle's avatar Pierre Lassalle

Fix bug for the generation of the label (Remi cresson update)

parent de9faf3c
......@@ -19,6 +19,7 @@
#define __GRM_GRAPH_TO_OTBIMAGE_TXX
#include "grmGraphToOtbImage.h"
#include "itkImageRegionIterator.h"
#include "itkGrayscaleFillholeImageFilter.h"
namespace grm
{
......@@ -62,17 +63,13 @@ namespace grm
++label;
}
unsigned int pixelValue = 0;
for(it.GoToBegin(); !it.IsAtEnd(); ++it)
{
auto pixel = it.Get();
if(pixel == 0)
it.Set(pixelValue);
else
pixelValue = pixel;
}
// Fill holes
typedef itk::GrayscaleFillholeImageFilter<LabelImageType,LabelImageType> FillholeFilterType;
FillholeFilterType::Pointer fillFilter = FillholeFilterType::New();
fillFilter->SetInput(label_img);
fillFilter->Update();
return label_img;
return fillFilter->GetOutput();
}
template<class TGraph>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment