Skip to content

Commit 4aa4ce5

Browse files
authored
Merge pull request InsightSoftwareConsortium#5813 from N-Dekker/Remove-Image-and-OffsetTable-from-ImageConstIteratorWithOnlyIndex
STYLE: Remove Image and OffsetTable from ImageConstIteratorWithOnlyIndex
2 parents 510c398 + a3e214c commit 4aa4ce5

2 files changed

Lines changed: 3 additions & 9 deletions

File tree

Modules/Core/Common/include/itkImageConstIteratorWithOnlyIndex.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,7 @@ class ITK_TEMPLATE_EXPORT ImageConstIteratorWithOnlyIndex
246246
return m_Remaining;
247247
}
248248

249-
protected: // made protected so other iterators can access
250-
typename TImage::ConstPointer m_Image{};
251-
249+
protected: // made protected so other iterators can access
252250
IndexType m_PositionIndex{ { 0 } }; // Index where we currently are
253251
IndexType m_BeginIndex{ { 0 } }; // Index to start iterating over
254252
IndexType m_EndIndex{ { 0 } }; // Index to finish iterating:
@@ -257,8 +255,6 @@ class ITK_TEMPLATE_EXPORT ImageConstIteratorWithOnlyIndex
257255

258256
RegionType m_Region{}; // region to iterate over
259257

260-
OffsetValueType m_OffsetTable[ImageDimension + 1]{};
261-
262258
bool m_Remaining{ false };
263259
};
264260
} // end namespace itk

Modules/Core/Common/include/itkImageConstIteratorWithOnlyIndex.hxx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@ namespace itk
2525
// Constructor
2626
//----------------------------------------------------------------------
2727
template <typename TImage>
28-
ImageConstIteratorWithOnlyIndex<TImage>::ImageConstIteratorWithOnlyIndex(const TImage * ptr, const RegionType & region)
29-
: m_Image(ptr)
30-
, m_BeginIndex(region.GetIndex())
28+
ImageConstIteratorWithOnlyIndex<TImage>::ImageConstIteratorWithOnlyIndex(const TImage *, const RegionType & region)
29+
: m_BeginIndex(region.GetIndex())
3130
, m_Region(region)
3231
{
3332
m_PositionIndex = m_BeginIndex;
34-
std::copy_n(m_Image->GetOffsetTable(), ImageDimension + 1, m_OffsetTable);
3533

3634
// Compute the end offset
3735
for (unsigned int i = 0; i < ImageDimension; ++i)

0 commit comments

Comments
 (0)