Skip to content

Commit 63d1487

Browse files
committed
BUG: Don't use InsertElement which modifies MTime
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
1 parent ebaca30 commit 63d1487

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Modules/Filtering/ImageGrid/include/itkBSplineScatteredDataPointSetToImageFilter.hxx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,7 @@ BSplineScatteredDataPointSetToImageFilter<TInputPointSet, TOutputImage>
348348
this->m_OutputPointData->Begin();
349349
while( ItIn != this->m_InputPointData->End() )
350350
{
351-
this->m_InputPointData->InsertElement(
352-
ItIn.Index(), ItIn.Value() - ItOut.Value() );
351+
this->m_InputPointData->CastToSTLContainer()[ItIn.Index()] = ItIn.Value() - ItOut.Value();
353352

354353
if( this->GetDebug() )
355354
{
@@ -1101,6 +1100,7 @@ BSplineScatteredDataPointSetToImageFilter<TInputPointSet, TOutputImage>
11011100
typename PointDataImageType::IndexType startPhiIndex =
11021101
this->m_PhiLattice->GetLargestPossibleRegion().GetIndex();
11031102

1103+
this->m_OutputPointData->CastToSTLContainer().resize(this->m_InputPointData->Size());
11041104
typename PointDataContainerType::ConstIterator ItIn =
11051105
this->m_InputPointData->Begin();
11061106
while( ItIn != this->m_InputPointData->End() )
@@ -1146,8 +1146,7 @@ BSplineScatteredDataPointSetToImageFilter<TInputPointSet, TOutputImage>
11461146
break;
11471147
}
11481148
}
1149-
this->m_OutputPointData->InsertElement( ItIn.Index(),
1150-
collapsedPhiLattices[0]->GetPixel( startPhiIndex ) );
1149+
this->m_OutputPointData->CastToSTLContainer()[ItIn.Index()] = collapsedPhiLattices[0]->GetPixel(startPhiIndex);
11511150
++ItIn;
11521151
}
11531152
}

0 commit comments

Comments
 (0)