<commit_before>/*=========================================================================

  Program:   Insight Segmentation & Registration Toolkit
  Module:    itkConstSmartNeighborhoodIterator.h
  Language:  C++
  Date:      $Date$
  Version:   $Revision$

  Copyright (c) 2002 Insight Consortium. All rights reserved.
  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even 
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef __itkConstSmartNeighborhoodIterator_h
#define __itkConstSmartNeighborhoodIterator_h

#include "itkConstNeighborhoodIterator.h"
#include "itkZeroFluxNeumannBoundaryCondition.h"

namespace itk {

/** \class ConstSmartNeighborhoodIterator
 *
 * \brief Const version of SmartNeighborhoodIterator, defining iteration of a
 * local N-dimensional neighborhood of pixels across an itk::Image.
 *
 * ConstSmartNeighborhoodIterator implements the read-only methods of
 * SmartNeighborhoodIterator.  It serves as a base class from which other
 * iterators are derived. See SmartNeighborhoodIterator for more complete
 * information.
 *
 * \ingroup ImageIterators
 *
 * \sa Neighborhood \sa ImageIterator \sa NeighborhoodIterator
 * \sa SmartNeighborhoodIterator \sa RandomAccessNeighborhoodIterator
 */
template<class TImage, class TBoundaryCondition
                       = ZeroFluxNeumannBoundaryCondition<TImage>  >
