Commit c65178cb authored by Jonathan Guinet's avatar Jonathan Guinet

ENH: nbcomp is automatically set to image numberOfComponents if excedd JIRA OTB#296.

parent 1821fd61
......@@ -180,6 +180,21 @@ private:
void DoUpdateParameters()
{
if (HasValue("in"))
{
FloatVectorImageType::Pointer inImage = this->GetParameterImage<FloatVectorImageType> ("in");
inImage->UpdateOutputInformation();
// Update the values of the channels to be selected
unsigned int nbComponents = inImage->GetNumberOfComponentsPerPixel();
unsigned int nbComp = static_cast<unsigned int> (GetParameterInt("nbcomp"));
if (nbComp > nbComponents)
{
SetParameterInt("nbcomp", nbComponents);
otbAppLogINFO( << "number of selected components can't exceed image dimension : "<<nbComponents );
}
}
}
void DoExecute()
......
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