diff --git a/include/lsrmGraphToOtbImage.h b/include/lsrmGraphToOtbImage.h
index 19a448caedebff6c02fc2a8fd3cdaa1a8e61b243..4803d6ffebc641210fc06094836c74aa2a6a9de8 100644
--- a/include/lsrmGraphToOtbImage.h
+++ b/include/lsrmGraphToOtbImage.h
@@ -24,7 +24,7 @@ namespace lsrm
 		typedef typename GraphType::NodeType NodeType;
 		typedef std::vector< std::shared_ptr<NodeType> > NodeList;
 		typedef typename NodeList::const_iterator NodeConstIterator;
-		typedef unsigned long int LabelPixelType;
+		typedef unsigned int LabelPixelType;
 		typedef otb::Image<LabelPixelType, 2> LabelImageType;
 		using ContourOperator = lp::ContourOperations;
 		
diff --git a/include/lsrmGraphToOtbImage.txx b/include/lsrmGraphToOtbImage.txx
index 9042bec00f32b0430d94fd1a71a940bd3a4473bd..79348bef3a7c12fe2c12a019fcce0c4c234e8611 100644
--- a/include/lsrmGraphToOtbImage.txx
+++ b/include/lsrmGraphToOtbImage.txx
@@ -31,7 +31,7 @@ namespace lsrm
 			it.Set(0);
 		
 		// Start at 1 (value 0 can be used for invalid pixels)
-		long unsigned int label = 1;
+		LabelImageType::InternalPixelType label = 1;
 		for(auto& region : graph.m_Nodes)
 		{
 			lp::CellLists borderPixels;