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

Program:   ORFEO Toolbox
Language:  C++
Date:      $Date$
Version:   $Revision$


Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt 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 __otbLineDirectionImageFilter_h
#define __otbLineDirectionImageFilter_h

#include "otbMath.h"
#include "otbLineDirectionFunctor.h"
#include "otbUnaryFunctorNeighborhoodImageFilter.h"
#include "itkConstNeighborhoodIterator.h"


namespace otb
{
  /** \class LineDirectionImageFilter
   *  \brief This functor computes water, ndvi and spectral index of an image
   */

template <class TInputImage, class TOutputImage>
class ITK_EXPORT LineDirectionImageFilter :
public UnaryFunctorNeighborhoodImageFilter< TInputImage,
				            TOutputImage, 
				            Functor::LineDirectionFunctor< ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage>, 
						           		   ITK_TYPENAME TOutputImage::PixelType> >
{
public:
  /** Standard class typedefs. */
  typedef LineDirectionImageFilter                           Self;
  typedef TInputImage                                        InputImageType;
  typedef TOutputImage                                       OutputImageType;
  typedef typename InputImageType::PixelType                 InputPixelType;
  typedef typename InputImageType::InternalPixelType         InputInternalPixelType;
  typedef typename OutputImageType::PixelType                OutputPixelType;
  typedef typename otb::UnaryFunctorNeighborhoodImageFilter< TInputImage,
                                                             TOutputImage, 
               				                     Functor::LineDirectionFunctor< typename itk::ConstNeighborhoodIterator<TInputImage>, 
                                                                                            OutputPixelType > > Superclass;
  typedef itk::SmartPointer<Self>        Pointer;
  typedef itk::SmartPointer<const Self>  ConstPointer;

  /** Method for creation through the object factory. */
  itkNewMacro(Self);
  
  /** Spatial Threshold accessor */
  void SetSpatialThreshold( unsigned int thresh )
    { 
      this->GetFunctor().SetSpatialThreshold( thresh ); 
      this->SetRadius(thresh);
      this->Modified();
    };
  unsigned int GetSpatialThreshold()
    {
      this->GetFunctor().GetSpatialThreshold(); 
    };
  /** Spectral Threshold accessor */
  void SetSpectralThreshold( InputInternalPixelType thresh )
    { <commit_msg>WRG : no return statement<commit_after>/*=========================================================================

Program:   ORFEO Toolbox
Language:  C++
Date:      $Date$
Version:   $Revision$


Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt 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 __otbLineDirectionImageFilter_h
#define __otbLineDirectionImageFilter_h

#include "otbMath.h"
#include "otbLineDirectionFunctor.h"
#include "otbUnaryFunctorNeighborhoodImageFilter.h"
#include "itkConstNeighborhoodIterator.h"


namespace otb
{
  /** \class LineDirectionImageFilter
   *  \brief This functor computes water, ndvi and spectral index of an image
   */

template <class TInputImage, class TOutputImage>
class ITK_EXPORT LineDirectionImageFilter :
public UnaryFunctorNeighborhoodImageFilter< TInputImage,
				            TOutputImage, 
				            Functor::LineDirectionFunctor< ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage>, 
						           		   ITK_TYPENAME TOutputImage::PixelType> >
{
public:
  /** Standard class typedefs. */
  typedef LineDirectionImageFilter                           Self;
  typedef TInputImage                                        InputImageType;
  typedef TOutputImage                                       OutputImageType;
  typedef typename InputImageType::PixelType                 InputPixelType;
  typedef typename InputImageType::InternalPixelType         InputInternalPixelType;
  typedef typename OutputImageType::PixelType                OutputPixelType;
  typedef typename otb::UnaryFunctorNeighborhoodImageFilter< TInputImage,
                                                             TOutputImage, 
               				                     Functor::LineDirectionFunctor< typename itk::ConstNeighborhoodIterator<TInputImage>, 
                                                                                            OutputPixelType > > Superclass;
  typedef itk::SmartPointer<Self>        Pointer;
  typedef itk::SmartPointer<const Self>  ConstPointer;

  /** Method for creation through the object factory. */
  itkNewMacro(Self);
  
  /** Spatial Threshold accessor */
  void SetSpatialThreshold( unsigned int thresh )
    { 
      this->GetFunctor().SetSpatialThreshold( thresh ); 
      this->SetRadius(thresh);
      this->Modified();
    };
  unsigned int GetSpatialThreshold()
    {
      return this->GetFunctor().GetSpatialThreshold(); 
    };
  /** Spectral Threshold accessor */
  void SetSpectralThreshold( InputInternalPixelType thresh )
    { 
{'fraction_non_alphanumeric': 0.11550097882185442, 'fraction_numerical': 0.0, 'mean_word_length': 2.751668891855808, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4327496', 'n_tokens_mistral': 1444, 'n_tokens_neox': 1313, 'n_words': 342}