Skip to content
Snippets Groups Projects
Commit b7065e74 authored by Otmane Lahlou's avatar Otmane Lahlou
Browse files

MRG

parents 53d82226 e06cab66
Branches
Tags
No related merge requests found
...@@ -76,11 +76,14 @@ UnaryFunctorObjectListFilter<TInputList,TOutputList,TFunction> ...@@ -76,11 +76,14 @@ UnaryFunctorObjectListFilter<TInputList,TOutputList,TFunction>
OutputListPointer outputPtr = this->GetOutput(); OutputListPointer outputPtr = this->GetOutput();
for (unsigned int i=0; i< this->m_ObjectListPerThread.size(); ++i) for (unsigned int i=0; i< this->m_ObjectListPerThread.size(); ++i)
{ {
if(this->m_ObjectListPerThread[i].IsNotNull())
{
for (OutputListIterator it = this->m_ObjectListPerThread[i]->Begin(); for (OutputListIterator it = this->m_ObjectListPerThread[i]->Begin();
it != this->m_ObjectListPerThread[i]->End(); it != this->m_ObjectListPerThread[i]->End();
++it) ++it)
{ {
outputPtr->PushBack(it.Get()); outputPtr->PushBack(it.Get());
}
} }
} }
......
...@@ -83,7 +83,9 @@ public: ...@@ -83,7 +83,9 @@ public:
/** Toogle optimisation flag */ /** Toogle optimisation flag */
itkBooleanMacro(Optimisation); itkBooleanMacro(Optimisation);
itkSetMacro(Optimisation,bool); itkSetMacro(Optimisation,bool);
itkBooleanMacro(UseInverted);
itkSetMacro(UseInverted,bool);
void SetSegmentationRanges(SegmentationRangesType ranges) void SetSegmentationRanges(SegmentationRangesType ranges)
{ {
m_SegmentationRanges = ranges; m_SegmentationRanges = ranges;
...@@ -161,6 +163,10 @@ private: ...@@ -161,6 +163,10 @@ private:
/** This array stores the indices corresponding to each segmentation */ /** This array stores the indices corresponding to each segmentation */
SegmentationRangesType m_SegmentationRanges; SegmentationRangesType m_SegmentationRanges;
/** If set to true, the filter will also add the invert relationship
* between v2 and v1 */
bool m_UseInverted;
}; };
} // End namespace otb } // End namespace otb
......
...@@ -32,6 +32,7 @@ PolygonListToRCC8GraphFilter<TPolygonList, TOutputGraph> ...@@ -32,6 +32,7 @@ PolygonListToRCC8GraphFilter<TPolygonList, TOutputGraph>
{ {
this->SetNumberOfRequiredInputs(1); this->SetNumberOfRequiredInputs(1);
m_Optimisation=false; m_Optimisation=false;
m_UseInverted=false;
} }
/** /**
* Destructor. * Destructor.
...@@ -341,6 +342,10 @@ PolygonListToRCC8GraphFilter<TPolygonList, TOutputGraph> ...@@ -341,6 +342,10 @@ PolygonListToRCC8GraphFilter<TPolygonList, TOutputGraph>
// Add the edge to the graph. // Add the edge to the graph.
otbMsgDevMacro(<<"Adding edge: "<<vIt1.GetIndex()<<" -> "<<vIt2.GetIndex()<<": "<<value); otbMsgDevMacro(<<"Adding edge: "<<vIt1.GetIndex()<<" -> "<<vIt2.GetIndex()<<": "<<value);
m_EdgesPerThread[threadId][EdgePairType(vIt1.GetIndex(),vIt2.GetIndex())]=value; m_EdgesPerThread[threadId][EdgePairType(vIt1.GetIndex(),vIt2.GetIndex())]=value;
if(m_UseInverted)
{
m_EdgesPerThread[threadId][EdgePairType(vIt2.GetIndex(),vIt1.GetIndex())]=invert[value];
}
} }
} }
progress.CompletedPixel(); progress.CompletedPixel();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment