<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 __otbGenericRSResampleImageFilter_h
#define __otbGenericRSResampleImageFilter_h

#include "itkImageToImageFilter.h"
#include "otbStreamingResampleImageFilter.h"
#include "otbPhysicalToRPCSensorModelImageFilter.h"
#include "otbGenericRSTransform.h"

namespace otb
{

/** \class GenericRSResampleImageFilter 
 *  \brief This class is a composite filter that allows you to project 
 *  an input image from any  coordinate system to any other one. The
 *  coordinate systems can be  defined by their projection reference,
 *  the keyword list or a meta data dictionary.
 * 
 *  This class uses the otb::StreamingResampleImageFilter. It defines
 *  and uses a otb::GenericRSTransform using the input/output coordinate
 *  system informations listed below. This class can resample the input to an
 *  output image with the Size/Origin/Spacing/StartIndex defined by
 *  the user. Note that there are no default values for all the
 *  parmeters, so it is mandatory to set correct parameters to have a
 *  correct result.
 * 
 *  
 *
 * \ingroup Projection
 *
 **/

template <class TInputImage, class TOutputImage>
class ITK_EXPORT GenericRSResampleImageFilter :
    public itk::ImageToImageFilter<TInputImage, TOutputImage>
{
public:
  /** Standard class typedefs. */
  typedef GenericRSResampleImageFilter                          Self;
  typedef itk::ImageToImageFilter<TInputImage, TOutputImage>    Superclass;
  typedef itk::SmartPointer<Self>                               Pointer;
  typedef itk::SmartPointer<const Self>                         ConstPointer;

  /** Method for creation through the object factory. */
  itkNewMacro(Self);

  /** Run-time type information (and related methods). */
  itkTypeMacro(GenericRSResampleImageFilter,itk::ImageToImageFilter);

  /** Typedef parameters*/
  typedef TInputImage                                     InputImageType;
  typedef TOutputImage                                    OutputImageType;
  typedef typename OutputImageType::InternalPixelType     OutputInternalPixelType;
  typedef typename OutputImageType::PointType             OutputPointType;
  
  /** Internal filters typedefs*/
  typedef StreamingResampleImageFilter<InputImageType,
                                 OutputImageType>          ResamplerType;
  typedef typename ResamplerType::Pointer                  ResamplerPointerType;
  typedef typename ResamplerType::TransformType            TransformType;
  typedef typename ResamplerType::SizeType                 SizeType;
  typedef typename ResamplerType::SpacingType              SpacingType;
  typedef typename ResamplerType::OriginType               OriginType;
  typedef typename ResamplerType::IndexType                IndexType;
  typedef typename ResamplerType::RegionType               RegionType;
  typedef typename ResamplerType::InterpolatorType         InterpolatorType;
  
  /** Estimate the rpc model */
  typedef PhysicalToRPCSensorModelImageFilter<InputImageType>  InputRpcModelEstimatorType;
  typedef typename InputRpcModelEstimatorType::Pointer         InputRpcModelEstimatorPointerType;
  
  typedef PhysicalToRPCSensorModelImageFilter<OutputImageType> OutputRpcModelEstimatorType;
  typedef typename OutputRpcModelEstimatorType::Pointer        OutputRpcModelEstimatorPointerType;
  
  
  /** Specialisation of OptResampleFilter with a remote 
    * sensing  transform 
    */
  typedef GenericRSTransform<>                       GenericRSTransformType;
  typedef typename GenericRSTransformType::Pointer   GenericRSTransformPointerType;
  
  typedef itk::ImageBase<OutputImageType::ImageDimension>      ImageBaseType;
  
  /** The Deformation field spacing & size */
  void SetDeformationFieldSpacing(const SpacingType & spacing)
  {
    m_Resampler->SetDeformationFieldSpacing(spacing);
    this->Modified();
  }
  otbGetObjectMemberConstReferenceMacro(Resampler,
                                        DeformationFieldSpacing,
                                        SpacingType);
  
  /** The resampled image parameters */
  /** Output Origin */
  void SetOutputOrigin(const OriginType & origin)
  {
    m_Resampler->SetOutputOrigin(origin);
    this->Modified();
  }
  otbGetObjectMemberConstReferenceMacro(Resampler,OutputOrigin,OriginType);<commit_msg>ENH : use a macro<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 __otbGenericRSResampleImageFilter_h
#define __otbGenericRSResampleImageFilter_h

#include "itkImageToImageFilter.h"
#include "otbStreamingResampleImageFilter.h"
#include "otbPhysicalToRPCSensorModelImageFilter.h"
#include "otbGenericRSTransform.h"

namespace otb
{

/** \class GenericRSResampleImageFilter 
 *  \brief This class is a composite filter that allows you to project 
 *  an input image from any  coordinate system to any other one. The
 *  coordinate systems can be  defined by their projection reference,
 *  the keyword list or a meta data dictionary.
 * 
 *  This class uses the otb::StreamingResampleImageFilter. It defines
 *  and uses a otb::GenericRSTransform using the input/output coordinate
 *  system informations listed below. This class can resample the input to an
 *  output image with the Size/Origin/Spacing/StartIndex defined by
 *  the user. Note that there are no default values for all the
 *  parmeters, so it is mandatory to set correct parameters to have a
 *  correct result.
 * 
 *  
 *
 * \ingroup Projection
 *
 **/

template <class TInputImage, class TOutputImage>
class ITK_EXPORT GenericRSResampleImageFilter :
    public itk::ImageToImageFilter<TInputImage, TOutputImage>
{
public:
  /** Standard class typedefs. */
  typedef GenericRSResampleImageFilter                          Self;
  typedef itk::ImageToImageFilter<TInputImage, TOutputImage>    Superclass;
  typedef itk::SmartPointer<Self>                               Pointer;
  typedef itk::SmartPointer<const Self>                         ConstPointer;

  /** Method for creation through the object factory. */
  itkNewMacro(Self);

  /** Run-time type information (and related methods). */
  itkTypeMacro(GenericRSResampleImageFilter,itk::ImageToImageFilter);

  /** Typedef parameters*/
  typedef TInputImage                                     InputImageType;
  typedef TOutputImage                                    OutputImageType;
  typedef typename OutputImageType::InternalPixelType     OutputInternalPixelType;
  typedef typename OutputImageType::PointType             OutputPointType;
  
  /** Internal filters typedefs*/
  typedef StreamingResampleImageFilter<InputImageType,
                                 OutputImageType>          ResamplerType;
  typedef typename ResamplerType::Pointer                  ResamplerPointerType;
  typedef typename ResamplerType::TransformType            TransformType;
  typedef typename ResamplerType::SizeType                 SizeType;
  typedef typename ResamplerType::SpacingType              SpacingType;
  typedef typename ResamplerType::OriginType               OriginType;
  typedef typename ResamplerType::IndexType                IndexType;
  typedef typename ResamplerType::RegionType               RegionType;
  typedef typename ResamplerType::InterpolatorType         InterpolatorType;
  
  /** Estimate the rpc model */
  typedef PhysicalToRPCSensorModelImageFilter<InputImageType>  InputRpcModelEstimatorType;
  typedef typename InputRpcModelEstimatorType::Pointer         InputRpcModelEstimatorPointerType;
  
  typedef PhysicalToRPCSensorModelImageFilter<OutputImageType> OutputRpcModelEstimatorType;
  typedef typename OutputRpcModelEstimatorType::Pointer        OutputRpcModelEstimatorPointerType;
  
  
  /** Specialisation of OptResampleFilter with a remote 
    * sensing  transform 
    */
  typedef GenericRSTransform<>                       GenericRSTransformType;
  typedef typename GenericRSTransformType::Pointer   GenericRSTransformPointerType;
  
  typedef itk::ImageBase<OutputImageType::ImageDimension>      ImageBaseType;
  
  /** The Deformation field spacing & size */
  otbSetObjectMemberMacro(Resampler,DeformationFieldSpacing, SpacingType);

  otbGetObjectMemberConstReferenceMacro(Resampler,
                                        DeformationFieldSpacing,
                                        SpacingType);
  
  /** The resampled image parameters */
  /** Output Origin */
  void SetOutputOrigin(const OriginType & origin)
  {
    m_Resampler->SetOutputOrigin(origin);
    this->Modified();
  }
  otbGetObjectMemberConstReferenceMacro(Resampler,OutputOrigin,OriginType);
{'fraction_non_alphanumeric': 0.08858124284375976, 'fraction_numerical': 0.0, 'mean_word_length': 3.357369614512472, 'pattern_counts': {'":': 0, '<': 23, '<?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': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7551918', 'n_tokens_mistral': 2489, 'n_tokens_neox': 2379, 'n_words': 662}