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
Branches
Tags
No related merge requests found
...@@ -136,8 +136,10 @@ protected: ...@@ -136,8 +136,10 @@ protected:
virtual ~ChangeNoDataValueFilter() virtual ~ChangeNoDataValueFilter()
{} {}
virtual void BeforeThreadedGenerateData() virtual void GenerateOutputInformation()
{ {
Superclass::GenerateOutputInformation();
std::vector<bool> noDataValueAvailable; std::vector<bool> noDataValueAvailable;
std::vector<double> noDataValues; std::vector<double> noDataValues;
...@@ -151,17 +153,12 @@ protected: ...@@ -151,17 +153,12 @@ protected:
this->GetFunctor().m_Flags = noDataValueAvailable; this->GetFunctor().m_Flags = noDataValueAvailable;
this->GetFunctor().m_Values = noDataValues; this->GetFunctor().m_Values = noDataValues;
}
std::vector<bool> flags = noDataValueAvailable;
virtual void GenerateOutputInformation()
{
Superclass::GenerateOutputInformation();
std::vector<bool> flags = this->GetFunctor().m_Flags;
if(this->GetFunctor().m_NaNIsNoData) 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()); 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