computeImagesStatistics imagelist input confusing error
Mantis Issue 776, reported by rkanavath, assigned to jmalik, created: 2013-09-11
When computing image statistics with multiple images having different number of bands it reports an error which it must be. But the error message is confusing as given below itk::ERROR: ComputeImagesStatistics(0x1f05730): The image #1 (closed) has 4 bands, while the first one has 1
otbcli_ReadImageInfo -in ~/OTB-Data/Examples/QB_Toulouse_Ortho_PAN.tif
2013 Sep 11 09:26:35 : Application.logger (INFO) Image general informations: Number of bands : 1 Start index : [0,0] [rest ignored]
otbcli_ReadImageInfo -in ~/OTB-Data/Examples/QB_Toulouse_Ortho_XS.tif
2013 Sep 11 09:27:15 : Application.logger (INFO) Image general informations: Number of bands : 4 Start index : [0,0] [rest ignored]
otbcli_ReadImageInfo -in ~/OTB-Data/Examples/QB_Toulouse_Ortho_PAN_Mask.tif
2013 Sep 11 09:28:09 : Application.logger (INFO) Image general informations: Number of bands : 1 Start index : [0,0] [rest ignored]
1378885681 - rashadkmThe image #1 (closed) has 4 bands, while the first one has 1 when otb says image #1 (closed) it means the second image in the input. because it counts index from zero. but "while the first one has 1" creates a confusion. For a better error report it should be renamed. image#1 image at index 0, image #2 (closed) image at index 1 and so on. To have this in effect
otbComputeImagesStatistics.cxx can be modified from itkExceptionMacro(<< "The image #" << imageId << " has " << image->GetNumberOfComponentsPerPixel() << " bands, while the first one has " << nbBands );
tp
itkExceptionMacro(<< "The image #" << imageId + 1 << " has " << image->GetNumberOfComponentsPerPixel() << " bands, while the first one has " << nbBands );
1383735992 - julienmhttp://hg.orfeo-toolbox.org/OTB/rev/2e4efe3eb3f3