Skip to content
Snippets Groups Projects
Commit 6941c4e8 authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

BUG: 576: compatibility with DefaultDynamicMeshTraits in PointSet filters

parent 749de4d2
No related branches found
No related tags found
No related merge requests found
......@@ -219,6 +219,7 @@ ImageToPointSetFilter<TInputImage, TOutputPointSet>
{
// copy the lists to the output
PointsContainerType * outputPointsContainer = this->GetOutput()->GetPoints();
unsigned long currentIndex = outputPointsContainer->Size();
typedef typename PointsContainerType::ConstIterator OutputPointsContainerIterator;
for (unsigned int i = 0; i < this->m_PointsContainerPerThread.size(); ++i)
......@@ -229,12 +230,14 @@ ImageToPointSetFilter<TInputImage, TOutputPointSet>
it != this->m_PointsContainerPerThread[i]->End();
++it)
{
outputPointsContainer->push_back(it.Value());
outputPointsContainer->InsertElement(currentIndex,it.Value());
++currentIndex;
}
}
}
PointDataContainerType * outputPointDataContainer = this->GetOutput()->GetPointData();
currentIndex = outputPointDataContainer->Size();
typedef typename PointDataContainerType::ConstIterator OutputPointDataContainerIterator;
for (unsigned int i = 0; i < this->m_PointDataContainerPerThread.size(); ++i)
......@@ -245,7 +248,8 @@ ImageToPointSetFilter<TInputImage, TOutputPointSet>
it != this->m_PointDataContainerPerThread[i]->End();
++it)
{
outputPointDataContainer->push_back(it.Value());
outputPointDataContainer->InsertElement(currentIndex,it.Value());
++currentIndex;
}
}
}
......
......@@ -51,6 +51,8 @@ ThresholdImageToPointSetFilter<TInputImage, TOutputPointSet>
typename OutputPointSetType::PointType position;
inputIt.GoToBegin();
unsigned long currentIndex = 0;
while (!inputIt.IsAtEnd())
{
......@@ -61,8 +63,9 @@ ThresholdImageToPointSetFilter<TInputImage, TOutputPointSet>
const IndexType index = inputIt.GetIndex();
position[0] = index[0];
position[1] = index[1];
this->m_PointsContainerPerThread[threadId]->push_back(position);
this->m_PointDataContainerPerThread[threadId]->push_back(static_cast<typename PointDataContainerType::Element>(value));
this->m_PointsContainerPerThread[threadId]->InsertElement(currentIndex,position);
this->m_PointDataContainerPerThread[threadId]->InsertElement(currentIndex,static_cast<typename PointDataContainerType::Element>(value));
++currentIndex;
}
++inputIt;
progress.CompletedPixel(); // potential exception thrown here
......
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