21 #ifndef otbPointSetExtractROI_hxx
22 #define otbPointSetExtractROI_hxx
33 template <
class TInputPo
intSet,
class TOutputPo
intSet>
41 template <
class TInputPo
intSet,
class TOutputPo
intSet>
44 Superclass::PrintSelf(os, indent);
50 template <
class TInputPo
intSet,
class TOutputPo
intSet>
53 typedef typename TInputPointSet::PointsContainer InputPointsContainer;
54 typedef typename TInputPointSet::PointsContainerPointer InputPointsContainerPointer;
55 typedef typename TOutputPointSet::PointsContainerPointer OutputPointsContainerPointer;
57 typedef typename TInputPointSet::PointDataContainerPointer InputPointDataContainerPointer;
58 typedef typename TOutputPointSet::PointDataContainerPointer OutputPointDataContainerPointer;
65 itkExceptionMacro(<<
"Missing Input PointSet");
70 itkExceptionMacro(<<
"Missing Output PointSet");
73 outputPointSet->SetBufferedRegion(outputPointSet->GetRequestedRegion());
75 InputPointsContainerPointer inPoints = inputPointSet->GetPoints();
76 InputPointDataContainerPointer inData = inputPointSet->GetPointData();
77 OutputPointsContainerPointer outPoints = outputPointSet->GetPoints();
78 OutputPointDataContainerPointer outData = outputPointSet->GetPointData();
80 typename InputPointsContainer::ConstIterator inputPoint = inPoints->Begin();
90 while (inputPoint != inPoints->End())
92 typename InputPointsContainer::Element point = inputPoint.Value();
94 if ((((point[0] >= m_StartX) && (point[0] < m_StartX + m_SizeX)) ||
95 ((point[0] <= m_StartX) && (point[0] > m_StartX + m_SizeX)))
96 && (((point[1] >= m_StartY) && (point[1] < m_StartY + m_SizeY)) || ((point[1] <= m_StartY) && (point[1] > m_StartY + m_SizeY))))
99 outPoints->push_back(point);
101 typename InputPointSetType::PixelType data;
102 inputPointSet->GetPointData(inputPoint.Index(), &data);
103 outData->push_back(data );