Skip to content
Snippets Groups Projects
Commit 7a0a3195 authored by Valentin Genin's avatar Valentin Genin
Browse files

ENH: Adapt SARCompensatedComplex to otb V8

parent 1f04d2eb
No related branches found
No related tags found
3 merge requests!57Update to OTB V8,!56Update to OTB v8,!55Chaine diap otb s1 & s1iw v8
......@@ -111,10 +111,10 @@ OTB_CREATE_APPLICATION(NAME SARAltAmbig
# LINK_LIBRARIES ${${otb-module}_LIBRARIES}
# )
# OTB_CREATE_APPLICATION(NAME SARCompensatedComplex
# SOURCES otbSARCompensatedComplex.cxx
# LINK_LIBRARIES ${${otb-module}_LIBRARIES}
# )
OTB_CREATE_APPLICATION(NAME SARCompensatedComplex
SOURCES otbSARCompensatedComplex.cxx
LINK_LIBRARIES ${${otb-module}_LIBRARIES}
)
# OTB_CREATE_APPLICATION(NAME SARAddBandInterferogram
# SOURCES otbSARAddBandInterferogram.cxx
......
......@@ -30,7 +30,7 @@
#include "itkImageScanlineConstIterator.h"
#include "itkImageScanlineIterator.h"
#include "otbImageKeywordlist.h"
#include "otbImageMetadata.h"
namespace otb
......
......@@ -163,8 +163,8 @@ namespace otb
ImageSARConstPointer slavePtr = this->GetSlaveInput();
ImageOutPointer outputPtr = this->GetOutput();
// KeyWordList
ImageKeywordlist masterKWL = masterPtr->GetImageKeywordlist();
// Metadata
ImageMetadata masterMD = masterPtr->GetImageMetadata();
// Master SAR Dimensions
m_nbLinesSAR = this->GetMasterInput()->GetLargestPossibleRegion().GetSize()[1];
......@@ -192,27 +192,27 @@ namespace otb
outputPtr->SetOrigin(outOrigin);
outputPtr->SetSpacing(outSP);
// Add ML factors and bands meaning into keyWordList
ImageKeywordlist outputKWL = masterKWL;
outputKWL.AddKey("support_data.band.Amplitude", std::to_string(0));
outputKWL.AddKey("support_data.band.Phase", std::to_string(1));
outputKWL.AddKey("support_data.band.Coherency", std::to_string(2));
// Add ML factors and bands meaning into Metadata
ImageMetadata outputMD = masterMD;
outputMD.Add("band.Amplitude", std::to_string(0));
outputMD.Add("band.Phase", std::to_string(1));
outputMD.Add("band.Coherency", std::to_string(2));
// Set new keyword list to output image
outputPtr->SetImageKeywordList(outputKWL);
outputPtr->SetImageMetadata(outputMD);
///////// Checks (with input topographic phase keywordlists/metadata) /////////////
///////// Checks (with input topographic phase Metadatas/metadata) /////////////
// Check ML Factors (must be 1 to have the same geometry than SAR images)
if (this->GetTopographicPhaseInput() != nullptr)
{
// Get ImagKeyWordList
ImageKeywordlist topoKWL = this->GetTopographicPhaseInput()->GetImageKeywordlist();
// Get ImagMetadata
ImageMetadata topoMD = this->GetTopographicPhaseInput()->GetImageMetadata();
if (topoKWL.HasKey("support_data.ml_ran") && topoKWL.HasKey("support_data.ml_azi"))
if (topoMD.Has("ml_ran") && topoMD.Has("ml_azi"))
{
// Get Master ML Factors
unsigned int topo_MLRan = atoi(topoKWL.GetMetadataByKey("support_data.ml_ran").c_str());
unsigned int topo_MLAzi = atoi(topoKWL.GetMetadataByKey("support_data.ml_azi").c_str());
unsigned int topo_MLRan = atoi(topoMD["ml_ran"].c_str());
unsigned int topo_MLAzi = atoi(topoMD["ml_azi"].c_str());
if ((topo_MLRan != 1) || (topo_MLAzi != 1))
{
......
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