ITK  5.2.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  * http://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 &) ITK_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) ITK_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) ITK_NOEXCEPT
196  : m_ImageBufferPointer{ pixelProxy.m_ImageBufferPointer }
197  , m_PixelAccessPolicy{ pixelProxy.m_PixelAccessPolicy }
198  {}
199 
200  // Conversion operator.
201  operator PixelType() const ITK_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 &) ITK_NOEXCEPT = default;
228 
229  // Constructor, called directly by operator*() of the iterator class.
230  PixelProxy(InternalPixelType * const imageBufferPointer,
231  const TImageNeighborhoodPixelAccessPolicy & pixelAccessPolicy) ITK_NOEXCEPT
232  : m_ImageBufferPointer{ imageBufferPointer }
233  , m_PixelAccessPolicy{ pixelAccessPolicy }
234  {}
235 
236  // Conversion operator.
237  operator PixelType() const ITK_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) ITK_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) ITK_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) ITK_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 = typename std::conditional<VIsConst, const ImageType, ImageType>::type;
298 
299  static constexpr bool IsImageTypeConst = std::is_const<QualifiedImageType>::value;
300 
302  typename std::conditional<IsImageTypeConst, const InternalPixelType, InternalPixelType>::type;
303 
304  // Pixel type class that is either 'const' or non-const qualified, depending on QualifiedImageType.
305  using QualifiedPixelType = typename std::conditional<IsImageTypeConst, const PixelType, PixelType>::type;
306 
307  // Pointer to the buffer of the image. Only null when the iterator is default-constructed.
309 
310  // Image size.
312 
313  // A copy of the offset table of the image.
315 
316  // The accessor of the image.
318 
320 
321  // The pixel coordinates of the location of the neighborhood, relative to
322  // the index of the first pixel of the buffered region. Note that this
323  // location does not have to be within buffered region. It may also be
324  // outside the image.
326 
327  const OffsetType * m_CurrentOffset = nullptr;
328 
329  // Private constructor, used to create the begin and the end iterator of a range.
330  // Only used by its friend class ShapedImageNeighborhoodRange.
331  QualifiedIterator(QualifiedInternalPixelType * const imageBufferPointer,
332  const ImageSizeType & imageSize,
333  const OffsetType & offsetTable,
334  const NeighborhoodAccessorFunctorType & neighborhoodAccessor,
335  const OptionalPixelAccessParameterType optionalPixelAccessParameter,
336  const IndexType & relativeLocation,
337  const OffsetType * const offset) ITK_NOEXCEPT
338  : m_ImageBufferPointer{ imageBufferPointer }
339  ,
340  // Note: Use parentheses instead of curly braces to initialize data members,
341  // to avoid AppleClang 6.0.0.6000056 compilation error, "no viable conversion..."
342  m_ImageSize(imageSize)
343  , m_OffsetTable(offsetTable)
344  , m_NeighborhoodAccessor(neighborhoodAccessor)
345  , m_OptionalPixelAccessParameter(optionalPixelAccessParameter)
346  , m_RelativeLocation(relativeLocation)
347  , m_CurrentOffset{ offset }
348  {}
349 
350 
351  TImageNeighborhoodPixelAccessPolicy CreatePixelAccessPolicy(EmptyPixelAccessParameter) const
352  {
353  return TImageNeighborhoodPixelAccessPolicy{
355  };
356  }
357 
358  template <typename TPixelAccessParameter>
359  TImageNeighborhoodPixelAccessPolicy
360  CreatePixelAccessPolicy(const TPixelAccessParameter pixelAccessParameter) const
361  {
362  static_assert(std::is_same<TPixelAccessParameter, OptionalPixelAccessParameterType>::value,
363  "This helper function should only be used for OptionalPixelAccessParameterType!");
364  static_assert(!std::is_same<TPixelAccessParameter, EmptyPixelAccessParameter>::value,
365  "EmptyPixelAccessParameter indicates that there is no pixel access parameter specified!");
366  return TImageNeighborhoodPixelAccessPolicy{
368  };
369  }
370 
371  public:
372  // Types conforming the iterator requirements of the C++ standard library:
373  using difference_type = std::ptrdiff_t;
377  using iterator_category = std::random_access_iterator_tag;
378 
379 
390  QualifiedIterator() = default;
391 
394  QualifiedIterator(const QualifiedIterator<false> & arg) ITK_NOEXCEPT
395  : m_ImageBufferPointer{ arg.m_ImageBufferPointer }
396  ,
397  // Note: Use parentheses instead of curly braces to initialize data members,
398  // to avoid AppleClang 6.0.0.6000056 compilation error, "no viable conversion..."
399  m_ImageSize(arg.m_ImageSize)
400  , m_OffsetTable(arg.m_OffsetTable)
401  , m_NeighborhoodAccessor(arg.m_NeighborhoodAccessor)
402  , m_OptionalPixelAccessParameter(arg.m_OptionalPixelAccessParameter)
403  , m_RelativeLocation(arg.m_RelativeLocation)
404  , m_CurrentOffset{ arg.m_CurrentOffset }
405  {}
407 
408 
410  reference operator*() const ITK_NOEXCEPT
411  {
413  }
415 
416 
419  operator++() ITK_NOEXCEPT
420  {
421  assert(m_CurrentOffset != nullptr);
422  ++m_CurrentOffset;
423  return *this;
424  }
426 
427 
431  operator++(int) ITK_NOEXCEPT
432  {
433  auto result = *this;
434  ++(*this);
435  return result;
436  }
438 
439 
442  operator--() ITK_NOEXCEPT
443  {
444  assert(m_CurrentOffset != nullptr);
445  --m_CurrentOffset;
446  return *this;
447  }
449 
450 
454  operator--(int) ITK_NOEXCEPT
455  {
456  auto result = *this;
457  --(*this);
458  return result;
459  }
461 
462 
466  friend bool
467  operator==(const QualifiedIterator & lhs, const QualifiedIterator & rhs) ITK_NOEXCEPT
468  {
469  assert(lhs.m_ImageBufferPointer == rhs.m_ImageBufferPointer);
470  assert(lhs.m_ImageSize == rhs.m_ImageSize);
471  assert(lhs.m_OffsetTable == rhs.m_OffsetTable);
473 
474  return lhs.m_CurrentOffset == rhs.m_CurrentOffset;
475  }
476 
477 
479  friend bool
480  operator!=(const QualifiedIterator & lhs, const QualifiedIterator & rhs) ITK_NOEXCEPT
481  {
482  // Implemented just like the corresponding std::rel_ops operator.
483  return !(lhs == rhs);
484  }
485 
486 
488  friend bool
489  operator<(const QualifiedIterator & lhs, const QualifiedIterator & rhs) ITK_NOEXCEPT
490  {
491  assert(lhs.m_ImageBufferPointer == rhs.m_ImageBufferPointer);
492  assert(lhs.m_ImageSize == rhs.m_ImageSize);
493  assert(lhs.m_OffsetTable == rhs.m_OffsetTable);
495 
496  return lhs.m_CurrentOffset < rhs.m_CurrentOffset;
497  }
498 
499 
501  friend bool
502  operator>(const QualifiedIterator & lhs, const QualifiedIterator & rhs) ITK_NOEXCEPT
503  {
504  // Implemented just like the corresponding std::rel_ops operator.
505  return rhs < lhs;
506  }
507 
508 
510  friend bool
511  operator<=(const QualifiedIterator & lhs, const QualifiedIterator & rhs) ITK_NOEXCEPT
512  {
513  // Implemented just like the corresponding std::rel_ops operator.
514  return !(rhs < lhs);
515  }
516 
517 
519  friend bool
520  operator>=(const QualifiedIterator & lhs, const QualifiedIterator & rhs) ITK_NOEXCEPT
521  {
522  // Implemented just like the corresponding std::rel_ops operator.
523  return !(lhs < rhs);
524  }
525 
526 
528  friend QualifiedIterator &
529  operator+=(QualifiedIterator & it, const difference_type n) ITK_NOEXCEPT
530  {
531  it.m_CurrentOffset += n;
532  return it;
533  }
535 
537  friend QualifiedIterator &
538  operator-=(QualifiedIterator & it, const difference_type n) ITK_NOEXCEPT
539  {
540  it += (-n);
541  return it;
542  }
544 
546  friend difference_type
547  operator-(const QualifiedIterator & lhs, const QualifiedIterator & rhs) ITK_NOEXCEPT
548  {
549  assert(lhs.m_ImageBufferPointer == rhs.m_ImageBufferPointer);
550  assert(lhs.m_ImageSize == rhs.m_ImageSize);
551  assert(lhs.m_OffsetTable == rhs.m_OffsetTable);
553 
554  return lhs.m_CurrentOffset - rhs.m_CurrentOffset;
555  }
556 
557 
559  friend QualifiedIterator
560  operator+(QualifiedIterator it, const difference_type n) ITK_NOEXCEPT
561  {
562  return it += n;
563  }
564 
565 
567  friend QualifiedIterator
568  operator+(const difference_type n, QualifiedIterator it) ITK_NOEXCEPT
569  {
570  return it += n;
571  }
572 
573 
575  friend QualifiedIterator
576  operator-(QualifiedIterator it, const difference_type n) ITK_NOEXCEPT
577  {
578  return it += (-n);
579  }
580 
581 
583  reference operator[](const difference_type n) const ITK_NOEXCEPT { return *(*this + n); }
584 
585 
588  operator=(const QualifiedIterator &) ITK_NOEXCEPT = default;
589  };
590 
591  static constexpr bool IsImageTypeConst = std::is_const<TImage>::value;
592 
594  typename std::conditional<IsImageTypeConst, const InternalPixelType, InternalPixelType>::type;
595 
596 
597  // Just the data from itk::ImageRegion (not the virtual table)
598  struct RegionData
599  {
602 
603  RegionData() ITK_NOEXCEPT = default;
604 
605  explicit RegionData(const ImageRegionType & imageRegion)
606  : m_Index(imageRegion.GetIndex())
607  , m_Size(imageRegion.GetSize())
608  {}
609  };
610 
611 
612  void
613  SubtractIndex(IndexType & index1, const IndexType & index2)
614  {
615  for (unsigned i = 0; i < ImageDimension; ++i)
616  {
617  index1[i] -= index2[i];
618  }
619  }
620 
621  // ShapedImageNeighborhoodRange data members (strictly private):
622 
623  // Pointer to the buffer of the image.
625 
626  // Index and size of the buffered image region.
628 
629  // A copy of the offset table of the image.
631 
633 
634  // Index (pixel coordinates) of the location of the neighborhood relative
635  // to the origin of the image. Typically it is the location of the
636  // center pixel of the neighborhood. It may be outside the image boundaries.
638 
639  // The offsets relative to m_RelativeLocation that specify the neighborhood shape.
640  const OffsetType * m_ShapeOffsets{ nullptr };
641 
642  // The number of neighborhood pixels.
644 
646 
647 public:
650  using reverse_iterator = std::reverse_iterator<iterator>;
651  using const_reverse_iterator = std::reverse_iterator<const_iterator>;
652 
658  ShapedImageNeighborhoodRange() = default;
659 
668  const IndexType & location,
669  const OffsetType * const shapeOffsets,
670  const std::size_t numberOfNeigborhoodPixels,
671  const OptionalPixelAccessParameterType optionalPixelAccessParameter = {})
672  : m_ImageBufferPointer{ image.ImageType::GetBufferPointer() }
673  ,
674  // Note: Use parentheses instead of curly braces to initialize data members,
675  // to avoid AppleClang 6.0.0.6000056 compile errors, "no viable conversion..."
676  // and "excess elements in struct initializer".
677  m_BufferedRegionData(image.ImageType::GetBufferedRegion())
678  , m_NeighborhoodAccessor(image.GetNeighborhoodAccessor())
679  , m_RelativeLocation(location)
680  , m_ShapeOffsets{ shapeOffsets }
681  , m_NumberOfNeighborhoodPixels{ numberOfNeigborhoodPixels }
682  , m_OptionalPixelAccessParameter(optionalPixelAccessParameter)
683  {
684  const OffsetValueType * const offsetTable = image.GetOffsetTable();
685  assert(offsetTable != nullptr);
687 
688  std::copy_n(offsetTable, ImageDimension, m_OffsetTable.begin());
689 
692  }
693 
703  template <typename TContainerOfOffsets>
705  const IndexType & location,
706  const TContainerOfOffsets & shapeOffsets,
707  const OptionalPixelAccessParameterType optionalPixelAccessParameter = {})
709  location,
710  shapeOffsets.data(),
711  shapeOffsets.size(),
712  optionalPixelAccessParameter }
713  {}
715 
717  iterator
718  begin() const ITK_NOEXCEPT
719  {
722  }
723 
725  iterator
726  end() const ITK_NOEXCEPT
727  {
735  }
736 
740  cbegin() const ITK_NOEXCEPT
741  {
742  return this->begin();
743  }
744 
747  cend() const ITK_NOEXCEPT
748  {
749  return this->end();
750  }
751 
754  rbegin() const ITK_NOEXCEPT
755  {
756  return reverse_iterator(this->end());
757  }
758 
761  rend() const ITK_NOEXCEPT
762  {
763  return reverse_iterator(this->begin());
764  }
765 
768  crbegin() const ITK_NOEXCEPT
769  {
770  return this->rbegin();
771  }
772 
775  crend() const ITK_NOEXCEPT
776  {
777  return this->rend();
778  }
779 
780 
782  std::size_t
783  size() const ITK_NOEXCEPT
784  {
786  }
787 
788 
790  bool
791  empty() const ITK_NOEXCEPT
792  {
793  return m_NumberOfNeighborhoodPixels == 0;
794  }
795 
796 
802  typename QualifiedIterator<false>::reference operator[](const std::size_t n) const ITK_NOEXCEPT
803  {
804  assert(n < this->size());
805  assert(n <= static_cast<std::size_t>(std::numeric_limits<std::ptrdiff_t>::max()));
807 
808  return this->begin()[static_cast<std::ptrdiff_t>(n)];
809  }
810 
811 
815  void
816  SetLocation(const IndexType & location) ITK_NOEXCEPT
817  {
818  m_RelativeLocation = location;
820  }
821 };
823 
824 } // namespace itk
825 
826 #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:331
itk::ShapedImageNeighborhoodRange::cend
const_iterator cend() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:747
itk::ShapedImageNeighborhoodRange::m_BufferedRegionData
RegionData m_BufferedRegionData
Definition: itkShapedImageNeighborhoodRange.h:627
itk::ShapedImageNeighborhoodRange::crbegin
const_reverse_iterator crbegin() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:768
itk::ShapedImageNeighborhoodRange::IndexValueType
typename TImage::IndexValueType IndexValueType
Definition: itkShapedImageNeighborhoodRange.h:148
itk::ShapedImageNeighborhoodRange::RegionData::m_Size
ImageSizeType m_Size
Definition: itkShapedImageNeighborhoodRange.h:601
itk::ShapedImageNeighborhoodRange::RegionData::m_Index
IndexType m_Index
Definition: itkShapedImageNeighborhoodRange.h:600
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::ShapedImageNeighborhoodRange::IsImageTypeConst
static constexpr bool IsImageTypeConst
Definition: itkShapedImageNeighborhoodRange.h:591
itk::ShapedImageNeighborhoodRange::QualifiedIterator::m_OffsetTable
OffsetType m_OffsetTable
Definition: itkShapedImageNeighborhoodRange.h:314
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator++
QualifiedIterator operator++(int) noexcept
Definition: itkShapedImageNeighborhoodRange.h:431
itk::ShapedImageNeighborhoodRange::crend
const_reverse_iterator crend() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:775
itk::ShapedImageNeighborhoodRange::QualifiedIterator::pointer
QualifiedPixelType * pointer
Definition: itkShapedImageNeighborhoodRange.h:376
itk::ShapedImageNeighborhoodRange::size
std::vcl_size_t size() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:783
itk::ShapedImageNeighborhoodRange::PixelProxy< false, TDummy >::operator=
PixelProxy & operator=(const PixelType &pixelValue) noexcept
Definition: itkShapedImageNeighborhoodRange.h:241
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator--
QualifiedIterator operator--(int) noexcept
Definition: itkShapedImageNeighborhoodRange.h:454
itkZeroFluxNeumannImageNeighborhoodPixelAccessPolicy.h
itk::ShapedImageNeighborhoodRange::begin
iterator begin() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:718
itk::ShapedImageNeighborhoodRange::QualifiedIterator::value_type
PixelType value_type
Definition: itkShapedImageNeighborhoodRange.h:374
itk::ShapedImageNeighborhoodRange::m_RelativeLocation
IndexType m_RelativeLocation
Definition: itkShapedImageNeighborhoodRange.h:637
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator==
friend bool operator==(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkShapedImageNeighborhoodRange.h:467
itk::ShapedImageNeighborhoodRange::ImageRegionType
typename TImage::RegionType ImageRegionType
Definition: itkShapedImageNeighborhoodRange.h:142
itk::ShapedImageNeighborhoodRange::const_iterator
QualifiedIterator< true > const_iterator
Definition: itkShapedImageNeighborhoodRange.h:648
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator+
friend QualifiedIterator operator+(const difference_type n, QualifiedIterator it) noexcept
Definition: itkShapedImageNeighborhoodRange.h:568
itk::ShapedImageNeighborhoodRange::m_NeighborhoodAccessor
NeighborhoodAccessorFunctorType m_NeighborhoodAccessor
Definition: itkShapedImageNeighborhoodRange.h:632
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:480
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::ShapedImageNeighborhoodRange::QualifiedIterator::QualifiedPixelType
typename std::conditional< IsImageTypeConst, const PixelType, PixelType >::type QualifiedPixelType
Definition: itkShapedImageNeighborhoodRange.h:305
itk::ShapedImageNeighborhoodRange::SetLocation
void SetLocation(const IndexType &location) noexcept
Definition: itkShapedImageNeighborhoodRange.h:816
itk::ShapedImageNeighborhoodRange::m_NumberOfNeighborhoodPixels
std::vcl_size_t m_NumberOfNeighborhoodPixels
Definition: itkShapedImageNeighborhoodRange.h:643
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:650
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:740
itk::ShapedImageNeighborhoodRange::RegionData
Definition: itkShapedImageNeighborhoodRange.h:598
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:547
itk::ShapedImageNeighborhoodRange::m_OptionalPixelAccessParameter
OptionalPixelAccessParameterType m_OptionalPixelAccessParameter
Definition: itkShapedImageNeighborhoodRange.h:645
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator<
friend bool operator<(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkShapedImageNeighborhoodRange.h:489
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator-
friend QualifiedIterator operator-(QualifiedIterator it, const difference_type n) noexcept
Definition: itkShapedImageNeighborhoodRange.h:576
itk::ShapedImageNeighborhoodRange::operator[]
QualifiedIterator< false >::reference operator[](const std::vcl_size_t n) const noexcept
Definition: itkShapedImageNeighborhoodRange.h:802
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:325
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:319
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator*
reference operator*() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:410
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::QualifiedIterator::difference_type
std::ptrdiff_t difference_type
Definition: itkShapedImageNeighborhoodRange.h:373
itk::ShapedImageNeighborhoodRange::m_ShapeOffsets
const OffsetType * m_ShapeOffsets
Definition: itkShapedImageNeighborhoodRange.h:640
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator+=
friend QualifiedIterator & operator+=(QualifiedIterator &it, const difference_type n) noexcept
Definition: itkShapedImageNeighborhoodRange.h:529
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator>
friend bool operator>(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkShapedImageNeighborhoodRange.h:502
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:624
itk::ShapedImageNeighborhoodRange::m_OffsetTable
OffsetType m_OffsetTable
Definition: itkShapedImageNeighborhoodRange.h:630
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:394
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator--
QualifiedIterator & operator--() noexcept
Definition: itkShapedImageNeighborhoodRange.h:442
itk::ShapedImageNeighborhoodRange::RegionData::RegionData
RegionData() noexcept=default
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator<=
friend bool operator<=(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkShapedImageNeighborhoodRange.h:511
itk::ShapedImageNeighborhoodRange::QualifiedIterator::QualifiedInternalPixelType
typename std::conditional< IsImageTypeConst, const InternalPixelType, InternalPixelType >::type QualifiedInternalPixelType
Definition: itkShapedImageNeighborhoodRange.h:302
itk::ShapedImageNeighborhoodRange::QualifiedInternalPixelType
typename std::conditional< IsImageTypeConst, const InternalPixelType, InternalPixelType >::type QualifiedInternalPixelType
Definition: itkShapedImageNeighborhoodRange.h:594
itk::ShapedImageNeighborhoodRange::rend
reverse_iterator rend() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:761
itkIndex.h
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator++
QualifiedIterator & operator++() noexcept
Definition: itkShapedImageNeighborhoodRange.h:419
itk::ShapedImageNeighborhoodRange::QualifiedIterator::m_ImageBufferPointer
QualifiedInternalPixelType * m_ImageBufferPointer
Definition: itkShapedImageNeighborhoodRange.h:308
itk::Offset< ImageDimension >
itk::ShapedImageNeighborhoodRange::QualifiedIterator::QualifiedImageType
typename std::conditional< VIsConst, const ImageType, ImageType >::type QualifiedImageType
Definition: itkShapedImageNeighborhoodRange.h:297
itk::ShapedImageNeighborhoodRange::const_reverse_iterator
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition: itkShapedImageNeighborhoodRange.h:651
itk::ShapedImageNeighborhoodRange::QualifiedIterator::m_ImageSize
ImageSizeType m_ImageSize
Definition: itkShapedImageNeighborhoodRange.h:311
itk::ShapedImageNeighborhoodRange::SubtractIndex
void SubtractIndex(IndexType &index1, const IndexType &index2)
Definition: itkShapedImageNeighborhoodRange.h:613
itk::ShapedImageNeighborhoodRange::ImageType
TImage ImageType
Definition: itkShapedImageNeighborhoodRange.h:138
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:520
itk::OffsetValueType
signed long OffsetValueType
Definition: itkIntTypes.h:94
itk::ShapedImageNeighborhoodRange::iterator
QualifiedIterator< IsImageTypeConst > iterator
Definition: itkShapedImageNeighborhoodRange.h:649
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator-=
friend QualifiedIterator & operator-=(QualifiedIterator &it, const difference_type n) noexcept
Definition: itkShapedImageNeighborhoodRange.h:538
itk::ShapedImageNeighborhoodRange::ShapedImageNeighborhoodRange
ShapedImageNeighborhoodRange(ImageType &image, const IndexType &location, const TContainerOfOffsets &shapeOffsets, const OptionalPixelAccessParameterType optionalPixelAccessParameter={})
Definition: itkShapedImageNeighborhoodRange.h:704
itk::IndexValueType
signed long IndexValueType
Definition: itkIntTypes.h:90
itk::ShapedImageNeighborhoodRange::empty
bool empty() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:791
itk::ShapedImageNeighborhoodRange::ShapedImageNeighborhoodRange
ShapedImageNeighborhoodRange()=default
itk::ShapedImageNeighborhoodRange::OptionalPixelAccessParameterType
typename OptionalPixelAccessParameter< TImageNeighborhoodPixelAccessPolicy >::Type OptionalPixelAccessParameterType
Definition: itkShapedImageNeighborhoodRange.h:151
itk::Offset::begin
iterator begin()
Definition: itkOffset.h:311
itk::ShapedImageNeighborhoodRange::OptionalPixelAccessParameter
Definition: itkShapedImageNeighborhoodRange.h:125
itk::ShapedImageNeighborhoodRange::QualifiedIterator::CreatePixelAccessPolicy
TImageNeighborhoodPixelAccessPolicy CreatePixelAccessPolicy(EmptyPixelAccessParameter) const
Definition: itkShapedImageNeighborhoodRange.h:351
itk::ShapedImageNeighborhoodRange::QualifiedIterator::CreatePixelAccessPolicy
TImageNeighborhoodPixelAccessPolicy CreatePixelAccessPolicy(const TPixelAccessParameter pixelAccessParameter) const
Definition: itkShapedImageNeighborhoodRange.h:360
itk::ShapedImageNeighborhoodRange::QualifiedIterator::iterator_category
std::random_access_iterator_tag iterator_category
Definition: itkShapedImageNeighborhoodRange.h:377
itk::ShapedImageNeighborhoodRange::QualifiedIterator::m_NeighborhoodAccessor
NeighborhoodAccessorFunctorType m_NeighborhoodAccessor
Definition: itkShapedImageNeighborhoodRange.h:317
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:754
itk::ShapedImageNeighborhoodRange::end
iterator end() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:726
itk::ShapedImageNeighborhoodRange::QualifiedIterator::operator[]
reference operator[](const difference_type n) const noexcept
Definition: itkShapedImageNeighborhoodRange.h:583
itk::ShapedImageNeighborhoodRange::PixelProxy< true, TDummy >::PixelProxy
PixelProxy(const InternalPixelType *const imageBufferPointer, const TImageNeighborhoodPixelAccessPolicy &pixelAccessPolicy) noexcept
Definition: itkShapedImageNeighborhoodRange.h:188
itk::ShapedImageNeighborhoodRange::QualifiedIterator::m_CurrentOffset
const OffsetType * m_CurrentOffset
Definition: itkShapedImageNeighborhoodRange.h:327
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:560
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 std::vcl_size_t numberOfNeigborhoodPixels, const OptionalPixelAccessParameterType optionalPixelAccessParameter={})
Definition: itkShapedImageNeighborhoodRange.h:667