diff --git a/Modules/Applications/AppImageUtils/app/otbColorMapping.cxx b/Modules/Applications/AppImageUtils/app/otbColorMapping.cxx index e3f43b81dc5eb916cea0d291ec99a1912fb81c9f..2bfbceb715d2d005b1d70d90959e94de71c1bb1d 100644 --- a/Modules/Applications/AppImageUtils/app/otbColorMapping.cxx +++ b/Modules/Applications/AppImageUtils/app/otbColorMapping.cxx @@ -46,6 +46,7 @@ #include "otbStreamingStatisticsMapFromLabelImageFilter.h" #include "otbMacro.h" +#include "otbStringUtils.h" namespace otb { @@ -178,14 +179,14 @@ public: itkTypeMacro(ColorMapping, otb::Application); typedef FloatImageType::PixelType PixelType; - typedef UInt16ImageType LabelImageType; + typedef UInt32ImageType LabelImageType; typedef LabelImageType::PixelType LabelType; typedef UInt8VectorImageType VectorImageType; typedef VectorImageType::PixelType VectorPixelType; typedef UInt8RGBImageType RGBImageType; typedef RGBImageType::PixelType RGBPixelType; - typedef UInt16VectorImageType LabelVectorImageType; + typedef UInt32VectorImageType LabelVectorImageType; typedef LabelVectorImageType::PixelType LabelVectorType; typedef itk::NumericTraits @@ -196,7 +197,7 @@ public: typedef itk::ImageRegionConstIterator <FloatVectorImageType> IteratorType; typedef itk::ImageRegionConstIterator - <UInt16ImageType> LabelIteratorType; + <LabelImageType> LabelIteratorType; // Manual label LUT typedef otb::ChangeLabelImageFilter @@ -783,7 +784,7 @@ private: if (nextpos == std::string::npos) continue; length = nextpos - pos; - LabelType clabel = atoi(line.substr(pos, length).c_str()); + LabelType clabel = boost::lexical_cast<LabelType>(line.substr(pos, length).c_str()); // Retrieve the color VectorPixelType color(3); color.Fill(0); diff --git a/Modules/Applications/AppImageUtils/otb-module.cmake b/Modules/Applications/AppImageUtils/otb-module.cmake index b817effaab5b38f267af8cb3c937b1b6a7913e7c..72e63db6e8fa76b5edae021ced6df391f936065d 100644 --- a/Modules/Applications/AppImageUtils/otb-module.cmake +++ b/Modules/Applications/AppImageUtils/otb-module.cmake @@ -23,6 +23,7 @@ set(DOCUMENTATION "Image utils and handling application.") otb_module(OTBAppImageUtils DEPENDS OTBApplicationEngine + OTBBoostAdapters OTBCarto OTBColorMap OTBCommon