Commit 64690304 authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

Merge branch '1628-fix-ortho-user-flag' into 'develop'

Resolve "Orthorectification of Spot 6/7 raster sensor products leads to wrong output with lambert93 projection"

Closes #1628

See merge request orfeotoolbox/otb!205
parents 37437170 597222c3
...@@ -269,30 +269,14 @@ private: ...@@ -269,30 +269,14 @@ private:
genericRSEstimator->SetOutputProjectionRef(m_OutputProjectionRef); genericRSEstimator->SetOutputProjectionRef(m_OutputProjectionRef);
genericRSEstimator->Compute(); genericRSEstimator->Compute();
// Fill the Gui with the computed parameters SetDefaultParameterInt("outputs.sizex", genericRSEstimator->GetOutputSize()[0]);
if (!HasUserValue("outputs.sizex")) SetDefaultParameterInt("outputs.sizey", genericRSEstimator->GetOutputSize()[1]);
SetParameterInt("outputs.sizex",genericRSEstimator->GetOutputSize()[0]); SetDefaultParameterFloat("outputs.spacingx", genericRSEstimator->GetOutputSpacing()[0]);
SetDefaultParameterFloat("outputs.spacingy", genericRSEstimator->GetOutputSpacing()[1]);
if (!HasUserValue("outputs.sizey")) SetDefaultParameterFloat("outputs.ulx", genericRSEstimator->GetOutputOrigin()[0] - 0.5 * genericRSEstimator->GetOutputSpacing()[0]);
SetParameterInt("outputs.sizey",genericRSEstimator->GetOutputSize()[1]); SetDefaultParameterFloat("outputs.uly", genericRSEstimator->GetOutputOrigin()[1] - 0.5 * genericRSEstimator->GetOutputSpacing()[1]);
SetDefaultParameterFloat("outputs.lrx", GetParameterFloat("outputs.ulx") + GetParameterFloat("outputs.spacingx") * static_cast<double>(GetParameterInt("outputs.sizex")));
if (!HasUserValue("outputs.spacingx")) SetDefaultParameterFloat("outputs.lry", GetParameterFloat("outputs.uly") + GetParameterFloat("outputs.spacingy") * static_cast<double>(GetParameterInt("outputs.sizey")));
SetParameterFloat("outputs.spacingx",genericRSEstimator->GetOutputSpacing()[0]);
if (!HasUserValue("outputs.spacingy"))
SetParameterFloat("outputs.spacingy",genericRSEstimator->GetOutputSpacing()[1]);
if (!HasUserValue("outputs.ulx"))
SetParameterFloat("outputs.ulx",genericRSEstimator->GetOutputOrigin()[0] - 0.5 * genericRSEstimator->GetOutputSpacing()[0]);
if (!HasUserValue("outputs.uly"))
SetParameterFloat("outputs.uly",genericRSEstimator->GetOutputOrigin()[1] - 0.5 * genericRSEstimator->GetOutputSpacing()[1]);
if (!HasUserValue("outputs.lrx"))
SetParameterFloat("outputs.lrx",GetParameterFloat("outputs.ulx") + GetParameterFloat("outputs.spacingx") * static_cast<double>(GetParameterInt("outputs.sizex")));
if (!HasUserValue("outputs.lry"))
SetParameterFloat("outputs.lry",GetParameterFloat("outputs.uly") + GetParameterFloat("outputs.spacingy") * static_cast<double>(GetParameterInt("outputs.sizey")));
// Handle the spacing and size field following the mode // Handle the spacing and size field following the mode
// chose by the user // chose by the user
...@@ -300,16 +284,6 @@ private: ...@@ -300,16 +284,6 @@ private:
{ {
case Mode_UserDefined: case Mode_UserDefined:
{ {
// Automatic set to off except lower right coordinates
AutomaticValueOff("outputs.ulx");
AutomaticValueOff("outputs.uly");
AutomaticValueOff("outputs.sizex");
AutomaticValueOff("outputs.sizey");
AutomaticValueOff("outputs.spacingx");
AutomaticValueOff("outputs.spacingy");
AutomaticValueOn("outputs.lrx");
AutomaticValueOn("outputs.lry");
// Enable all the parameters except lower right coordinates // Enable all the parameters except lower right coordinates
EnableParameter("outputs.ulx"); EnableParameter("outputs.ulx");
EnableParameter("outputs.uly"); EnableParameter("outputs.uly");
...@@ -350,16 +324,6 @@ private: ...@@ -350,16 +324,6 @@ private:
DisableParameter("outputs.lry"); DisableParameter("outputs.lry");
DisableParameter("outputs.ortho"); DisableParameter("outputs.ortho");
// Update the automatic value mode of each filed
AutomaticValueOn("outputs.ulx");
AutomaticValueOn("outputs.uly");
AutomaticValueOn("outputs.sizex");
AutomaticValueOn("outputs.sizey");
AutomaticValueOff("outputs.spacingx");
AutomaticValueOff("outputs.spacingy");
AutomaticValueOn("outputs.lrx");
AutomaticValueOn("outputs.lry");
// Adapat the status of the param to this mode // Adapat the status of the param to this mode
MandatoryOff("outputs.ulx"); MandatoryOff("outputs.ulx");
MandatoryOff("outputs.uly"); MandatoryOff("outputs.uly");
...@@ -404,16 +368,6 @@ private: ...@@ -404,16 +368,6 @@ private:
DisableParameter("outputs.lry"); DisableParameter("outputs.lry");
DisableParameter("outputs.ortho"); DisableParameter("outputs.ortho");
// Update the automatic value mode of each filed
AutomaticValueOn("outputs.ulx");
AutomaticValueOn("outputs.uly");
AutomaticValueOn("outputs.spacingx");
AutomaticValueOn("outputs.spacingy");
AutomaticValueOff("outputs.sizex");
AutomaticValueOff("outputs.sizey");
AutomaticValueOn("outputs.lrx");
AutomaticValueOn("outputs.lry");
// Adapat the status of the param to this mode // Adapat the status of the param to this mode
MandatoryOff("outputs.ulx"); MandatoryOff("outputs.ulx");
MandatoryOff("outputs.uly"); MandatoryOff("outputs.uly");
...@@ -459,16 +413,6 @@ private: ...@@ -459,16 +413,6 @@ private:
EnableParameter("outputs.lry"); EnableParameter("outputs.lry");
DisableParameter("outputs.ortho"); DisableParameter("outputs.ortho");
// Update the automatic value mode of each filed
AutomaticValueOff("outputs.ulx");
AutomaticValueOff("outputs.uly");
AutomaticValueOn("outputs.sizex");
AutomaticValueOn("outputs.sizey");
AutomaticValueOff("outputs.spacingx");
AutomaticValueOff("outputs.spacingy");
AutomaticValueOff("outputs.lrx");
AutomaticValueOff("outputs.lry");
// Adapt the status of the param to this mode // Adapt the status of the param to this mode
MandatoryOn("outputs.ulx"); MandatoryOn("outputs.ulx");
MandatoryOn("outputs.uly"); MandatoryOn("outputs.uly");
...@@ -517,16 +461,6 @@ private: ...@@ -517,16 +461,6 @@ private:
if (HasValue("outputs.ortho")) if (HasValue("outputs.ortho"))
{ {
// Automatic set to on
AutomaticValueOn("outputs.ulx");
AutomaticValueOn("outputs.uly");
AutomaticValueOn("outputs.sizex");
AutomaticValueOn("outputs.sizey");
AutomaticValueOn("outputs.spacingx");
AutomaticValueOn("outputs.spacingy");
AutomaticValueOn("outputs.lrx");
AutomaticValueOn("outputs.lry");
// input image // input image
FloatVectorImageType::Pointer inOrtho = GetParameterImage("outputs.ortho"); FloatVectorImageType::Pointer inOrtho = GetParameterImage("outputs.ortho");
......
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