Skip to content
Snippets Groups Projects
Commit 958a4c62 authored by Cédric Traizet's avatar Cédric Traizet
Browse files

BUG: Handle band metadata copy in case where the number of componant of the image is > 1

parent 2b2522e3
No related branches found
No related tags found
No related merge requests found
......@@ -112,11 +112,10 @@ void Image<TPixel, VImageDimension>::CopyInformation(const itk::DataObject* data
{
const auto & imd = imc->GetImageMetadata();
if (imd.Bands.size() > 1)
if (imd.Bands.size() > 0 && imd.Bands.size() != this->GetNumberOfComponentsPerPixel())
{
SetImageMetadata(ImageMetadata(imd.GeometryKeys, imd.NumericKeys, imd.StringKeys, imd.LUT1DKeys,
imd.LUT2DKeys, imd.TimeKeys, imd.ExtraKeys, ImageMetadata::ImageMetadataBandsType(1)));
imd.LUT2DKeys, imd.TimeKeys, imd.ExtraKeys, ImageMetadata::ImageMetadataBandsType(this->GetNumberOfComponentsPerPixel())));
}
else
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment