Skip to content
Snippets Groups Projects
Commit 09e95e4d authored by Aurélien Bricier's avatar Aurélien Bricier
Browse files

ENH: added skip projectionRef option to the reader

parent 6c520be6
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,12 @@ namespace otb
/** \class ImageFileReader
* \brief Resource to read an image from a file.
*
* Available options for extended file name are:
* - &geom : to specify an external geom file
* - &sdataidx : sub-dataset index for composite files
* - &resol : resolution factor for jpeg200 files
* - &skippr : switch to skip the projection referentiel in ortho-ready files
*
* \sa ImageSeriesReader
* \sa ImageIOBase
*
......@@ -68,6 +74,7 @@ public:
std::string extGEOMFileName;
unsigned int subDatasetIndex;
unsigned int resolutionFactor;
bool skipProjRef;
};
/** Prepare image allocation at the first call of the pipeline processing */
......
......@@ -62,6 +62,7 @@ ImageFileReader<TOutputImage>
m_Options.extGEOMFileName = "";
m_Options.subDatasetIndex = 0;
m_Options.resolutionFactor = 0;
m_Options.skipProjRef = false;
}
template <class TOutputImage>
......@@ -437,6 +438,12 @@ ImageFileReader<TOutputImage>
}
}
// If Skip ProjectionRef is activated, remove ProjRef from dict
if (m_Options.skipProjRef)
{
itk::EncapsulateMetaData<std::string>(dict, MetaDataKey::ProjectionRefKey, "");
}
//Copy MetaDataDictionary from instantiated reader to output image.
output->SetMetaDataDictionary(this->m_ImageIO->GetMetaDataDictionary());
this->SetMetaDataDictionary(this->m_ImageIO->GetMetaDataDictionary());
......@@ -625,6 +632,10 @@ ImageFileReader<TOutputImage>
m_Options.extGEOMFileName = map["geom"];
m_Options.subDatasetIndex = atoi(map["sdataidx"].c_str());
m_Options.resolutionFactor = atoi(map["resol"].c_str());
if (map["skippr"] == "true")
{
m_Options.skipProjRef = true;
}
this->m_FileName = m_Options.fileName;
}
......
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