Skip to content

Commit

Permalink
BUG: Don't use InsertElement which modifies MTime
Browse files Browse the repository at this point in the history
Use the VectorContainer's STL interface to avoid causing MTime to be
called too many time. This has reported to overflow the global time
stamp with it's a 32-bit integer.
SimpleITK/SimpleITK#750
closes ITK/ITK#1352
  • Loading branch information
blowekamp committed Nov 6, 2019
1 parent ebaca30 commit 63d1487
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,7 @@ BSplineScatteredDataPointSetToImageFilter<TInputPointSet, TOutputImage>
this->m_OutputPointData->Begin();
while( ItIn != this->m_InputPointData->End() )
{
this->m_InputPointData->InsertElement(
ItIn.Index(), ItIn.Value() - ItOut.Value() );
this->m_InputPointData->CastToSTLContainer()[ItIn.Index()] = ItIn.Value() - ItOut.Value();

if( this->GetDebug() )
{
Expand Down Expand Up @@ -1101,6 +1100,7 @@ BSplineScatteredDataPointSetToImageFilter<TInputPointSet, TOutputImage>
typename PointDataImageType::IndexType startPhiIndex =
this->m_PhiLattice->GetLargestPossibleRegion().GetIndex();

this->m_OutputPointData->CastToSTLContainer().resize(this->m_InputPointData->Size());
typename PointDataContainerType::ConstIterator ItIn =
this->m_InputPointData->Begin();
while( ItIn != this->m_InputPointData->End() )
Expand Down Expand Up @@ -1146,8 +1146,7 @@ BSplineScatteredDataPointSetToImageFilter<TInputPointSet, TOutputImage>
break;
}
}
this->m_OutputPointData->InsertElement( ItIn.Index(),
collapsedPhiLattices[0]->GetPixel( startPhiIndex ) );
this->m_OutputPointData->CastToSTLContainer()[ItIn.Index()] = collapsedPhiLattices[0]->GetPixel(startPhiIndex);
++ItIn;
}
}
Expand Down

0 comments on commit 63d1487

Please sign in to comment.