AddParameter(ParameterType_Filename,"ct","An ASCII file containing the color table with one color per line (for instance line 1 255 0 0 means that all pixel with label 1 will be replaced by RGB color 255 0 0). Lines begining with a # are ignored.");
}
voidDoUpdateParameters()
{
// Nothing to do here : all parameters are independent
}
voidDoExecute()
{
m_LabeledImage=GetParameterUInt16Image("in");
m_Mapper=ChangeLabelFilterType::New();
m_Mapper->SetInput(m_LabeledImage);
m_Mapper->SetNumberOfComponentsPerPixel(3);
std::ifstreamifs;
ifs.open(GetParameterString("ct").c_str());
if(!ifs)
{
itkExceptionMacro("Can not read file "<<GetParameterString("ct")<<std::endl);
}
otbAppLogINFO("Parsing color map file "<<GetParameterString("ct")<<"."<<std::endl);