class ITK_EXPORT ConstSmartNeighborhoodIterator
  :  public ConstNeighborhoodIterator<TImage>
{
public:
  /** Standard class typdefs. */
  typedef ConstSmartNeighborhoodIterator Self;
  typedef ConstNeighborhoodIterator<TImage> Superclass;
  
  /** Extract image type information. */
  typedef typename Superclass::InternalPixelType InternalPixelType;
  typedef typename Superclass::PixelType PixelType;
    
  /** Save the dimension of the image. */
  enum { Dimension = Superclass::Dimension };

  /** Some common itk object typedefs */
  typedef typename Superclass::ImageType ImageType;
  typedef typename Superclass::RegionType RegionType;
  typedef typename Superclass::SizeType SizeType;
  typedef typename Superclass::SizeValueType SizeValueType;
  typedef typename Superclass::NeighborhoodType NeighborhoodType;
  typedef typename Superclass::IndexType IndexType;
  typedef typename Superclass::IndexValueType IndexValueType;
  typedef typename Superclass::OffsetType OffsetType;
  typedef typename Superclass::OffsetValueType OffsetValueType;
  
  /** Typedef for generic boundary condition pointer */
  typedef typename Superclass::ImageBoundaryConditionPointerType
         ImageBoundaryConditionPointerType;

  /** Typedef for boundary condition type. */
  typedef TBoundaryCondition BoundaryConditionType;
  
  /** Support for internal iterator types.  Only const iteration is supported
   * in this class. */
  typedef typename Superclass::ConstIterator ConstIterator;
  
  /** Default constructor. */
  ConstSmartNeighborhoodIterator()
    : Superclass()
    { this->ResetBoundaryCondition(); }

  /** Copy constructor */
  ConstSmartNeighborhoodIterator(const Self& orig);

  /** Constructor establishes a neighborhood of iterators of a specified
   * dimension to walk a particular image and a particular region of
   * that image. */ 
  ConstSmartNeighborhoodIterator(const SizeType& radius,
                                  ImageType *ptr,
                                 const RegionType& region)
    : Superclass()
    { this->Initialize(radius, ptr, region);
      this->ResetBoundaryCondition(); }

  /** Assignment operator */
  Self &operator=(const Self& orig);

  /** Prints information about the neighborhood pointer structure to
   * std::cout for debugging purposes. */
  virtual void PrintSelf(std::ostream &, Indent) const;<commit_msg>FIX: allow constructor to a const pointer to an image<commit_after>/*=========================================================================

  Program:   Insight Segmentation & Registration Toolkit
  Module:    itkConstSmartNeighborhoodIterator.h
  Language:  C++
  Date:      $Date$
  Version:   $Revision$

  Copyright (c) 2002 Insight Consortium. All rights reserved.
  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even 
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef __itkConstSmartNeighborhoodIterator_h
#define __itkConstSmartNeighborhoodIterator_h

#include "itkConstNeighborhoodIterator.h"
#include "itkZeroFluxNeumannBoundaryCondition.h"

namespace itk {

/** \class ConstSmartNeighborhoodIterator
 *
 * \brief Const version of SmartNeighborhoodIterator, defining iteration of a
 * local N-dimensional neighborhood of pixels across an itk::Image.
 *
 * ConstSmartNeighborhoodIterator implements the read-only methods of
 * SmartNeighborhoodIterator.  It serves as a base class from which other
 * iterators are derived. See SmartNeighborhoodIterator for more complete
 * information.
 *
 * \ingroup ImageIterators
 *
 * \sa Neighborhood \sa ImageIterator \sa NeighborhoodIterator
 * \sa SmartNeighborhoodIterator \sa RandomAccessNeighborhoodIterator
 */
template<class TImage, class TBoundaryCondition
                       = ZeroFluxNeumannBoundaryCondition<TImage>  >
class ITK_EXPORT ConstSmartNeighborhoodIterator
  :  public ConstNeighborhoodIterator<TImage>
{
public:
  /** Standard class typdefs. */
  typedef ConstSmartNeighborhoodIterator Self;
  typedef ConstNeighborhoodIterator<TImage> Superclass;
  
  /** Extract image type information. */
  typedef typename Superclass::InternalPixelType InternalPixelType;
  typedef typename Superclass::PixelType PixelType;
    
  /** Save the dimension of the image. */
  enum { Dimension = Superclass::Dimension };

  /** Some common itk object typedefs */
  typedef typename Superclass::ImageType ImageType;
  typedef typename Superclass::RegionType RegionType;
  typedef typename Superclass::SizeType SizeType;
  typedef typename Superclass::SizeValueType SizeValueType;
  typedef typename Superclass::NeighborhoodType NeighborhoodType;
  typedef typename Superclass::IndexType IndexType;
  typedef typename Superclass::IndexValueType IndexValueType;
  typedef typename Superclass::OffsetType OffsetType;
  typedef typename Superclass::OffsetValueType OffsetValueType;
  
  /** Typedef for generic boundary condition pointer */
  typedef typename Superclass::ImageBoundaryConditionPointerType
         ImageBoundaryConditionPointerType;

  /** Typedef for boundary condition type. */
  typedef TBoundaryCondition BoundaryConditionType;
  
  /** Support for internal iterator types.  Only const iteration is supported
   * in this class. */
  typedef typename Superclass::ConstIterator ConstIterator;
  
  /** Default constructor. */
  ConstSmartNeighborhoodIterator()
    : Superclass()
    { this->ResetBoundaryCondition(); }

  /** Copy constructor */
  ConstSmartNeighborhoodIterator(const Self& orig);

  /** Constructor establishes a neighborhood of iterators of a specified
   * dimension to walk a particular image and a particular region of
   * that image. */ 
  ConstSmartNeighborhoodIterator(const SizeType& radius,
                                 const ImageType *ptr,
                                 const RegionType& region)
    : Superclass()
    { this->Initialize(radius, ptr, region);
      this->ResetBoundaryCondition(); }

  /** Assignment operator */
  Self &operator=(const Self& orig);

  /** Prints information about the neighborhood pointer structure to
   * std::cout for debugging purposes. */
  virtual void PrintSelf(std::ostream &, Indent) const;
{'fraction_non_alphanumeric': 0.10463807975997, 'fraction_numerical': 0.0010001250156269534, 'mean_word_length': 4.420054200542006, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '667199', 'n_tokens_mistral': 2049, 'n_tokens_neox': 1878, 'n_words': 623}