Skip to content
Snippets Groups Projects

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

Merged Rémi Cresson requested to merge mosaic_fix_nb_channels into develop
@@ -321,18 +321,21 @@ void StreamingMosaicFilterBase<TInputImage, TOutputImage, TInternalValueType>::G
itk::EncapsulateMetaData<std::string>(mosaicMetaData, static_cast<std::string>(otb::MetaDataKey::ProjectionRefKey), projectionRef);
// 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)
itkWarningMacro(<< "Specified NoDataInputPixel has not " << nbOfBands << " components. Using default (zeros)");
m_NoDataOutputPixel.SetSize(nbOfBands);
m_NoDataInputPixel.SetSize(nbOfBands);
m_NoDataOutputPixel.Fill(itk::NumericTraits<OutputImageInternalPixelType>::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
std::vector<bool> noDataValueAvailable;
@@ -444,4 +447,4 @@ void StreamingMosaicFilterBase<TInputImage, TOutputImage, TInternalValueType>::P
} // end namespace otb
#endif
#endif
\ No newline at end of file
Loading