ITK  5.1.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 namespace Experimental
36 {
37 
92 template <typename TImage,
93  typename TImageNeighborhoodPixelAccessPolicy = ZeroFluxNeumannImageNeighborhoodPixelAccessPolicy<TImage>>
95 {
96 private:
97  // Empty struct, used internally to denote that there is no pixel access parameter specified.
99  {};
100 
101 
102  // Helper class to estimate whether the policy has nested type PixelAccessParameterType.
104  {
105  private:
106  // The Test function has two overloads whose return type is different.
107  // One of the overloads is only available for overload resolution when
108  // the policy T has a nested type PixelAccessParameterType (using SFINAE).
109 
110  template <typename T>
111  static int
112  Test(typename T::PixelAccessParameterType *);
113 
114  template <typename T>
115  static void
116  Test(...);
117 
118  public:
119  // This constant tells whether the policy has a PixelAccessParameterType:
120  static constexpr bool HasPixelAccessParameterType =
121  !std::is_same<decltype(Test<TImageNeighborhoodPixelAccessPolicy>(nullptr)),
122  decltype(Test<TImageNeighborhoodPixelAccessPolicy>())>::value;
123  };
124 
125 
126  template <typename TPolicy, bool VPolicyHasPixelAccessParameterType = CheckPolicy::HasPixelAccessParameterType>
128  {
129  using Type = typename TPolicy::PixelAccessParameterType;
130  };
131 
132  // Specialization for when the policy does not have PixelAccessParameterType.
133  template <typename TPolicy>
134  struct OptionalPixelAccessParameter<TPolicy, false>
135  {
137  };
138 
139 
140  using ImageType = TImage;
141  using ImageDimensionType = typename TImage::ImageDimensionType;
142  using ImageSizeType = typename TImage::SizeType;
145  using PixelType = typename TImage::PixelType;
146  using InternalPixelType = typename TImage::InternalPixelType;
147  using NeighborhoodAccessorFunctorType = typename TImage::NeighborhoodAccessorFunctorType;
148  static constexpr ImageDimensionType ImageDimension = TImage::ImageDimension;
149  using IndexType = typename TImage::IndexType;
154 
155 
156  // PixelProxy: internal class that aims to act like a reference to a pixel:
157  // It acts either like 'PixelType &' or like 'const PixelType &', depending
158  // on its boolean template argument, VIsConst.
159  // The proxy retrieves the pixel value using a ImageNeighborhoodPixelAccessPolicy.
160  // Note: the extra TDummy argument aims to fix AppleClang 6.0.0.6000056 error
161  // "explicit specialization of 'PixelProxy'"and GCC 5.4.0 error "explicit
162  // specialization in non-namespace scope".
163  template <bool VIsConst, typename TDummy = void>
165  {};
166 
167  // PixelProxy specialization for const pixel types:
168  // acts like 'const PixelType &'
169  template <typename TDummy>
170  class PixelProxy<true, TDummy> final
171  {
172  private:
173  // Pointer to the buffer of the image. Should not be null.
175 
176  // Pixel access policy.
177  const TImageNeighborhoodPixelAccessPolicy m_PixelAccessPolicy;
178 
179  public:
180  // Deleted member functions:
181  PixelProxy() = delete;
182  PixelProxy &
183  operator=(const PixelProxy &) = delete;
184 
185  // Explicitly-defaulted member functions:
186  PixelProxy(const PixelProxy &) ITK_NOEXCEPT = default;
187  ~PixelProxy() = default;
188 
189  // Constructor, called directly by operator*() of the iterator class.
190  PixelProxy(const InternalPixelType * const imageBufferPointer,
191  const TImageNeighborhoodPixelAccessPolicy & pixelAccessPolicy) ITK_NOEXCEPT
192  : m_ImageBufferPointer{ imageBufferPointer }
193  , m_PixelAccessPolicy{ pixelAccessPolicy }
194  {}
195 
196  // Allows implicit conversion from non-const to const proxy.
197  PixelProxy(const PixelProxy<false> & pixelProxy) ITK_NOEXCEPT
198  : m_ImageBufferPointer{ pixelProxy.m_ImageBufferPointer }
199  , m_PixelAccessPolicy{ pixelProxy.m_PixelAccessPolicy }
200  {}
201 
202  // Conversion operator.
203  operator PixelType() const ITK_NOEXCEPT { return m_PixelAccessPolicy.GetPixelValue(m_ImageBufferPointer); }
204  };
205 
206 
207  // PixelProxy specialization for non-const pixel types:
208  // acts like 'PixelType &'.
209  template <typename TDummy>
210  class PixelProxy<false, TDummy> final
211  {
212  private:
213  // The const proxy is a friend, to ease implementing conversion from
214  // a non-const proxy to a const proxy.
215  friend class PixelProxy<true>;
216 
217  // Pointer to the buffer of the image. Should not be null.
219 
220  // Pixel access policy.
221  const TImageNeighborhoodPixelAccessPolicy m_PixelAccessPolicy;
222 
223  public:
224  // Deleted member functions:
225  PixelProxy() = delete;
226 
227  // Explicitly-defaulted member functions:
228  ~PixelProxy() = default;
229  PixelProxy(const PixelProxy &) ITK_NOEXCEPT = default;
230 
231  // Constructor, called directly by operator*() of the iterator class.
232  PixelProxy(InternalPixelType * const imageBufferPointer,
233  const TImageNeighborhoodPixelAccessPolicy & pixelAccessPolicy) ITK_NOEXCEPT
234  : m_ImageBufferPointer{ imageBufferPointer }
235  , m_PixelAccessPolicy{ pixelAccessPolicy }
236  {}
237 
238  // Conversion operator.
239  operator PixelType() const ITK_NOEXCEPT { return m_PixelAccessPolicy.GetPixelValue(m_ImageBufferPointer); }
240 
241  // Operator to assign a pixel value to the proxy.
242  PixelProxy &
243  operator=(const PixelType & pixelValue) ITK_NOEXCEPT
244  {
245  m_PixelAccessPolicy.SetPixelValue(m_ImageBufferPointer, pixelValue);
246  return *this;
247  }
248 
249  // Copy-assignment operator.
250  PixelProxy &
251  operator=(const PixelProxy & pixelProxy) ITK_NOEXCEPT
252  {
253  // Note that this assignment operator only copies the pixel value.
254  // That is the normal behavior when a reference is assigned to another.
255  const PixelType pixelValue = pixelProxy;
256  *this = pixelValue;
257  return *this;
258  }
259 
260 
261  friend void
262  swap(PixelProxy lhs, PixelProxy rhs) ITK_NOEXCEPT
263  {
264  const auto lhsPixelValue = lhs.m_PixelAccessPolicy.GetPixelValue(lhs.m_ImageBufferPointer);
265  const auto rhsPixelValue = rhs.m_PixelAccessPolicy.GetPixelValue(rhs.m_ImageBufferPointer);
266 
267  // Swap only the pixel values, not the image buffer pointers!
268  lhs.m_PixelAccessPolicy.SetPixelValue(lhs.m_ImageBufferPointer, rhsPixelValue);
269  rhs.m_PixelAccessPolicy.SetPixelValue(rhs.m_ImageBufferPointer, lhsPixelValue);
270  }
271  };
272 
273 
286  template <bool VIsConst>
287  class QualifiedIterator final
288  {
289  private:
290  // Const and non-const iterators are friends, in order to implement the
291  // constructor that allow conversion from non-const to const iterator.
292  friend class QualifiedIterator<!VIsConst>;
293 
294  // ShapedImageNeighborhoodRange is a friend, as it should be the only one that can
295  // directly use the private constructor of the iterator.
297 
298  // Image type class that is either 'const' or non-const qualified, depending on QualifiedIterator and TImage.
299  using QualifiedImageType = typename std::conditional<VIsConst, const ImageType, ImageType>::type;
300 
301  static constexpr bool IsImageTypeConst = std::is_const<QualifiedImageType>::value;
302 
304  typename std::conditional<IsImageTypeConst, const InternalPixelType, InternalPixelType>::type;
305 
306  // Pixel type class that is either 'const' or non-const qualified, depending on QualifiedImageType.
307  using QualifiedPixelType = typename std::conditional<IsImageTypeConst, const PixelType, PixelType>::type;
308 
309  // Pointer to the buffer of the image. Only null when the iterator is default-constructed.
311 
312  // Image size.
314 
315  // A copy of the offset table of the image.
317 
318  // The accessor of the image.
320 
322 
323  // The pixel coordinates of the location of the neighborhood, relative to
324  // the index of the first pixel of the buffered region. Note that this
325  // location does not have to be within buffered region. It may also be
326  // outside the image.
328 
329  const OffsetType * m_CurrentOffset = nullptr;
330 
331  // Private constructor, used to create the begin and the end iterator of a range.
332  // Only used by its friend class ShapedImageNeighborhoodRange.
333  QualifiedIterator(QualifiedInternalPixelType * const imageBufferPointer,
334  const ImageSizeType & imageSize,
335  const OffsetType & offsetTable,
336  const NeighborhoodAccessorFunctorType & neighborhoodAccessor,
337  const OptionalPixelAccessParameterType optionalPixelAccessParameter,
338  const IndexType & relativeLocation,
339  const OffsetType * const offset) ITK_NOEXCEPT
340  : m_ImageBufferPointer{ imageBufferPointer }
341  ,
342  // Note: Use parentheses instead of curly braces to initialize data members,
343  // to avoid AppleClang 6.0.0.6000056 compilation error, "no viable conversion..."
344  m_ImageSize(imageSize)
345  , m_OffsetTable(offsetTable)
346  , m_NeighborhoodAccessor(neighborhoodAccessor)
347  , m_OptionalPixelAccessParameter(optionalPixelAccessParameter)
348  , m_RelativeLocation(relativeLocation)
349  , m_CurrentOffset{ offset }
350  {}
351 
352 
353  TImageNeighborhoodPixelAccessPolicy CreatePixelAccessPolicy(EmptyPixelAccessParameter) const
354  {
355  return TImageNeighborhoodPixelAccessPolicy{
357  };
358  }
359 
360  template <typename TPixelAccessParameter>
361  TImageNeighborhoodPixelAccessPolicy
362  CreatePixelAccessPolicy(const TPixelAccessParameter pixelAccessParameter) const
363  {
364  static_assert(std::is_same<TPixelAccessParameter, OptionalPixelAccessParameterType>::value,
365  "This helper function should only be used for OptionalPixelAccessParameterType!");
366  static_assert(!std::is_same<TPixelAccessParameter, EmptyPixelAccessParameter>::value,
367  "EmptyPixelAccessParameter indicates that there is no pixel access parameter specified!");
368  return TImageNeighborhoodPixelAccessPolicy{
370  };
371  }
372 
373  public:
374  // Types conforming the iterator requirements of the C++ standard library:
375  using difference_type = std::ptrdiff_t;
379  using iterator_category = std::random_access_iterator_tag;
380 
381 
392  QualifiedIterator() = default;
393 
396  QualifiedIterator(const QualifiedIterator<false> & arg) ITK_NOEXCEPT
397  : m_ImageBufferPointer{ arg.m_ImageBufferPointer }
398  ,
399  // Note: Use parentheses instead of curly braces to initialize data members,
400  // to avoid AppleClang 6.0.0.6000056 compilation error, "no viable conversion..."
401  m_ImageSize(arg.m_ImageSize)
402  , m_OffsetTable(arg.m_OffsetTable)
403  , m_NeighborhoodAccessor(arg.m_NeighborhoodAccessor)
404  , m_OptionalPixelAccessParameter(arg.m_OptionalPixelAccessParameter)
405  , m_RelativeLocation(arg.m_RelativeLocation)
406  , m_CurrentOffset{ arg.m_CurrentOffset }
407  {}
409 
410 
412  reference operator*() const ITK_NOEXCEPT
413  {
415  }
417 
418 
421  operator++() ITK_NOEXCEPT
422  {
423  assert(m_CurrentOffset != nullptr);
424  ++m_CurrentOffset;
425  return *this;
426  }
428 
429 
433  operator++(int) ITK_NOEXCEPT
434  {
435  auto result = *this;
436  ++(*this);
437  return result;
438  }
440 
441 
444  operator--() ITK_NOEXCEPT
445  {
446  assert(m_CurrentOffset != nullptr);
447  --m_CurrentOffset;
448  return *this;
449  }
451 
452 
456  operator--(int) ITK_NOEXCEPT
457  {
458  auto result = *this;
459  --(*this);
460  return result;
461  }
463 
464 
468  friend bool
469  operator==(const QualifiedIterator & lhs, const QualifiedIterator & rhs) ITK_NOEXCEPT
470  {
471  assert(lhs.m_ImageBufferPointer == rhs.m_ImageBufferPointer);
472  assert(lhs.m_ImageSize == rhs.m_ImageSize);
473  assert(lhs.m_OffsetTable == rhs.m_OffsetTable);
475 
476  return lhs.m_CurrentOffset == rhs.m_CurrentOffset;
477  }
478 
479 
481  friend bool
482  operator!=(const QualifiedIterator & lhs, const QualifiedIterator & rhs) ITK_NOEXCEPT
483  {
484  // Implemented just like the corresponding std::rel_ops operator.
485  return !(lhs == rhs);
486  }
487 
488 
490  friend bool
491  operator<(const QualifiedIterator & lhs, const QualifiedIterator & rhs) ITK_NOEXCEPT
492  {
493  assert(lhs.m_ImageBufferPointer == rhs.m_ImageBufferPointer);
494  assert(lhs.m_ImageSize == rhs.m_ImageSize);
495  assert(lhs.m_OffsetTable == rhs.m_OffsetTable);
497 
498  return lhs.m_CurrentOffset < rhs.m_CurrentOffset;
499  }
500 
501 
503  friend bool
504  operator>(const QualifiedIterator & lhs, const QualifiedIterator & rhs) ITK_NOEXCEPT
505  {
506  // Implemented just like the corresponding std::rel_ops operator.
507  return rhs < lhs;
508  }
509 
510 
512  friend bool
513  operator<=(const QualifiedIterator & lhs, const QualifiedIterator & rhs) ITK_NOEXCEPT
514  {
515  // Implemented just like the corresponding std::rel_ops operator.
516  return !(rhs < lhs);
517  }
518 
519 
521  friend bool
522  operator>=(const QualifiedIterator & lhs, const QualifiedIterator & rhs) ITK_NOEXCEPT
523  {
524  // Implemented just like the corresponding std::rel_ops operator.
525  return !(lhs < rhs);
526  }
527 
528 
530  friend QualifiedIterator &
531  operator+=(QualifiedIterator & it, const difference_type n) ITK_NOEXCEPT
532  {
533  it.m_CurrentOffset += n;
534  return it;
535  }
537 
539  friend QualifiedIterator &
540  operator-=(QualifiedIterator & it, const difference_type n) ITK_NOEXCEPT
541  {
542  it += (-n);
543  return it;
544  }
546 
548  friend difference_type
549  operator-(const QualifiedIterator & lhs, const QualifiedIterator & rhs) ITK_NOEXCEPT
550  {
551  assert(lhs.m_ImageBufferPointer == rhs.m_ImageBufferPointer);
552  assert(lhs.m_ImageSize == rhs.m_ImageSize);
553  assert(lhs.m_OffsetTable == rhs.m_OffsetTable);
555 
556  return lhs.m_CurrentOffset - rhs.m_CurrentOffset;
557  }
558 
559 
561  friend QualifiedIterator
562  operator+(QualifiedIterator it, const difference_type n) ITK_NOEXCEPT
563  {
564  return it += n;
565  }
566 
567 
569  friend QualifiedIterator
570  operator+(const difference_type n, QualifiedIterator it) ITK_NOEXCEPT
571  {
572  return it += n;
573  }
574 
575 
577  friend QualifiedIterator
578  operator-(QualifiedIterator it, const difference_type n) ITK_NOEXCEPT
579  {
580  return it += (-n);
581  }
582 
583 
585  reference operator[](const difference_type n) const ITK_NOEXCEPT { return *(*this + n); }
586 
587 
590  operator=(const QualifiedIterator &) ITK_NOEXCEPT = default;
591  };
592 
593  static constexpr bool IsImageTypeConst = std::is_const<TImage>::value;
594 
596  typename std::conditional<IsImageTypeConst, const InternalPixelType, InternalPixelType>::type;
597 
598 
599  // Just the data from itk::ImageRegion (not the virtual table)
600  struct RegionData
601  {
604 
605  RegionData() ITK_NOEXCEPT = default;
606 
607  explicit RegionData(const ImageRegionType & imageRegion)
608  : m_Index(imageRegion.GetIndex())
609  , m_Size(imageRegion.GetSize())
610  {}
611  };
612 
613 
614  void
615  SubtractIndex(IndexType & index1, const IndexType & index2)
616  {
617  for (unsigned i = 0; i < ImageDimension; ++i)
618  {
619  index1[i] -= index2[i];
620  }
621  }
622 
623  // ShapedImageNeighborhoodRange data members (strictly private):
624 
625  // Pointer to the buffer of the image.
627 
628  // Index and size of the buffered image region.
630 
631  // A copy of the offset table of the image.
633 
635 
636  // Index (pixel coordinates) of the location of the neighborhood relative
637  // to the origin of the image. Typically it is the location of the
638  // center pixel of the neighborhood. It may be outside the image boundaries.
640 
641  // The offsets relative to m_RelativeLocation that specify the neighborhood shape.
642  const OffsetType * m_ShapeOffsets{ nullptr };
643 
644  // The number of neighborhood pixels.
646 
648 
649 public:
652  using reverse_iterator = std::reverse_iterator<iterator>;
653  using const_reverse_iterator = std::reverse_iterator<const_iterator>;
654 
660  ShapedImageNeighborhoodRange() = default;
661 
670  const IndexType & location,
671  const OffsetType * const shapeOffsets,
672  const std::size_t numberOfNeigborhoodPixels,
673  const OptionalPixelAccessParameterType optionalPixelAccessParameter = {})
674  : m_ImageBufferPointer{ image.ImageType::GetBufferPointer() }
675  ,
676  // Note: Use parentheses instead of curly braces to initialize data members,
677  // to avoid AppleClang 6.0.0.6000056 compile errors, "no viable conversion..."
678  // and "excess elements in struct initializer".
679  m_BufferedRegionData(image.ImageType::GetBufferedRegion())
680  , m_NeighborhoodAccessor(image.GetNeighborhoodAccessor())
681  , m_RelativeLocation(location)
682  , m_ShapeOffsets{ shapeOffsets }
683  , m_NumberOfNeighborhoodPixels{ numberOfNeigborhoodPixels }
684  , m_OptionalPixelAccessParameter(optionalPixelAccessParameter)
685  {
686  const OffsetValueType * const offsetTable = image.GetOffsetTable();
687  assert(offsetTable != nullptr);
689 
690  std::copy_n(offsetTable, ImageDimension, m_OffsetTable.begin());
691 
694  }
695 
705  template <typename TContainerOfOffsets>
707  const IndexType & location,
708  const TContainerOfOffsets & shapeOffsets,
709  const OptionalPixelAccessParameterType optionalPixelAccessParameter = {})
711  location,
712  shapeOffsets.data(),
713  shapeOffsets.size(),
714  optionalPixelAccessParameter }
715  {}
717 
719  iterator
720  begin() const ITK_NOEXCEPT
721  {
724  }
725 
727  iterator
728  end() const ITK_NOEXCEPT
729  {
737  }
738 
742  cbegin() const ITK_NOEXCEPT
743  {
744  return this->begin();
745  }
746 
749  cend() const ITK_NOEXCEPT
750  {
751  return this->end();
752  }
753 
756  rbegin() const ITK_NOEXCEPT
757  {
758  return reverse_iterator(this->end());
759  }
760 
763  rend() const ITK_NOEXCEPT
764  {
765  return reverse_iterator(this->begin());
766  }
767 
770  crbegin() const ITK_NOEXCEPT
771  {
772  return this->rbegin();
773  }
774 
777  crend() const ITK_NOEXCEPT
778  {
779  return this->rend();
780  }
781 
782 
784  std::size_t
785  size() const ITK_NOEXCEPT
786  {
788  }
789 
790 
792  bool
793  empty() const ITK_NOEXCEPT
794  {
795  return m_NumberOfNeighborhoodPixels == 0;
796  }
797 
798 
804  typename QualifiedIterator<false>::reference operator[](const std::size_t n) const ITK_NOEXCEPT
805  {
806  assert(n < this->size());
807  assert(n <= static_cast<std::size_t>(std::numeric_limits<std::ptrdiff_t>::max()));
809 
810  return this->begin()[static_cast<std::ptrdiff_t>(n)];
811  }
812 
813 
817  void
818  SetLocation(const IndexType & location) ITK_NOEXCEPT
819  {
820  m_RelativeLocation = location;
822  }
823 };
825 
826 
827 } // namespace Experimental
828 } // namespace itk
829 
830 #endif
itk::Experimental::ShapedImageNeighborhoodRange::rend
reverse_iterator rend() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:763
itk::Experimental::ShapedImageNeighborhoodRange::RegionData
Definition: itkShapedImageNeighborhoodRange.h:600
itk::Experimental::ShapedImageNeighborhoodRange::PixelProxy< false, TDummy >::m_PixelAccessPolicy
const TImageNeighborhoodPixelAccessPolicy m_PixelAccessPolicy
Definition: itkShapedImageNeighborhoodRange.h:221
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::m_OptionalPixelAccessParameter
OptionalPixelAccessParameterType m_OptionalPixelAccessParameter
Definition: itkShapedImageNeighborhoodRange.h:321
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::QualifiedIterator
QualifiedIterator()=default
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::operator++
QualifiedIterator & operator++() noexcept
Definition: itkShapedImageNeighborhoodRange.h:421
itk::Experimental::ShapedImageNeighborhoodRange::InternalPixelType
typename TImage::InternalPixelType InternalPixelType
Definition: itkShapedImageNeighborhoodRange.h:146
itk::Experimental::ShapedImageNeighborhoodRange::IndexValueType
typename TImage::IndexValueType IndexValueType
Definition: itkShapedImageNeighborhoodRange.h:150
itk::Experimental::ShapedImageNeighborhoodRange::ImageDimensionType
typename TImage::ImageDimensionType ImageDimensionType
Definition: itkShapedImageNeighborhoodRange.h:141
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::m_RelativeLocation
IndexType m_RelativeLocation
Definition: itkShapedImageNeighborhoodRange.h:327
itk::Experimental::ShapedImageNeighborhoodRange::begin
iterator begin() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:720
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedInternalPixelType
typename std::conditional< IsImageTypeConst, const InternalPixelType, InternalPixelType >::type QualifiedInternalPixelType
Definition: itkShapedImageNeighborhoodRange.h:596
itk::Experimental::ShapedImageNeighborhoodRange::ShapedImageNeighborhoodRange
ShapedImageNeighborhoodRange(ImageType &image, const IndexType &location, const OffsetType *const shapeOffsets, const std::vcl_size_t numberOfNeigborhoodPixels, const OptionalPixelAccessParameterType optionalPixelAccessParameter={})
Definition: itkShapedImageNeighborhoodRange.h:669
itk::Experimental::ShapedImageNeighborhoodRange::RegionData::m_Index
IndexType m_Index
Definition: itkShapedImageNeighborhoodRange.h:602
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::operator*
reference operator*() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:412
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator
Definition: itkShapedImageNeighborhoodRange.h:287
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::operator--
QualifiedIterator operator--(int) noexcept
Definition: itkShapedImageNeighborhoodRange.h:456
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::operator+=
friend QualifiedIterator & operator+=(QualifiedIterator &it, const difference_type n) noexcept
Definition: itkShapedImageNeighborhoodRange.h:531
itk::Experimental::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:333
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::operator-
friend QualifiedIterator operator-(QualifiedIterator it, const difference_type n) noexcept
Definition: itkShapedImageNeighborhoodRange.h:578
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::m_ImageSize
ImageSizeType m_ImageSize
Definition: itkShapedImageNeighborhoodRange.h:313
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::m_ImageBufferPointer
QualifiedInternalPixelType * m_ImageBufferPointer
Definition: itkShapedImageNeighborhoodRange.h:310
itk::Experimental::ShapedImageNeighborhoodRange::PixelType
typename TImage::PixelType PixelType
Definition: itkShapedImageNeighborhoodRange.h:145
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::operator=
QualifiedIterator & operator=(const QualifiedIterator &) noexcept=default
itk::Experimental::ShapedImageNeighborhoodRange::EmptyPixelAccessParameter
Definition: itkShapedImageNeighborhoodRange.h:98
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::m_NeighborhoodAccessor
NeighborhoodAccessorFunctorType m_NeighborhoodAccessor
Definition: itkShapedImageNeighborhoodRange.h:319
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::operator+
friend QualifiedIterator operator+(QualifiedIterator it, const difference_type n) noexcept
Definition: itkShapedImageNeighborhoodRange.h:562
itk::Experimental::ShapedImageNeighborhoodRange::CheckPolicy
Definition: itkShapedImageNeighborhoodRange.h:103
itkZeroFluxNeumannImageNeighborhoodPixelAccessPolicy.h
itk::Experimental::ShapedImageNeighborhoodRange::ImageDimension
static constexpr ImageDimensionType ImageDimension
Definition: itkShapedImageNeighborhoodRange.h:148
itk::Experimental::ShapedImageNeighborhoodRange::CheckPolicy::Test
static int Test(typename T::PixelAccessParameterType *)
itk::Experimental::ShapedImageNeighborhoodRange::OptionalPixelAccessParameter< TImageNeighborhoodPixelAccessPolicy >::Type
typename TImageNeighborhoodPixelAccessPolicy ::PixelAccessParameterType Type
Definition: itkShapedImageNeighborhoodRange.h:129
itk::Experimental::ShapedImageNeighborhoodRange::ImageSizeValueType
typename TImage::SizeValueType ImageSizeValueType
Definition: itkShapedImageNeighborhoodRange.h:143
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::operator==
friend bool operator==(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkShapedImageNeighborhoodRange.h:469
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::operator!=
friend bool operator!=(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkShapedImageNeighborhoodRange.h:482
itk::Experimental::ShapedImageNeighborhoodRange::m_NeighborhoodAccessor
NeighborhoodAccessorFunctorType m_NeighborhoodAccessor
Definition: itkShapedImageNeighborhoodRange.h:634
itk::Experimental::ShapedImageNeighborhoodRange::size
std::vcl_size_t size() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:785
itk::Experimental::ShapedImageNeighborhoodRange::operator[]
QualifiedIterator< false >::reference operator[](const std::vcl_size_t n) const noexcept
Definition: itkShapedImageNeighborhoodRange.h:804
itk::Experimental::ShapedImageNeighborhoodRange::ImageSizeType
typename TImage::SizeType ImageSizeType
Definition: itkShapedImageNeighborhoodRange.h:142
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::operator[]
reference operator[](const difference_type n) const noexcept
Definition: itkShapedImageNeighborhoodRange.h:585
itk::Experimental::ShapedImageNeighborhoodRange::reverse_iterator
std::reverse_iterator< iterator > reverse_iterator
Definition: itkShapedImageNeighborhoodRange.h:652
itk::Experimental::ShapedImageNeighborhoodRange::PixelProxy< false, TDummy >::m_ImageBufferPointer
InternalPixelType *const m_ImageBufferPointer
Definition: itkShapedImageNeighborhoodRange.h:218
itk::Experimental::ShapedImageNeighborhoodRange::ShapedImageNeighborhoodRange
ShapedImageNeighborhoodRange()=default
itk::Experimental::ShapedImageNeighborhoodRange::m_NumberOfNeighborhoodPixels
std::vcl_size_t m_NumberOfNeighborhoodPixels
Definition: itkShapedImageNeighborhoodRange.h:645
itk::Experimental::ShapedImageNeighborhoodRange::m_ImageBufferPointer
QualifiedInternalPixelType * m_ImageBufferPointer
Definition: itkShapedImageNeighborhoodRange.h:626
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::operator<=
friend bool operator<=(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkShapedImageNeighborhoodRange.h:513
itk::Experimental::ShapedImageNeighborhoodRange::PixelProxy< false, TDummy >::operator=
PixelProxy & operator=(const PixelType &pixelValue) noexcept
Definition: itkShapedImageNeighborhoodRange.h:243
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::QualifiedInternalPixelType
typename std::conditional< IsImageTypeConst, const InternalPixelType, InternalPixelType >::type QualifiedInternalPixelType
Definition: itkShapedImageNeighborhoodRange.h:304
itk::Experimental::ShapedImageNeighborhoodRange::OptionalPixelAccessParameter
Definition: itkShapedImageNeighborhoodRange.h:127
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::QualifiedIterator
QualifiedIterator(const QualifiedIterator< false > &arg) noexcept
Definition: itkShapedImageNeighborhoodRange.h:396
itk::Experimental::ShapedImageNeighborhoodRange::OptionalPixelAccessParameterType
typename OptionalPixelAccessParameter< TImageNeighborhoodPixelAccessPolicy >::Type OptionalPixelAccessParameterType
Definition: itkShapedImageNeighborhoodRange.h:153
itk::Experimental::ShapedImageNeighborhoodRange::PixelProxy< true, TDummy >::m_PixelAccessPolicy
const TImageNeighborhoodPixelAccessPolicy m_PixelAccessPolicy
Definition: itkShapedImageNeighborhoodRange.h:177
itk::Experimental::ShapedImageNeighborhoodRange::PixelProxy< false, TDummy >::operator=
PixelProxy & operator=(const PixelProxy &pixelProxy) noexcept
Definition: itkShapedImageNeighborhoodRange.h:251
itk::Experimental::ShapedImageNeighborhoodRange::cbegin
const_iterator cbegin() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:742
itk::Experimental::ShapedImageNeighborhoodRange::ImageRegionType
typename TImage::RegionType ImageRegionType
Definition: itkShapedImageNeighborhoodRange.h:144
itk::Experimental::ShapedImageNeighborhoodRange::m_OffsetTable
OffsetType m_OffsetTable
Definition: itkShapedImageNeighborhoodRange.h:632
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::operator+
friend QualifiedIterator operator+(const difference_type n, QualifiedIterator it) noexcept
Definition: itkShapedImageNeighborhoodRange.h:570
itk::Experimental::ShapedImageNeighborhoodRange::const_reverse_iterator
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition: itkShapedImageNeighborhoodRange.h:653
itk::Experimental::ShapedImageNeighborhoodRange::m_ShapeOffsets
const OffsetType * m_ShapeOffsets
Definition: itkShapedImageNeighborhoodRange.h:642
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::QualifiedImageType
typename std::conditional< VIsConst, const ImageType, ImageType >::type QualifiedImageType
Definition: itkShapedImageNeighborhoodRange.h:299
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::Experimental::ShapedImageNeighborhoodRange::IndexType
typename TImage::IndexType IndexType
Definition: itkShapedImageNeighborhoodRange.h:149
itk::Experimental::ShapedImageNeighborhoodRange::ShapedImageNeighborhoodRange
ShapedImageNeighborhoodRange(ImageType &image, const IndexType &location, const TContainerOfOffsets &shapeOffsets, const OptionalPixelAccessParameterType optionalPixelAccessParameter={})
Definition: itkShapedImageNeighborhoodRange.h:706
itk::Experimental::ShapedImageNeighborhoodRange::const_iterator
QualifiedIterator< true > const_iterator
Definition: itkShapedImageNeighborhoodRange.h:650
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::operator-
friend difference_type operator-(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkShapedImageNeighborhoodRange.h:549
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::operator-=
friend QualifiedIterator & operator-=(QualifiedIterator &it, const difference_type n) noexcept
Definition: itkShapedImageNeighborhoodRange.h:540
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::operator--
QualifiedIterator & operator--() noexcept
Definition: itkShapedImageNeighborhoodRange.h:444
itk::Experimental::ShapedImageNeighborhoodRange::RegionData::m_Size
ImageSizeType m_Size
Definition: itkShapedImageNeighborhoodRange.h:603
itk::Experimental::ShapedImageNeighborhoodRange::m_RelativeLocation
IndexType m_RelativeLocation
Definition: itkShapedImageNeighborhoodRange.h:639
itk::Experimental::ShapedImageNeighborhoodRange::PixelProxy
Definition: itkShapedImageNeighborhoodRange.h:164
itk::Experimental::ShapedImageNeighborhoodRange::iterator
QualifiedIterator< IsImageTypeConst > iterator
Definition: itkShapedImageNeighborhoodRange.h:651
itk::Experimental::ShapedImageNeighborhoodRange::NeighborhoodAccessorFunctorType
typename TImage::NeighborhoodAccessorFunctorType NeighborhoodAccessorFunctorType
Definition: itkShapedImageNeighborhoodRange.h:147
itk::Experimental::ShapedImageNeighborhoodRange::cend
const_iterator cend() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:749
itkIndex.h
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::QualifiedPixelType
typename std::conditional< IsImageTypeConst, const PixelType, PixelType >::type QualifiedPixelType
Definition: itkShapedImageNeighborhoodRange.h:307
itk::Experimental::ShapedImageNeighborhoodRange::PixelProxy< false, TDummy >::swap
friend void swap(PixelProxy lhs, PixelProxy rhs) noexcept
Definition: itkShapedImageNeighborhoodRange.h:262
itk::Offset< ImageDimension >
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::operator>
friend bool operator>(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkShapedImageNeighborhoodRange.h:504
itk::Experimental::ShapedImageNeighborhoodRange::CheckPolicy::HasPixelAccessParameterType
static constexpr bool HasPixelAccessParameterType
Definition: itkShapedImageNeighborhoodRange.h:120
itk::Experimental::ShapedImageNeighborhoodRange::m_OptionalPixelAccessParameter
OptionalPixelAccessParameterType m_OptionalPixelAccessParameter
Definition: itkShapedImageNeighborhoodRange.h:647
itk::Experimental::ShapedImageNeighborhoodRange::PixelProxy< false, TDummy >::PixelProxy
PixelProxy(InternalPixelType *const imageBufferPointer, const TImageNeighborhoodPixelAccessPolicy &pixelAccessPolicy) noexcept
Definition: itkShapedImageNeighborhoodRange.h:232
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkArray.h:26
itk::Experimental::ShapedImageNeighborhoodRange::crbegin
const_reverse_iterator crbegin() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:770
itk::Experimental::ShapedImageNeighborhoodRange::m_BufferedRegionData
RegionData m_BufferedRegionData
Definition: itkShapedImageNeighborhoodRange.h:629
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::operator<
friend bool operator<(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkShapedImageNeighborhoodRange.h:491
itk::OffsetValueType
signed long OffsetValueType
Definition: itkIntTypes.h:94
itk::Experimental::ShapedImageNeighborhoodRange::empty
bool empty() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:793
itk::Experimental::ShapedImageNeighborhoodRange::IsImageTypeConst
static constexpr bool IsImageTypeConst
Definition: itkShapedImageNeighborhoodRange.h:593
itk::IndexValueType
signed long IndexValueType
Definition: itkIntTypes.h:90
itk::Experimental::ShapedImageNeighborhoodRange::crend
const_reverse_iterator crend() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:777
itk::Experimental::ShapedImageNeighborhoodRange::SubtractIndex
void SubtractIndex(IndexType &index1, const IndexType &index2)
Definition: itkShapedImageNeighborhoodRange.h:615
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::operator>=
friend bool operator>=(const QualifiedIterator &lhs, const QualifiedIterator &rhs) noexcept
Definition: itkShapedImageNeighborhoodRange.h:522
itk::Offset::begin
iterator begin()
Definition: itkOffset.h:311
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::pointer
QualifiedPixelType * pointer
Definition: itkShapedImageNeighborhoodRange.h:378
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::m_CurrentOffset
const OffsetType * m_CurrentOffset
Definition: itkShapedImageNeighborhoodRange.h:329
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::iterator_category
std::random_access_iterator_tag iterator_category
Definition: itkShapedImageNeighborhoodRange.h:379
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::m_OffsetTable
OffsetType m_OffsetTable
Definition: itkShapedImageNeighborhoodRange.h:316
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::difference_type
std::ptrdiff_t difference_type
Definition: itkShapedImageNeighborhoodRange.h:375
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::operator++
QualifiedIterator operator++(int) noexcept
Definition: itkShapedImageNeighborhoodRange.h:433
itk::Experimental::ShapedImageNeighborhoodRange
Definition: itkShapedImageNeighborhoodRange.h:94
itk::Experimental::ShapedImageNeighborhoodRange::PixelProxy< true, TDummy >::PixelProxy
PixelProxy(const InternalPixelType *const imageBufferPointer, const TImageNeighborhoodPixelAccessPolicy &pixelAccessPolicy) noexcept
Definition: itkShapedImageNeighborhoodRange.h:190
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::value_type
PixelType value_type
Definition: itkShapedImageNeighborhoodRange.h:376
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::IsImageTypeConst
static constexpr bool IsImageTypeConst
Definition: itkShapedImageNeighborhoodRange.h:301
itk::Experimental::ShapedImageNeighborhoodRange::RegionData::RegionData
RegionData() noexcept=default
itk::Experimental::ShapedImageNeighborhoodRange::rbegin
reverse_iterator rbegin() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:756
itk::Experimental::ShapedImageNeighborhoodRange::end
iterator end() const noexcept
Definition: itkShapedImageNeighborhoodRange.h:728
itk::Experimental::ShapedImageNeighborhoodRange::PixelProxy< true, TDummy >::PixelProxy
PixelProxy(const PixelProxy< false > &pixelProxy) noexcept
Definition: itkShapedImageNeighborhoodRange.h:197
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::CreatePixelAccessPolicy
TImageNeighborhoodPixelAccessPolicy CreatePixelAccessPolicy(EmptyPixelAccessParameter) const
Definition: itkShapedImageNeighborhoodRange.h:353
itk::Experimental::ShapedImageNeighborhoodRange::PixelProxy< true, TDummy >::m_ImageBufferPointer
const InternalPixelType *const m_ImageBufferPointer
Definition: itkShapedImageNeighborhoodRange.h:174
itk::Experimental::ShapedImageNeighborhoodRange::ImageType
TImage ImageType
Definition: itkShapedImageNeighborhoodRange.h:140
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:83
itk::Experimental::ShapedImageNeighborhoodRange::QualifiedIterator::CreatePixelAccessPolicy
TImageNeighborhoodPixelAccessPolicy CreatePixelAccessPolicy(const TPixelAccessParameter pixelAccessParameter) const
Definition: itkShapedImageNeighborhoodRange.h:362
itkSize.h
itk::Experimental::ShapedImageNeighborhoodRange::SetLocation
void SetLocation(const IndexType &location) noexcept
Definition: itkShapedImageNeighborhoodRange.h:818