18 #ifndef itkConnectedComponentAlgorithm_h
19 #define itkConnectedComponentAlgorithm_h
26 template <
typename TIterator>
31 it->ClearActiveList();
36 typename TIterator::OffsetType offset{};
40 it->ActivateOffset(offset);
42 it->ActivateOffset(offset);
50 const unsigned int centerIndex = it->GetCenterNeighborhoodIndex();
51 for (
unsigned int d = 0; d < centerIndex * 2 + 1; ++d)
53 const typename TIterator::OffsetType offset = it->GetOffset(d);
54 it->ActivateOffset(offset);
56 const typename TIterator::OffsetType offset_zeros{};
57 it->DeactivateOffset(offset_zeros);
62 template <
typename TIterator>
67 it->ClearActiveList();
72 typename TIterator::OffsetType offset{};
76 it->ActivateOffset(offset);
84 const unsigned int centerIndex = it->GetCenterNeighborhoodIndex();
85 for (
unsigned int d = 0; d < centerIndex; ++d)
87 const typename TIterator::OffsetType offset = it->GetOffset(d);
88 it->ActivateOffset(offset);
90 const typename TIterator::OffsetType offset_zeros{};
91 it->DeactivateOffset(offset_zeros);
96 template <
typename TIterator>
102 it->ClearActiveList();
107 typename TIterator::OffsetType offset{};
111 it->ActivateOffset(offset);
119 const unsigned int centerIndex = it->GetCenterNeighborhoodIndex();
120 for (
unsigned int d = centerIndex + 1; d < 2 * centerIndex + 1; ++d)
122 const typename TIterator::OffsetType offset = it->GetOffset(d);
123 it->ActivateOffset(offset);
125 const typename TIterator::OffsetType offset_zeros{};
126 it->DeactivateOffset(offset_zeros);