21 #ifndef otbMaskedIteratorDecorator_hxx
22 #define otbMaskedIteratorDecorator_hxx
30 template <
typename TIteratorType,
typename TMaskIteratorType>
33 m_ItImage = TIteratorType(image, region);
40 if (image->GetLargestPossibleRegion() != mask->GetLargestPossibleRegion())
42 itkGenericExceptionMacro(
"Input image and mask have different largest regions : mask is discarded!");
47 m_ItMask = TMaskIteratorType(mask, region);
48 m_StartMask = TMaskIteratorType(mask, region);
49 m_StartImage = TIteratorType(image, region);
54 template <
typename TIteratorType,
typename TMaskIteratorType>
57 return m_ItImage.GetIndex();
60 template <
typename TIteratorType,
typename TMaskIteratorType>
65 this->ComputeMaskedBegin();
69 m_ItImage.GoToBegin();
73 template <
typename TIteratorType,
typename TMaskIteratorType>
80 this->ComputeMaskedBegin();
86 template <
typename TIteratorType,
typename TMaskIteratorType>
91 return m_ItMask == m_StartMask || m_ItImage == m_StartImage;
93 return m_ItImage.IsAtBegin();
96 template <
typename TIteratorType,
typename TMaskIteratorType>
101 return m_ItMask.IsAtEnd() || m_ItImage.IsAtEnd();
103 return m_ItImage.IsAtEnd();
107 template <
typename TIteratorType,
typename TMaskIteratorType>
116 }
while (m_ItMask.Value() == 0 && !this->IsAtEnd());
126 template <
typename TIteratorType,
typename TMaskIteratorType>
135 }
while (m_ItMask.Value() == 0 && !this->IsAtBegin());
152 template <
typename TIteratorType,
typename TMaskIteratorType>
156 return m_ItImage.Value();
159 template <
typename TIteratorType,
typename TMaskIteratorType>
165 template <
typename TIteratorType,
typename TMaskIteratorType>
171 template <
typename TIteratorType,
typename TMaskIteratorType>
177 template <
typename TIteratorType,
typename TMaskIteratorType>
183 template <
typename TIteratorType,
typename TMaskIteratorType>
190 template <
typename TIteratorType,
typename TMaskIteratorType>
195 m_ItMask.GoToBegin();
196 m_ItImage.GoToBegin();
199 while (m_ItMask.Value() == 0 && !m_ItMask.IsAtEnd() && !m_ItImage.IsAtEnd())
204 m_StartMask.SetIndex(m_ItMask.GetIndex());
205 m_StartImage.SetIndex(m_ItImage.GetIndex());