Skip to content
Snippets Groups Projects
Commit 5e23c0d5 authored by Julien Michel's avatar Julien Michel
Browse files

BUG: Fixing error in filter implementation: GenerateOutputInformation is...

BUG: Fixing error in filter implementation: GenerateOutputInformation is called before BeforeThreadedGenerateData(), and this->GetFunctor()->m_Flags was therefore always empty
parent 821ae1ba
No related merge requests found
......@@ -136,8 +136,10 @@ protected:
virtual ~ChangeNoDataValueFilter()
{}
virtual void BeforeThreadedGenerateData()
virtual void GenerateOutputInformation()
{
Superclass::GenerateOutputInformation();
std::vector<bool> noDataValueAvailable;
std::vector<double> noDataValues;
......@@ -151,17 +153,12 @@ protected:
this->GetFunctor().m_Flags = noDataValueAvailable;
this->GetFunctor().m_Values = noDataValues;
}
virtual void GenerateOutputInformation()
{
Superclass::GenerateOutputInformation();
std::vector<bool> flags = this->GetFunctor().m_Flags;
std::vector<bool> flags = noDataValueAvailable;
if(this->GetFunctor().m_NaNIsNoData)
{
flags = std::vector<bool>(true,flags.size());
flags = std::vector<bool>(flags.size(),true);
}
WriteNoDataFlags(flags,this->GetFunctor().m_NewValues,this->GetOutput()->GetMetaDataDictionary());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment