From a808f96c24d254bf958980ff118e1a2006d7410c Mon Sep 17 00:00:00 2001
From: remicres <remi.cresson@teledetection.fr>
Date: Mon, 5 Sep 2016 08:32:43 +0000
Subject: [PATCH] ENH: output label starts from 1

---
 include/lsgrmGraphOperations.txx | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/lsgrmGraphOperations.txx b/include/lsgrmGraphOperations.txx
index 509c342..4ce722b 100644
--- a/include/lsgrmGraphOperations.txx
+++ b/include/lsgrmGraphOperations.txx
@@ -101,7 +101,7 @@ MergeAllGraphsAndAchieveSegmentation(
   using LabelImageIterator = itk::ImageRegionIterator<typename TSegmenter::LabelImageType>;
   LabelImageIterator it(labelImage, labelImage->GetLargestPossibleRegion());
   const typename TSegmenter::LabelImageType::InternalPixelType noDataLabel = 0;
-  typename TSegmenter::LabelImageType::InternalPixelType label = 1;
+  typename TSegmenter::LabelImageType::InternalPixelType label;
 
   // Get the maximum label value
   for(it.GoToBegin();!it.IsAtEnd(); ++it)
@@ -109,6 +109,7 @@ MergeAllGraphsAndAchieveSegmentation(
       label = it.Get();
 
   // Compute LUT
+  label = 1;
   vnl_vector<typename TSegmenter::LabelImageType::InternalPixelType> lut(label,noDataLabel);
   for(it.GoToBegin();!it.IsAtEnd(); ++it)
     {
-- 
GitLab