Commit 2a058bd3 authored by remi cresson's avatar remi cresson
Browse files

FIX: masks were not used when using additional mask or masksdir

No related merge requests found
Showing with 9 additions and 11 deletions
+9 -11
......@@ -259,6 +259,8 @@ public:
m_StatsFilter->SetIgnoreUserDefinedValue(true);
m_StatsFilter->SetUserIgnoredValue(m_DeltaNDVIFilter->GetFunctor().GetNoDataValue());
FloatImageType * deltaNDVIImage = m_DeltaNDVIFilter->GetOutput();
// Mask directory
if (HasValue("masksdir") || HasValue("mask"))
{
......@@ -266,9 +268,7 @@ public:
m_MaskImageFilter = MaskImageFilterType::New();
m_MaskImageFilter->SetInput(m_DeltaNDVIFilter->GetOutput());
m_MaskImageFilter->SetOutsideValue(3.0);
// Wire stats filter
m_StatsFilter->SetInput(m_MaskImageFilter->GetOutput());
deltaNDVIImage = m_MaskImageFilter->GetOutput();
// If there is a directory specified for masks, we instanciate the handler
if (HasValue("masksdir"))
......@@ -303,7 +303,7 @@ public:
// Wiring final mask to mask image filter
if (HasValue("masksdir") && HasValue("mask"))
{
// If both masks types are specified, we need to instanciate a AndImageFilter
// If both masks types are specified, we need to instantiate a AndImageFilter
m_AndFilter = AndFilterType::New();
m_AndFilter->SetInput1(m_MaskHandler->GetOutput());
m_AndFilter->SetInput2(m_MaskResampleFilter->GetOutput());
......@@ -321,11 +321,9 @@ public:
}
}
else
{
// Wire stats filter
m_StatsFilter->SetInput(m_DeltaNDVIFilter->GetOutput());
}
// Wire stats filter
m_StatsFilter->SetInput(deltaNDVIImage);
// Compute stats
AddProcess(m_StatsFilter->GetStreamer(),"Computing dNDVI statistics");
......@@ -334,12 +332,12 @@ public:
if (HasValue("outdndvi"))
{
// Connect delta NDVI to output
SetParameterOutputImage("outdndvi", m_DeltaNDVIFilter->GetOutput());
SetParameterOutputImage("outdndvi", deltaNDVIImage);
}
// Label image output
m_NDVILabelFilter = NDVILabelImageFilterType::New();
m_NDVILabelFilter->SetInput(m_DeltaNDVIFilter->GetOutput());
m_NDVILabelFilter->SetInput(deltaNDVIImage);
m_NDVILabelFilter->SetInputMeanObject(m_StatsFilter->GetMeanOutput());
m_NDVILabelFilter->SetInputSigmaObject(m_StatsFilter->GetSigmaOutput());
m_NDVILabelFilter->SetInputNoDataValue(m_DeltaNDVIFilter->GetFunctor().GetNoDataValue());
......
Supports Markdown
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