Commit ac35c7d8 authored by Cédric Traizet's avatar Cédric Traizet

BUG: Image should only have one band in metadata

parent 0df350d8
......@@ -111,11 +111,10 @@ void Image<TPixel, VImageDimension>::CopyInformation(const itk::DataObject* data
if (imc != nullptr)
{
const auto & imd = imc->GetImageMetadata();
if (imd.Bands.size() > 0 && imd.Bands.size() != this->GetNumberOfComponentsPerPixel())
if (imd.Bands.size() > 0 && imd.Bands.size() != 1)
{
SetImageMetadata(ImageMetadata(imd.GeometryKeys, imd.NumericKeys, imd.StringKeys, imd.LUT1DKeys,
imd.LUT2DKeys, imd.TimeKeys, imd.ExtraKeys, ImageMetadata::ImageMetadataBandsType(this->GetNumberOfComponentsPerPixel())));
imd.LUT2DKeys, imd.TimeKeys, imd.ExtraKeys, {}));
}
else
{
......
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