Commit 91d5a732 authored by Cédric Traizet's avatar Cédric Traizet

REFAC: don't use GetProjectionRef in ChangeInformationImageFilter because the...

REFAC: don't use GetProjectionRef in ChangeInformationImageFilter because the method don't use the itk metadata dictionary anymore
parent ff17a68f
......@@ -50,13 +50,23 @@ int otbChangeInformationImageFilter(int itkNotUsed(argc), char* argv[])
filter->UpdateOutputInformation();
ImageType::Pointer outImage = filter->GetOutput();
if (!outImage->GetProjectionRef().empty())
// TODO: RemoveOssim. ChangeInformationImageFilter should change the ImageMetadata object stored in
// the image instead of modifying the itk metadata dictionary. GetProjectionRef() look for the
// projection in ImageMetadata now, so we can't use this method in the test. The temporary solution
// is to look in the itk dictionary instead (this was the old behavior of GetProjectionRef). But
// when ChangeInformationImageFilter will be refactored, GetProjectionRef should be used again..
//if (!outImage->GetProjectionRef().empty())
if (outImage->GetMetaDataDictionary().HasKey(otb::MetaDataKey::ProjectionRefKey))
{
std::cout << "Projection is supposed to be removed but is still present !" << std::endl;
return EXIT_FAILURE;
}
itk::MetaDataDictionary& dict = outImage->GetMetaDataDictionary();
if (!dict.HasKey(otb::MetaDataKey::NoDataValueAvailable) || !dict.HasKey(otb::MetaDataKey::NoDataValue))
{
std::cout << "Missing no data metadata !" << std::endl;
......
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