Graft Plan Log.txt (12.6 KB)
I have changed as per the following link. Spatial Objects Refactoring section of the ITK 5 Migration Guide.
I got run time error while executing below code.
/** Remove duplicate points */
template <unsigned int TDimension, typename TTubePointType>
unsigned int
TubeSpatialObject<TDimension, TTubePointType>::RemoveDuplicatePointsInObjectSpace(double minSpacingInObjectSpace)
{
int nPoints = 0;
auto it = this->m_Points.begin();
while (it != this->m_Points.end())
{
PointType pnt = it->GetPositionInObjectSpace();
++it;
if (it != this->m_Points.end())
{
PointType pnt2 = it->GetPositionInObjectSpace();
double dist = pnt.EuclideanDistanceTo(pnt2);
if (dist <= minSpacingInObjectSpace)
{
it = this->m_Points.erase(it); //Access violation reading location
nPoints++;
--it;
}
}
}
return nPoints;
}
Exception thrown at 0x00007FFB172D5BCD (ConvertTubesToSurfaceLib.dll) in S1App-real.exe
Access violation reading location while executing the line it = this->m_Points.erase(it);
in the above code.
I have attached the graft plan log for more information.
May I know how to fix the above problem?