Skip to content
Snippets Groups Projects
Commit eb146025 authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

BUG: Mantis-942: conversion between GDAL geotransform and OTB origin/spacing

parent a3021290
No related branches found
No related tags found
No related merge requests found
......@@ -164,8 +164,8 @@ LabelImageToVectorDataFilter<TInputImage, TPrecision>
IndexType bufferIndexOrigin = this->GetInput()->GetBufferedRegion().GetIndex();
OriginType bufferOrigin;
this->GetInput()->TransformIndexToPhysicalPoint(bufferIndexOrigin, bufferOrigin);
geoTransform[0] = bufferOrigin[0];
geoTransform[3] = bufferOrigin[1];
geoTransform[0] = bufferOrigin[0] - 0.5 * this->GetInput()->GetSpacing()[0];
geoTransform[3] = bufferOrigin[1] - 0.5 * this->GetInput()->GetSpacing()[1];
geoTransform[1] = this->GetInput()->GetSpacing()[0];
geoTransform[5] = this->GetInput()->GetSpacing()[1];
// FIXME: Here component 1 and 4 should be replaced by the orientation parameters
......@@ -234,8 +234,8 @@ LabelImageToVectorDataFilter<TInputImage, TPrecision>
// the spacing is unchanged, the origin is relative to the buffered region
bufferIndexOrigin = this->GetInputMask()->GetBufferedRegion().GetIndex();
this->GetInputMask()->TransformIndexToPhysicalPoint(bufferIndexOrigin, bufferOrigin);
geoTransform[0] = bufferOrigin[0];
geoTransform[3] = bufferOrigin[1];
geoTransform[0] = bufferOrigin[0] - 0.5 * this->GetInputMask()->GetSpacing()[0];
geoTransform[3] = bufferOrigin[1] - 0.5 * this->GetInputMask()->GetSpacing()[1];
geoTransform[1] = this->GetInputMask()->GetSpacing()[0];
geoTransform[5] = this->GetInputMask()->GetSpacing()[1];
// FIXME: Here component 1 and 4 should be replaced by the orientation parameters
......
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