diff --git a/Code/IO/otbPleiadesImageMetadataInterface.cxx b/Code/IO/otbPleiadesImageMetadataInterface.cxx index ffe11b28f5a0d03bd0a9e277f161074604f1b9a2..1214e6bddc06d6b7523a46f08479763b57be1121 100644 --- a/Code/IO/otbPleiadesImageMetadataInterface.cxx +++ b/Code/IO/otbPleiadesImageMetadataInterface.cxx @@ -663,17 +663,27 @@ PleiadesImageMetadataInterface } // TODO MSD need to update this function -//Comment this part as relative response -//FIXME check if this is coherent with other sensor -// unsigned int -// PleiadesImageMetadataInterface -// ::BandIndexToWavelengthPosition(unsigned int i) const -// { -// otbMsgDevMacro(<< "Pleiades detected: band 0 and 2 inverted"); -// if (i == 0) return 2; -// if (i == 2) return 0; -// return i; -// } +// Comment this part as relative response +// FIXME check if this is coherent with other sensor +unsigned int +PleiadesImageMetadataInterface +::BandIndexToWavelengthPosition(unsigned int i) const +{ + int nbBands = this->GetNumberOfBands(); + //Panchromatic case + if (nbBands == 1) + { + return 0; + } + else + { + otbMsgDevMacro(<< "Pleiades detected: band 0 and 2 inverted"); + if (i == 0) return 2; + if (i == 2) return 0; + } + + return i; +} std::vector<unsigned int> PleiadesImageMetadataInterface diff --git a/Code/IO/otbPleiadesImageMetadataInterface.h b/Code/IO/otbPleiadesImageMetadataInterface.h index 9b0a070616fc2de86e20eb1c799833201d9d0268..ecae4a1d5d69f23846168937664f80f06afa12e3 100644 --- a/Code/IO/otbPleiadesImageMetadataInterface.h +++ b/Code/IO/otbPleiadesImageMetadataInterface.h @@ -103,7 +103,7 @@ public: * in most cases, this method won't change the value, but for SPOT data, the bands are set up as * 2 1 0 3 in the tiff file, this method which is overloaded for SPOT enables to retrieve the * proper band. */ - //virtual unsigned int BandIndexToWavelengthPosition(unsigned int i) const; + unsigned int BandIndexToWavelengthPosition(unsigned int i) const; /** Get the 3 spectral band numbers corresponding to the default display for visualization, * in the order R, G, B */