Skip to content
Snippets Groups Projects
Commit 83d0d0ed authored by Cyrille Valladeau's avatar Cyrille Valladeau
Browse files

ENH : SGFT: correct segfault in surfaceadjency

parent 8249c1e4
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,7 @@ FilterFunctionValues
::FilterFunctionValues()
{
m_MinSpectralValue = 0;
m_MaxSpectralValue = 0;
m_MaxSpectralValue = 1;
m_UserStep = 0.0025;
}
......
......@@ -111,7 +111,6 @@ ReflectanceToSurfaceReflectanceImageFilter<TInputImage,TOutputImage>
}
}
Parameters2RadiativeTermsPointerType param2Terms = Parameters2RadiativeTermsType::New();
param2Terms->SetInput(m_CorrectionParameters);
......
......@@ -68,11 +68,11 @@ SurfaceAdjencyEffect6SCorrectionSchemeFilter<TInputImage, TOutputImage>
if (!inputPtr || !outputPtr)
return;
outputPtr->SetNumberOfComponentsPerPixel(inputPtr->GetNumberOfComponentsPerPixel());
outputPtr->SetNumberOfComponentsPerPixel(inputPtr->GetNumberOfComponentsPerPixel());
if(m_UseGenerateParameters)
this->GenerateParameters();
if (!m_ParametersHaveBeenComputed)
{
this->ComputeParameters();
......@@ -98,7 +98,7 @@ SurfaceAdjencyEffect6SCorrectionSchemeFilter<TInputImage,TOutputImage>
MetaDataDictionaryType dict = this->GetInput()->GetMetaDataDictionary();
ImageMetadataInterfaceBase::Pointer imageMetadataInterface = ImageMetadataInterfaceFactory::CreateIMI(dict);
if ((m_CorrectionParameters->GetDay() == 0))
{
m_CorrectionParameters->SetDay(imageMetadataInterface->GetDay(dict));
......@@ -113,7 +113,7 @@ SurfaceAdjencyEffect6SCorrectionSchemeFilter<TInputImage,TOutputImage>
{
m_CorrectionParameters->SetSolarZenithalAngle(90. - imageMetadataInterface->GetSunElevation(dict));
}
if ((m_CorrectionParameters->GetSolarAzimutalAngle() == 361.))
{
m_CorrectionParameters->SetSolarAzimutalAngle(imageMetadataInterface->GetSunAzimuth(dict));
......@@ -135,11 +135,13 @@ SurfaceAdjencyEffect6SCorrectionSchemeFilter<TInputImage,TOutputImage>
}
if(m_AeronetFileName != "")
m_CorrectionParameters->UpdateAeronetData( m_AeronetFileName,
imageMetadataInterface->GetYear(dict),
imageMetadataInterface->GetHour(dict),
imageMetadataInterface->GetMinute(dict) );
{
m_CorrectionParameters->UpdateAeronetData( m_AeronetFileName,
imageMetadataInterface->GetYear(dict),
imageMetadataInterface->GetHour(dict),
imageMetadataInterface->GetMinute(dict) );
}
// load fiter function values
if(m_FilterFunctionValuesFileName != "")
{
......@@ -163,11 +165,11 @@ SurfaceAdjencyEffect6SCorrectionSchemeFilter<TInputImage,TOutputImage>
}
}
Parameters2RadiativeTermsPointerType param2Terms = Parameters2RadiativeTermsType::New();
param2Terms->SetInput(m_CorrectionParameters);
param2Terms->Update();
m_AtmosphericRadiativeTerms = param2Terms->GetOutput();
}
......
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