Commit 3cf9673f authored by Rémi Cresson's avatar Rémi Cresson

Merge branch 'mosaic_fix_nb_channels' into 'develop'

FIX: StreamingMosaicFilter childs can have a different number of components per pixel at output

See merge request orfeotoolbox/otb!727
parents 38b25cad 1739bfc5
...@@ -84,6 +84,7 @@ Rémi Cresson <remi.cresson@irstea.fr> Rémi <remi.cresson@t ...@@ -84,6 +84,7 @@ Rémi Cresson <remi.cresson@irstea.fr> Rémi <remi.cresson@t
Rémi Cresson <remi.cresson@irstea.fr> remi <remi.cresson@irstea.fr> Rémi Cresson <remi.cresson@irstea.fr> remi <remi.cresson@irstea.fr>
Rémi Cresson <remi.cresson@irstea.fr> remi cresson <remi.cresson@teledetection.fr> Rémi Cresson <remi.cresson@irstea.fr> remi cresson <remi.cresson@teledetection.fr>
Rémi Cresson <remi.cresson@irstea.fr> remicres <remi.cresson@teledetection.fr> Rémi Cresson <remi.cresson@irstea.fr> remicres <remi.cresson@teledetection.fr>
Rémi Cresson <remi.cresson@irstea.fr> remi cresson <remi.cresson@inrae.fr>
Sebastien Harasse <sebastien.harasse@c-s.fr> Sebastien Harasse <sebastien.harasse@c-s.fr>
Stephane Albert <stephane.albert@c-s.fr> Stephane Albert <stephane.albert@c-s.fr>
Stephane Albert <stephane.albert@c-s.fr> Stephane ALBERT <stephane.albert@c-s.fr> Stephane Albert <stephane.albert@c-s.fr> Stephane ALBERT <stephane.albert@c-s.fr>
......
...@@ -321,18 +321,21 @@ void StreamingMosaicFilterBase<TInputImage, TOutputImage, TInternalValueType>::G ...@@ -321,18 +321,21 @@ void StreamingMosaicFilterBase<TInputImage, TOutputImage, TInternalValueType>::G
itk::EncapsulateMetaData<std::string>(mosaicMetaData, static_cast<std::string>(otb::MetaDataKey::ProjectionRefKey), projectionRef); itk::EncapsulateMetaData<std::string>(mosaicMetaData, static_cast<std::string>(otb::MetaDataKey::ProjectionRefKey), projectionRef);
// check no data pixels // check no data pixels
if (m_NoDataOutputPixel.GetSize() != nbOfBands || m_NoDataInputPixel.GetSize() != nbOfBands) if (m_NoDataInputPixel.GetSize() != nbOfBands)
{ {
if (m_NoDataOutputPixel.GetSize() != 0)
itkWarningMacro(<< "Specified NoDataOutputPixel has not " << nbOfBands << " components. Using default (zeros)");
if (m_NoDataInputPixel.GetSize() != 0) if (m_NoDataInputPixel.GetSize() != 0)
itkWarningMacro(<< "Specified NoDataInputPixel has not " << nbOfBands << " components. Using default (zeros)"); itkWarningMacro(<< "Specified NoDataInputPixel has not " << nbOfBands << " components. Using default (zeros)");
m_NoDataOutputPixel.SetSize(nbOfBands);
m_NoDataInputPixel.SetSize(nbOfBands); m_NoDataInputPixel.SetSize(nbOfBands);
m_NoDataOutputPixel.Fill(itk::NumericTraits<OutputImageInternalPixelType>::Zero);
m_NoDataInputPixel.Fill(itk::NumericTraits<InputImageInternalPixelType>::Zero); m_NoDataInputPixel.Fill(itk::NumericTraits<InputImageInternalPixelType>::Zero);
} }
if (m_NoDataOutputPixel.GetSize() == 0)
{
itkWarningMacro(<< "NoDataOutputPixel not set. Using zeros");
m_NoDataOutputPixel.SetSize(nbOfBands);
m_NoDataOutputPixel.Fill(itk::NumericTraits<InputImageInternalPixelType>::Zero);
}
// Write no data flags // Write no data flags
std::vector<bool> noDataValueAvailable; std::vector<bool> noDataValueAvailable;
...@@ -444,4 +447,4 @@ void StreamingMosaicFilterBase<TInputImage, TOutputImage, TInternalValueType>::P ...@@ -444,4 +447,4 @@ void StreamingMosaicFilterBase<TInputImage, TOutputImage, TInternalValueType>::P
} // end namespace otb } // end namespace otb
#endif #endif
\ No newline at end of file
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