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

ENH: added support for &skipcarto option to teh reader

parent 8ecf8f13
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,7 @@ namespace otb
* - &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
* - &skipcarto : switch to skip the cartographic informations
*
* \sa ImageSeriesReader
* \sa ImageIOBase
......@@ -74,7 +74,7 @@ public:
std::string extGEOMFileName;
unsigned int subDatasetIndex;
unsigned int resolutionFactor;
bool skipProjRef;
bool skipCarto;
};
/** Prepare image allocation at the first call of the pipeline processing */
......
......@@ -62,7 +62,7 @@ ImageFileReader<TOutputImage>
m_Options.extGEOMFileName = "";
m_Options.subDatasetIndex = 0;
m_Options.resolutionFactor = 0;
m_Options.skipProjRef = false;
m_Options.skipCarto = false;
}
template <class TOutputImage>
......@@ -379,6 +379,15 @@ ImageFileReader<TOutputImage>
}
}
if (m_Options.skipCarto)
{
for (unsigned int i = 0; i < TOutputImage::ImageDimension; ++i)
{
origin[i] = 0.0;
spacing[i] = 1.0;
}
}
output->SetSpacing(spacing); // Set the image spacing
output->SetOrigin(origin); // Set the image origin
output->SetDirection(direction); // Set the image direction cosines
......@@ -439,7 +448,7 @@ ImageFileReader<TOutputImage>
}
// If Skip ProjectionRef is activated, remove ProjRef from dict
if (m_Options.skipProjRef)
if (m_Options.skipCarto)
{
itk::EncapsulateMetaData<std::string>(dict, MetaDataKey::ProjectionRefKey, "");
}
......@@ -632,9 +641,9 @@ 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")
if (map["skipcarto"] == "true")
{
m_Options.skipProjRef = true;
m_Options.skipCarto = 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