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