ITK  5.3.0
Insight Toolkit
itkShapedImageNeighborhoodRange.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * https://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 
19 #ifndef itkShapedImageNeighborhoodRange_h
20 #define itkShapedImageNeighborhoodRange_h
21 
22 #include <algorithm> // For copy_n.
23 #include <cassert>
24 #include <cstddef> // For ptrdiff_t.
25 #include <iterator> // For random_access_iterator_tag.
26 #include <limits>
27 #include <type_traits> // For conditional and is_const.
28 
29 #include "itkIndex.h"
30 #include "itkSize.h"
32 
33 namespace itk
34 {
35 
90 template <typename TImage,
91  typename TImageNeighborhoodPixelAccessPolicy = ZeroFluxNeumannImageNeighborhoodPixelAccessPolicy<TImage>>
93 {
94 private:
95  // Empty struct, used internally to denote that there is no pixel access parameter specified.
97  {};
98 
99 
100  // Helper class to estimate whether the policy has nested type PixelAccessParameterType.
102  {
103  private:
104  // The Test function has two overloads whose return type is different.
105  // One of the overloads is only available for overload resolution when
106  // the policy T has a nested type PixelAccessParameterType (using SFINAE).
107 
108  template <typename T>
109  static int
110  Test(typename T::PixelAccessParameterType *);
111 
112  template <typename T>
113  static void
114  Test(...);
115 
116  public:
117  // This constant tells whether the policy has a PixelAccessParameterType:
118  static constexpr bool HasPixelAccessParameterType =
119  !std::is_same<decltype(Test<TImageNeighborhoodPixelAccessPolicy>(nullptr)),
120  decltype(Test<TImageNeighborhoodPixelAccessPolicy>())>::value;
121  };
122 
123 
124  template <typename TPolicy, bool VPolicyHasPixelAccessParameterType = CheckPolicy::HasPixelAccessParameterType>
126  {
127  using Type = typename TPolicy::PixelAccessParameterType;
128  };
129 
130  // Specialization for when the policy does not have PixelAccessParameterType.
131  template <typename TPolicy>
132  struct OptionalPixelAccessParameter<TPolicy, false>
133  {
135  };
136 
137 
138  using ImageType = TImage;
139  using ImageDimensionType = typename TImage::ImageDimensionType;
140  using ImageSizeType = typename TImage::SizeType;
143  using PixelType = typename TImage::PixelType;
144  using InternalPixelType = typename TImage::InternalPixelType;
145  using NeighborhoodAccessorFunctorType = typename TImage::NeighborhoodAccessorFunctorType;
146  static constexpr ImageDimensionType ImageDimension = TImage::ImageDimension;
147  using IndexType = typename TImage::IndexType;
152 
153 
154  // PixelProxy: internal class that aims to act like a reference to a pixel:
155  // It acts either like 'PixelType &' or like 'const PixelType &', depending
156  // on its boolean template argument, VIsConst.
157  // The proxy retrieves the pixel value using a ImageNeighborhoodPixelAccessPolicy.
158  // Note: the extra TDummy argument aims to fix AppleClang 6.0.0.6000056 error
159  // "explicit specialization of 'PixelProxy'"and GCC 5.4.0 error "explicit
160  // specialization in non-namespace scope".
161  template <bool VIsConst, typename TDummy = void>
163  {};
164 
165  // PixelProxy specialization for const pixel types:
166  // acts like 'const PixelType &'
167  template <typename TDummy>
168  class PixelProxy<true, TDummy> final
169  {
170  private:
171  // Pointer to the buffer of the image. Should not be null.
173 
174  // Pixel access policy.
175  const TImageNeighborhoodPixelAccessPolicy m_PixelAccessPolicy;
176 
177  public:
178  // Deleted member functions:
179  PixelProxy() = delete;
180  PixelProxy &
181  operator=(const PixelProxy &) = delete;
182 
183  // Explicitly-defaulted member functions:
184  PixelProxy(const PixelProxy &) noexcept = default;
185  ~PixelProxy() = default;
186 
187  // Constructor, called directly by operator*() of the iterator class.
188  PixelProxy(const InternalPixelType * const imageBufferPointer,
189  const TImageNeighborhoodPixelAccessPolicy & pixelAccessPolicy) noexcept
190  : m_ImageBufferPointer{ imageBufferPointer }
191  , m_PixelAccessPolicy{ pixelAccessPolicy }
192  {}
193 
194  // Allows implicit conversion from non-const to const proxy.
195  PixelProxy(const PixelProxy<false> & pixelProxy) noexcept
196  : m_ImageBufferPointer{ pixelProxy.m_ImageBufferPointer }
197  , m_PixelAccessPolicy{ pixelProxy.m_PixelAccessPolicy }
198  {}
199 
200  // Conversion operator.
201  operator PixelType() const noexcept { return m_PixelAccessPolicy.GetPixelValue(m_ImageBufferPointer); }
202  };
203 
204 
205  // PixelProxy specialization for non-const pixel types:
206  // acts like 'PixelType &'.
207  template <typename TDummy>
208  class PixelProxy<false, TDummy> final
209  {
210  private:
211  // The const proxy is a friend, to ease implementing conversion from
212  // a non-const proxy to a const proxy.
213  friend class PixelProxy<true>;
214 
215  // Pointer to the buffer of the image. Should not be null.
217 
218  // Pixel access policy.
219  const TImageNeighborhoodPixelAccessPolicy m_PixelAccessPolicy;
220 
221  public:
222  // Deleted member functions:
223  PixelProxy() = delete;
224 
225  // Explicitly-defaulted member functions:
226  ~PixelProxy() = default;
227  PixelProxy(const PixelProxy &) noexcept = default;
228 
229  // Constructor, called directly by operator*() of the iterator class.
230  PixelProxy(InternalPixelType * const imageBufferPointer,
231  const TImageNeighborhoodPixelAccessPolicy & pixelAccessPolicy) noexcept
232  : m_ImageBufferPointer{ imageBufferPointer }
233  , m_PixelAccessPolicy{ pixelAccessPolicy }
234  {}
235 
236  // Conversion operator.
237  operator PixelType() const noexcept { return m_PixelAccessPolicy.GetPixelValue(m_ImageBufferPointer); }
238 
239  // Operator to assign a pixel value to the proxy.
240  PixelProxy &
241  operator=(const PixelType & pixelValue) noexcept
242  {
243  m_PixelAccessPolicy.SetPixelValue(m_ImageBufferPointer, pixelValue);
244  return *this;
245  }
246 
247  // Copy-assignment operator.
248  PixelProxy &
249  operator=(const PixelProxy & pixelProxy) noexcept
250  {
251  // Note that this assignment operator only copies the pixel value.
252  // That is the normal behavior when a reference is assigned to another.
253  const PixelType pixelValue = pixelProxy;
254  *this = pixelValue;
255  return *this;
256  }
257 
258 
259  friend void
260  swap(PixelProxy lhs, PixelProxy rhs) noexcept
261  {
262  const auto lhsPixelValue = lhs.m_PixelAccessPolicy.GetPixelValue(lhs.m_ImageBufferPointer);
263  const auto rhsPixelValue = rhs.m_PixelAccessPolicy.GetPixelValue(rhs.m_ImageBufferPointer);
264 
265  // Swap only the pixel values, not the image buffer pointers!
266  lhs.m_PixelAccessPolicy.SetPixelValue(lhs.m_ImageBufferPointer, rhsPixelValue);
267  rhs.m_PixelAccessPolicy.SetPixelValue(rhs.m_ImageBufferPointer, lhsPixelValue);
268  }
269  };
270 
271 
284  template <bool VIsConst>
285  class QualifiedIterator final
286  {
287  private:
288  // Const and non-const iterators are friends, in order to implement the
289  // constructor that allow conversion from non-const to const iterator.
290  friend class QualifiedIterator<!VIsConst>;
291 
292  // ShapedImageNeighborhoodRange is a friend, as it should be the only one that can
293  // directly use the private constructor of the iterator.
295 
296  // Image type class that is either 'const' or non-const qualified, depending on QualifiedIterator and TImage.
297  using QualifiedImageType = std::conditional_t<VIsConst, const ImageType, ImageType>;
298 
299  static constexpr bool IsImageTypeConst = std::is_const<QualifiedImageType>::value;
300 
301  using QualifiedInternalPixelType = std::conditional_t<IsImageTypeConst, const InternalPixelType, InternalPixelType>;
302 
303  // Pixel type class that is either 'const' or non-const qualified, depending on QualifiedImageType.
304  using QualifiedPixelType = std::conditional_t<IsImageTypeConst, const PixelType, PixelType>;
305 
306  // Pointer to the buffer of the image. Only null when the iterator is default-constructed.
308 
309  // Image size.
311 
312  // A copy of the offset table of the image.
314 
315  // The accessor of the image.
317 
319 
320  // The pixel coordinates of the location of the neighborhood, relative to
321  // the index of the first pixel of the buffered region. Note that this
322  // location does not have to be within buffered region. It may also be
323  // outside the image.
325 
326  const OffsetType * m_CurrentOffset = nullptr;
327 
328  // Private constructor, used to create the begin and the end iterator of a range.
329  // Only used by its friend class ShapedImageNeighborhoodRange.
330  QualifiedIterator(QualifiedInternalPixelType * const imageBufferPointer,
331  const ImageSizeType & imageSize,
332  const OffsetType & offsetTable,
333  const NeighborhoodAccessorFunctorType & neighborhoodAccessor,
334  const OptionalPixelAccessParameterType optionalPixelAccessParameter,
335  const IndexType & relativeLocation,
336  const OffsetType * const offset) noexcept
337  : m_ImageBufferPointer{ imageBufferPointer }
338  ,
339  // Note: Use parentheses instead of curly braces to initialize data members,
340  // to avoid AppleClang 6.0.0.6000056 compilation error, "no viable conversion..."
341  m_ImageSize(imageSize)
342  , m_OffsetTable(offsetTable)
343  , m_NeighborhoodAccessor(neighborhoodAccessor)
344  , m_OptionalPixelAccessParameter(optionalPixelAccessParameter)
345  , m_RelativeLocation(relativeLocation)
346  , m_CurrentOffset{ offset }
347  {}
348 
349 
350  TImageNeighborhoodPixelAccessPolicy CreatePixelAccessPolicy(EmptyPixelAccessParameter) const
351  {
352  return TImageNeighborhoodPixelAccessPolicy{
354  };
355  }
356 
357  template <typename TPixelAccessParameter>
358  TImageNeighborhoodPixelAccessPolicy
359  CreatePixelAccessPolicy(const TPixelAccessParameter pixelAccessParameter) const
360  {
361  static_assert(std::is_same<TPixelAccessParameter, OptionalPixelAccessParameterType>::value,
362  "This helper function should only be used for OptionalPixelAccessParameterType!");
363  static_assert(!std::is_same<TPixelAccessParameter, EmptyPixelAccessParameter>::value,
364  "EmptyPixelAccessParameter indicates that there is no pixel access parameter specified!");
365  return TImageNeighborhoodPixelAccessPolicy{
367  };
368  }
369 
370  public:
371  // Types conforming the iterator requirements of the C++ standard library:
372  using difference_type = ptrdiff_t;
376  using iterator_category = std::random_access_iterator_tag;
377 
378 
389  QualifiedIterator() = default;
390 
394  : m_ImageBufferPointer{ arg.m_ImageBufferPointer }
395  ,
396  // Note: Use parentheses instead of curly braces to initialize data members,
397  // to avoid AppleClang 6.0.0.6000056 compilation error, "no viable conversion..."
398  m_ImageSize(arg.m_ImageSize)
399  , m_OffsetTable(arg.m_OffsetTable)
400  , m_NeighborhoodAccessor(arg.m_NeighborhoodAccessor)
401  , m_OptionalPixelAccessParameter(arg.m_OptionalPixelAccessParameter)
402  , m_RelativeLocation(arg.m_RelativeLocation)
403  , m_CurrentOffset{ arg.m_CurrentOffset }
404  {}
409  reference operator*() const noexcept
410  {
412  }
418  operator++() noexcept
419  {
420  assert(m_CurrentOffset != nullptr);
421  ++m_CurrentOffset;
422  return *this;
423  }
430  operator++(int) noexcept
431  {
432  auto result = *this;
433  ++(*this);
434  return result;
435  }
441  operator--() noexcept
442  {
443  assert(m_CurrentOffset != nullptr);
444  --m_CurrentOffset;
445  return *this;
446  }
453  operator--(int) noexcept
454  {
455  auto result = *this;
456  --(*this);
457  return result;
458  }
465  friend bool
466  operator==(const QualifiedIterator & lhs, const QualifiedIterator & rhs) noexcept
467  {
468  assert(lhs.m_ImageBufferPointer == rhs.m_ImageBufferPointer);
469  assert(lhs.m_ImageSize == rhs.m_ImageSize);
470  assert(lhs.m_OffsetTable == rhs.m_OffsetTable);
473  return lhs.m_CurrentOffset == rhs.m_CurrentOffset;
474  }
475 
476 
478  friend bool
479  operator!=(const QualifiedIterator & lhs, const QualifiedIterator & rhs) noexcept
480  {
481  // Implemented just like the corresponding std::rel_ops operator.
482  return !(lhs == rhs);
483  }
484 
485 
487  friend bool
488  operator<(const QualifiedIterator & lhs, const QualifiedIterator & rhs) noexcept
489  {
490  assert(lhs.m_ImageBufferPointer == rhs.m_ImageBufferPointer);
491  assert(lhs.m_ImageSize == rhs.m_ImageSize);
492  assert(lhs.m_OffsetTable == rhs.m_OffsetTable);
495  return lhs.m_CurrentOffset < rhs.m_CurrentOffset;
496  }
497 
498 
500  friend bool
501  operator>(const QualifiedIterator & lhs, const QualifiedIterator & rhs) noexcept
502  {
503  // Implemented just like the corresponding std::rel_ops operator.
504  return rhs < lhs;
505  }
506 
507 
509  friend bool
510  operator<=(const QualifiedIterator & lhs, const QualifiedIterator & rhs) noexcept
511  {
512  // Implemented just like the corresponding std::rel_ops operator.
513  return !(rhs < lhs);
514  }
515 
516 
518  friend bool
519  operator>=(const QualifiedIterator & lhs, const QualifiedIterator & rhs) noexcept
520  {
521  // Implemented just like the corresponding std::rel_ops operator.
522  return !(lhs < rhs);
523  }
524 
525 
527  friend QualifiedIterator &
529  {
530  it.m_CurrentOffset += n;
531  return it;
532  }
536  friend QualifiedIterator &
538  {
539  it += (-n);
540  return it;
541  }
545  friend difference_type
546  operator-(const QualifiedIterator & lhs, const QualifiedIterator & rhs) noexcept
547  {
548  assert(lhs.m_ImageBufferPointer == rhs.m_ImageBufferPointer);
549  assert(lhs.m_ImageSize == rhs.m_ImageSize);
550  assert(lhs.m_OffsetTable == rhs.m_OffsetTable);
553  return lhs.m_CurrentOffset - rhs.m_CurrentOffset;
554  }
555 
556 
558  friend QualifiedIterator
560  {
561  return it += n;
562  }
563 
564 
566  friend QualifiedIterator
568  {
569  return it += n;
570  }
571 
572 
574  friend QualifiedIterator
576  {
577  return it += (-n);
578  }
579 
580 
582  reference operator[](const difference_type n) const noexcept { return *(*this + n); }
583 
584 
587  operator=(const QualifiedIterator &) noexcept = default;
588  };
589 
590  static constexpr bool IsImageTypeConst = std::is_const<TImage>::value;
591 
592  using QualifiedInternalPixelType = std::conditional_t<IsImageTypeConst, const InternalPixelType, InternalPixelType>;
593 
594 
595  // Just the data from itk::ImageRegion (not the virtual table)
596  struct RegionData
597  {
600 
601  RegionData() noexcept = default;
602 
603  explicit RegionData(const ImageRegionType & imageRegion)
604  : m_Index(imageRegion.GetIndex())
605  , m_Size(imageRegion.GetSize())
606  {}
607  };
608 
609 
610  void
611  SubtractIndex(IndexType & index1, const IndexType & index2)
612  {
613  for (unsigned int i = 0; i < ImageDimension; ++i)
614  {
615  index1[i] -= index2[i];
616  }
617  }
618 
619  // ShapedImageNeighborhoodRange data members (strictly private):
620 
621  // Pointer to the buffer of the image.
623 
624  // Index and size of the buffered image region.
626 
627  // A copy of the offset table of the image.
629 
631 
632  // Index (pixel coordinates) of the location of the neighborhood relative
633  // to the origin of the image. Typically it is the location of the
634  // center pixel of the neighborhood. It may be outside the image boundaries.
636 
637  // The offsets relative to m_RelativeLocation that specify the neighborhood shape.
638  const OffsetType * m_ShapeOffsets{ nullptr };
639 
640  // The number of neighborhood pixels.
642 
644 
645 public:
648  using reverse_iterator = std::reverse_iterator<iterator>;
649  using const_reverse_iterator = std::reverse_iterator<const_iterator>;
650 
656  ShapedImageNeighborhoodRange() = default;
657 
666  const IndexType & location,
667  const OffsetType * const shapeOffsets,
668  const size_t numberOfNeigborhoodPixels,
669  const OptionalPixelAccessParameterType optionalPixelAccessParameter = {})
670  : m_ImageBufferPointer{ image.ImageType::GetBufferPointer() }
671  ,
672  // Note: Use parentheses instead of curly braces to initialize data members,
673  // to avoid AppleClang 6.0.0.6000056 compile errors, "no viable conversion..."
674  // and "excess elements in struct initializer".
675  m_BufferedRegionData(image.ImageType::GetBufferedRegion())
676  , m_NeighborhoodAccessor(image.GetNeighborhoodAccessor())
677  , m_RelativeLocation(location)
678  , m_ShapeOffsets{ shapeOffsets }
679  , m_NumberOfNeighborhoodPixels{ numberOfNeigborhoodPixels }
680  , m_OptionalPixelAccessParameter(optionalPixelAccessParameter)
681  {
682  const OffsetValueType * const offsetTable = image.GetOffsetTable();
683  assert(offsetTable != nullptr);
686  std::copy_n(offsetTable, ImageDimension, m_OffsetTable.begin());
687 
690  }
691 
701  template <typename TContainerOfOffsets>
703  const IndexType & location,
704  const TContainerOfOffsets & shapeOffsets,
705  const OptionalPixelAccessParameterType optionalPixelAccessParameter = {})
707  location,
708  shapeOffsets.data(),
709  shapeOffsets.size(),
710  optionalPixelAccessParameter }
711  {}
715  iterator
716  begin() const noexcept
717  {
720  }
721 
723  iterator
724  end() const noexcept
725  {
733  }
734 
738  cbegin() const noexcept
739  {
740  return this->begin();
741  }
742 
745  cend() const noexcept
746  {
747  return this->end();
748  }
749 
752  rbegin() const noexcept
753  {
754  return reverse_iterator(this->end());
755  }
756 
759  rend() const noexcept
760  {
761  return reverse_iterator(this->begin());
762  }
763 
766  crbegin() const noexcept
767  {
768  return this->rbegin();
769  }
770 
773  crend() const noexcept
774  {
775  return this->rend();
776  }
777 
778 
780  size_t
781  size() const noexcept
782  {
784  }
785 
786 
788  bool
789  empty() const noexcept
790  {
791  return m_NumberOfNeighborhoodPixels == 0;
792  }
793 
794 
800  typename QualifiedIterator<false>::reference operator[](const size_t n) const noexcept
801  {
802  assert(n < this->size());
803  assert(n <= static_cast<size_t>(std::numeric_limits<ptrdiff_t>::max()));
806  return this->begin()[static_cast<ptrdiff_t>(n)];
807  }
808 
809 
813  void
814  SetLocation(const IndexType & location) noexcept
815  {
816  m_RelativeLocation = location;
818  }
819 };
822 } // namespace itk
823 
824 #endif
itk::ShapedImageNeighborhoodRange::QualifiedIterator::QualifiedIterator
QualifiedIterator(QualifiedInternalPixelType *const imageBufferPointer, const ImageSizeType &imageSize, const OffsetType &offsetTable, const NeighborhoodAccessorFunctorType &neighborhoodAccessor, const OptionalPixelAccessParameterType optionalPixelAccessParameter, const IndexType &relativeLocation, const OffsetType *const offset) noexcept
Definition: itkShapedImageNeighborhoodRange.h:330
itk::ShapedImageNeighborhoodRange::cend
const_iterator cend() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:745
itk::ShapedImageNeighborhoodRange::operator[]
QualifiedIterator< false >::reference operator[](const vcl_size_t n) const noexcept
Definition: itkShapedImageNeighborhoodRange.h:800
itk::ShapedImageNeighborhoodRange::m_BufferedRegionData
RegionData m_BufferedRegionData
Definition: itkShapedImageNeighborhoodRange.h:625
itk::ShapedImageNeighborhoodRange::crbegin
const_reverse_iterator crbegin() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:766
itk::ShapedImageNeighborhoodRange::IndexValueType
typename TImage::IndexValueType IndexValueType
Definition: itkShapedImageNeighborhoodRange.h:148
itk::ShapedImageNeighborhoodRange::RegionData::m_Size
ImageSizeType m_Size
Definition: itkShapedImageNeighborhoodRange.h:599
itk::ShapedImageNeighborhoodRange::RegionData::m_Index
IndexType m_Index
Definition: itkShapedImageNeighborhoodRange.h:598
itk::ShapedImageNeighborhoodRange::PixelProxy< false, TDummy >::PixelProxy
PixelProxy(InternalPixelType *const imageBufferPointer, const TImageNeighborhoodPixelAccessPolicy &pixelAccessPolicy) noexcept
Definition: itkShapedImageNeighborhoodRange.h:230
itk::ShapedImageNeighborhoodRange::ImageSizeType
typename TImage::SizeType ImageSizeType
Definition: itkShapedImageNeighborhoodRange.h:140
itk::ShapedImageNeighborhoodRange::CheckPolicy
Definition: itkShapedImageNeighborhoodRange.h:101
itk::Offset::begin
constexpr iterator begin()
Definition: itkOffset.h:319
itk::ShapedImageNeighborhoodRange::IsImageTypeConst
static constexpr bool IsImageTypeConst
Definition: itkShapedImageNeighborhoodRange.h:590
itk::ShapedImageNeighborhoodRange::QualifiedIterator::m_OffsetTable
OffsetType m_OffsetTable
Definition: itkShapedImageNeighborhoodRange.h:313
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator++
QualifiedIterator operator++(int) noexcept
Definition: itkShapedImageNeighborhoodRange.h:430
itk::ShapedImageNeighborhoodRange::crend
const_reverse_iterator crend() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:773
itk::ShapedImageNeighborhoodRange::QualifiedIterator::pointer
QualifiedPixelType * pointer
Definition: itkShapedImageNeighborhoodRange.h:375
itk::ShapedImageNeighborhoodRange::PixelProxy< false, TDummy >::operator=
PixelProxy & operator=(const PixelType &pixelValue) noexcept
Definition: itkShapedImageNeighborhoodRange.h:241
itk::ShapedImageNeighborhoodRange::QualifiedIterator::QualifiedPixelType
std::conditional_t< IsImageTypeConst, const PixelType, PixelType > QualifiedPixelType
Definition: itkShapedImageNeighborhoodRange.h:304
itk::ShapedImageNeighborhoodRange::QualifiedIterator::QualifiedInternalPixelType
std::conditional_t< IsImageTypeConst, const InternalPixelType, InternalPixelType > QualifiedInternalPixelType
Definition: itkShapedImageNeighborhoodRange.h:301
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator--
QualifiedIterator operator--(int) noexcept
Definition: itkShapedImageNeighborhoodRange.h:453
itkZeroFluxNeumannImageNeighborhoodPixelAccessPolicy.h
itk::ShapedImageNeighborhoodRange::begin
iterator begin() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:716
itk::ShapedImageNeighborhoodRange::QualifiedIterator::value_type
PixelType value_type
Definition: itkShapedImageNeighborhoodRange.h:373
itk::ShapedImageNeighborhoodRange::m_RelativeLocation
IndexType m_RelativeLocation
Definition: itkShapedImageNeighborhoodRange.h:635
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator==
friend bool operator==(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkShapedImageNeighborhoodRange.h:466
itk::ShapedImageNeighborhoodRange::ImageRegionType
typename TImage::RegionType ImageRegionType
Definition: itkShapedImageNeighborhoodRange.h:142
itk::ShapedImageNeighborhoodRange::const_iterator
QualifiedIterator< true > const_iterator
Definition: itkShapedImageNeighborhoodRange.h:646
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator+
friend QualifiedIterator operator+(const difference_type n, QualifiedIterator it) noexcept
Definition: itkShapedImageNeighborhoodRange.h:567
itk::ShapedImageNeighborhoodRange::m_NeighborhoodAccessor
NeighborhoodAccessorFunctorType m_NeighborhoodAccessor
Definition: itkShapedImageNeighborhoodRange.h:630
itk::ShapedImageNeighborhoodRange::PixelType
typename TImage::PixelType PixelType
Definition: itkShapedImageNeighborhoodRange.h:143
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator!=
friend bool operator!=(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkShapedImageNeighborhoodRange.h:479
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::ShapedImageNeighborhoodRange::SetLocation
void SetLocation(const IndexType &location) noexcept
Definition: itkShapedImageNeighborhoodRange.h:814
itk::ShapedImageNeighborhoodRange::PixelProxy< false, TDummy >::m_ImageBufferPointer
InternalPixelType *const m_ImageBufferPointer
Definition: itkShapedImageNeighborhoodRange.h:216
itk::ShapedImageNeighborhoodRange::reverse_iterator
std::reverse_iterator< iterator > reverse_iterator
Definition: itkShapedImageNeighborhoodRange.h:648
itk::ShapedImageNeighborhoodRange::PixelProxy< true, TDummy >::PixelProxy
PixelProxy(const PixelProxy< false > &pixelProxy) noexcept
Definition: itkShapedImageNeighborhoodRange.h:195
itk::ShapedImageNeighborhoodRange::QualifiedIterator::QualifiedIterator
QualifiedIterator()=default
itk::ShapedImageNeighborhoodRange::cbegin
const_iterator cbegin() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:738
itk::ShapedImageNeighborhoodRange::RegionData
Definition: itkShapedImageNeighborhoodRange.h:596
itk::ShapedImageNeighborhoodRange::CheckPolicy::Test
static int Test(typename T::PixelAccessParameterType *)
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator-
friend difference_type operator-(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkShapedImageNeighborhoodRange.h:546
itk::ShapedImageNeighborhoodRange::m_OptionalPixelAccessParameter
OptionalPixelAccessParameterType m_OptionalPixelAccessParameter
Definition: itkShapedImageNeighborhoodRange.h:643
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator<
friend bool operator<(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkShapedImageNeighborhoodRange.h:488
itk::IndexValueType
long IndexValueType
Definition: itkIntTypes.h:90
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator-
friend QualifiedIterator operator-(QualifiedIterator it, const difference_type n) noexcept
Definition: itkShapedImageNeighborhoodRange.h:575
itk::ShapedImageNeighborhoodRange::PixelProxy< false, TDummy >::swap
friend void swap(PixelProxy lhs, PixelProxy rhs) noexcept
Definition: itkShapedImageNeighborhoodRange.h:260
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator=
QualifiedIterator & operator=(const QualifiedIterator &) noexcept=default
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ShapedImageNeighborhoodRange::PixelProxy< false, TDummy >::m_PixelAccessPolicy
const TImageNeighborhoodPixelAccessPolicy m_PixelAccessPolicy
Definition: itkShapedImageNeighborhoodRange.h:219
itk::ShapedImageNeighborhoodRange::CheckPolicy::HasPixelAccessParameterType
static constexpr bool HasPixelAccessParameterType
Definition: itkShapedImageNeighborhoodRange.h:118
itk::ShapedImageNeighborhoodRange::QualifiedIterator::m_RelativeLocation
IndexType m_RelativeLocation
Definition: itkShapedImageNeighborhoodRange.h:324
itk::ShapedImageNeighborhoodRange::PixelProxy< true, TDummy >::m_PixelAccessPolicy
const TImageNeighborhoodPixelAccessPolicy m_PixelAccessPolicy
Definition: itkShapedImageNeighborhoodRange.h:175
itk::ShapedImageNeighborhoodRange::QualifiedIterator::m_OptionalPixelAccessParameter
OptionalPixelAccessParameterType m_OptionalPixelAccessParameter
Definition: itkShapedImageNeighborhoodRange.h:318
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator*
reference operator*() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:409
itk::ShapedImageNeighborhoodRange::PixelProxy< false, TDummy >::operator=
PixelProxy & operator=(const PixelProxy &pixelProxy) noexcept
Definition: itkShapedImageNeighborhoodRange.h:249
itk::ShapedImageNeighborhoodRange::PixelProxy< true, TDummy >::m_ImageBufferPointer
const InternalPixelType *const m_ImageBufferPointer
Definition: itkShapedImageNeighborhoodRange.h:172
itk::ShapedImageNeighborhoodRange::m_ShapeOffsets
const OffsetType * m_ShapeOffsets
Definition: itkShapedImageNeighborhoodRange.h:638
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator+=
friend QualifiedIterator & operator+=(QualifiedIterator &it, const difference_type n) noexcept
Definition: itkShapedImageNeighborhoodRange.h:528
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator>
friend bool operator>(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkShapedImageNeighborhoodRange.h:501
itk::ShapedImageNeighborhoodRange::NeighborhoodAccessorFunctorType
typename TImage::NeighborhoodAccessorFunctorType NeighborhoodAccessorFunctorType
Definition: itkShapedImageNeighborhoodRange.h:145
itk::ShapedImageNeighborhoodRange::QualifiedIterator
Definition: itkShapedImageNeighborhoodRange.h:285
itk::ShapedImageNeighborhoodRange::ImageSizeValueType
typename TImage::SizeValueType ImageSizeValueType
Definition: itkShapedImageNeighborhoodRange.h:141
itk::ShapedImageNeighborhoodRange::m_ImageBufferPointer
QualifiedInternalPixelType * m_ImageBufferPointer
Definition: itkShapedImageNeighborhoodRange.h:622
itk::ShapedImageNeighborhoodRange::m_OffsetTable
OffsetType m_OffsetTable
Definition: itkShapedImageNeighborhoodRange.h:628
itk::ShapedImageNeighborhoodRange::PixelProxy
Definition: itkShapedImageNeighborhoodRange.h:162
itk::ShapedImageNeighborhoodRange::QualifiedIterator::IsImageTypeConst
static constexpr bool IsImageTypeConst
Definition: itkShapedImageNeighborhoodRange.h:299
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ShapedImageNeighborhoodRange::QualifiedIterator::QualifiedIterator
QualifiedIterator(const QualifiedIterator< false > &arg) noexcept
Definition: itkShapedImageNeighborhoodRange.h:393
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator--
QualifiedIterator & operator--() noexcept
Definition: itkShapedImageNeighborhoodRange.h:441
itk::ShapedImageNeighborhoodRange::QualifiedIterator::difference_type
ptrdiff_t difference_type
Definition: itkShapedImageNeighborhoodRange.h:372
itk::ShapedImageNeighborhoodRange::RegionData::RegionData
RegionData() noexcept=default
itk::ShapedImageNeighborhoodRange::size
vcl_size_t size() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:781
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator<=
friend bool operator<=(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkShapedImageNeighborhoodRange.h:510
itk::OffsetValueType
long OffsetValueType
Definition: itkIntTypes.h:94
itk::ShapedImageNeighborhoodRange::rend
reverse_iterator rend() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:759
itkIndex.h
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator++
QualifiedIterator & operator++() noexcept
Definition: itkShapedImageNeighborhoodRange.h:418
itk::ShapedImageNeighborhoodRange::QualifiedIterator::m_ImageBufferPointer
QualifiedInternalPixelType * m_ImageBufferPointer
Definition: itkShapedImageNeighborhoodRange.h:307
itk::Offset< ImageDimension >
itk::ShapedImageNeighborhoodRange::const_reverse_iterator
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition: itkShapedImageNeighborhoodRange.h:649
itk::ShapedImageNeighborhoodRange::QualifiedIterator::m_ImageSize
ImageSizeType m_ImageSize
Definition: itkShapedImageNeighborhoodRange.h:310
itk::ShapedImageNeighborhoodRange::SubtractIndex
void SubtractIndex(IndexType &index1, const IndexType &index2)
Definition: itkShapedImageNeighborhoodRange.h:611
itk::ShapedImageNeighborhoodRange::ImageType
TImage ImageType
Definition: itkShapedImageNeighborhoodRange.h:138
itk::ShapedImageNeighborhoodRange::QualifiedInternalPixelType
std::conditional_t< IsImageTypeConst, const InternalPixelType, InternalPixelType > QualifiedInternalPixelType
Definition: itkShapedImageNeighborhoodRange.h:592
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator>=
friend bool operator>=(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkShapedImageNeighborhoodRange.h:519
itk::ShapedImageNeighborhoodRange::iterator
QualifiedIterator< IsImageTypeConst > iterator
Definition: itkShapedImageNeighborhoodRange.h:647
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator-=
friend QualifiedIterator & operator-=(QualifiedIterator &it, const difference_type n) noexcept
Definition: itkShapedImageNeighborhoodRange.h:537
itk::ShapedImageNeighborhoodRange::ShapedImageNeighborhoodRange
ShapedImageNeighborhoodRange(ImageType &image, const IndexType &location, const TContainerOfOffsets &shapeOffsets, const OptionalPixelAccessParameterType optionalPixelAccessParameter={})
Definition: itkShapedImageNeighborhoodRange.h:702
itk::ShapedImageNeighborhoodRange::empty
bool empty() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:789
itk::ShapedImageNeighborhoodRange::ShapedImageNeighborhoodRange
ShapedImageNeighborhoodRange()=default
itk::ShapedImageNeighborhoodRange::OptionalPixelAccessParameterType
typename OptionalPixelAccessParameter< TImageNeighborhoodPixelAccessPolicy >::Type OptionalPixelAccessParameterType
Definition: itkShapedImageNeighborhoodRange.h:151
itk::ShapedImageNeighborhoodRange::OptionalPixelAccessParameter
Definition: itkShapedImageNeighborhoodRange.h:125
itk::ShapedImageNeighborhoodRange::QualifiedIterator::CreatePixelAccessPolicy
TImageNeighborhoodPixelAccessPolicy CreatePixelAccessPolicy(EmptyPixelAccessParameter) const
Definition: itkShapedImageNeighborhoodRange.h:350
itk::ShapedImageNeighborhoodRange::QualifiedIterator::CreatePixelAccessPolicy
TImageNeighborhoodPixelAccessPolicy CreatePixelAccessPolicy(const TPixelAccessParameter pixelAccessParameter) const
Definition: itkShapedImageNeighborhoodRange.h:359
itk::ShapedImageNeighborhoodRange::QualifiedIterator::iterator_category
std::random_access_iterator_tag iterator_category
Definition: itkShapedImageNeighborhoodRange.h:376
itk::ShapedImageNeighborhoodRange::QualifiedIterator::m_NeighborhoodAccessor
NeighborhoodAccessorFunctorType m_NeighborhoodAccessor
Definition: itkShapedImageNeighborhoodRange.h:316
itk::ShapedImageNeighborhoodRange::ImageDimensionType
typename TImage::ImageDimensionType ImageDimensionType
Definition: itkShapedImageNeighborhoodRange.h:139
itk::ShapedImageNeighborhoodRange::IndexType
typename TImage::IndexType IndexType
Definition: itkShapedImageNeighborhoodRange.h:147
itk::ShapedImageNeighborhoodRange::rbegin
reverse_iterator rbegin() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:752
itk::ShapedImageNeighborhoodRange::end
iterator end() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:724
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator[]
reference operator[](const difference_type n) const noexcept
Definition: itkShapedImageNeighborhoodRange.h:582
itk::ShapedImageNeighborhoodRange::PixelProxy< true, TDummy >::PixelProxy
PixelProxy(const InternalPixelType *const imageBufferPointer, const TImageNeighborhoodPixelAccessPolicy &pixelAccessPolicy) noexcept
Definition: itkShapedImageNeighborhoodRange.h:188
itk::ShapedImageNeighborhoodRange::QualifiedIterator::QualifiedImageType
std::conditional_t< VIsConst, const ImageType, ImageType > QualifiedImageType
Definition: itkShapedImageNeighborhoodRange.h:297
itk::ShapedImageNeighborhoodRange::QualifiedIterator::m_CurrentOffset
const OffsetType * m_CurrentOffset
Definition: itkShapedImageNeighborhoodRange.h:326
itk::ShapedImageNeighborhoodRange::m_NumberOfNeighborhoodPixels
vcl_size_t m_NumberOfNeighborhoodPixels
Definition: itkShapedImageNeighborhoodRange.h:641
itk::ShapedImageNeighborhoodRange::ImageDimension
static constexpr ImageDimensionType ImageDimension
Definition: itkShapedImageNeighborhoodRange.h:146
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator+
friend QualifiedIterator operator+(QualifiedIterator it, const difference_type n) noexcept
Definition: itkShapedImageNeighborhoodRange.h:559
itk::ShapedImageNeighborhoodRange::OptionalPixelAccessParameter< TImageNeighborhoodPixelAccessPolicy >::Type
typename TImageNeighborhoodPixelAccessPolicy ::PixelAccessParameterType Type
Definition: itkShapedImageNeighborhoodRange.h:127
itk::ShapedImageNeighborhoodRange
Definition: itkShapedImageNeighborhoodRange.h:92
itk::ShapedImageNeighborhoodRange::InternalPixelType
typename TImage::InternalPixelType InternalPixelType
Definition: itkShapedImageNeighborhoodRange.h:144
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:83
itkSize.h
itk::ShapedImageNeighborhoodRange::EmptyPixelAccessParameter
Definition: itkShapedImageNeighborhoodRange.h:96
itk::ShapedImageNeighborhoodRange::ShapedImageNeighborhoodRange
ShapedImageNeighborhoodRange(ImageType &image, const IndexType &location, const OffsetType *const shapeOffsets, const vcl_size_t numberOfNeigborhoodPixels, const OptionalPixelAccessParameterType optionalPixelAccessParameter={})
Definition: itkShapedImageNeighborhoodRange.h:665